[issue18949] codeop possible flow erro
New submission from Wilberto Morales: I think the way this loop in /Lib/codeop.py is wrong def _maybe_compile(compiler, source, filename, symbol): # Check for source consisting of only blank lines and comments for line in source.split("\n"): line = line.strip() if line and line[0] != '#': break # Leave it alone else: if symbol != "eval": source = "pass" # Replace it with a 'pass' statement I think the else statement shouldn't be there. -- messages: 197091 nosy: Wilberto priority: normal severity: normal status: open title: codeop possible flow erro type: behavior versions: Python 3.5 ___ Python tracker <http://bugs.python.org/issue18949> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18949] codeop possible flow error
Changes by Wilberto Morales : -- title: codeop possible flow erro -> codeop possible flow error ___ Python tracker <http://bugs.python.org/issue18949> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18949] codeop possible flow error
Wilberto Morales added the comment: I can't provide a example but reading the source comments it seems wrong. 'First, check if the source consists entirely of blank lines and comments; if so, replace it with 'pass', because the built-in parser doesn't always do the right thing for these.' So the way I understand this is. pure_comments_or_blank = True for line in source: line = line.strip() if line and line[0] != '#': pure_comments_or_blank = False break if pure_comments_or_blank: if symbol != "eval": source = "pass" So check that atleast one line is actual code and not comments or blank. If none is then replace it with a 'pass' Instead the loop seems a little weird. for line in source.split("\n"): line = line.strip() if line and line[0] != '#': break # Leave it alone else: if symbol != "eval": source = "pass" If it finds a something that is not a comment in a line it breaks. But then right after the for loop it contains an else statement. I'm not even sure when this else statement is executed. I'm sorry if I'm misinterpreting this. -- ___ Python tracker <http://bugs.python.org/issue18949> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22311] Pip 404's
New submission from Wilberto Morales: I know that issues like this one are usually on the users(my) fault, but I think pip might be broken this time for real. Every time I run pip install, a 404 error is raised: (venv) /tmp wil >>> pip install flask Requirement already satisfied (use --upgrade to upgrade): flask in /home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/Flask-0.11_dev-py3.5.egg Downloading/unpacking Werkzeug>=0.7 (from flask) HTTP error 404 while getting https://pypi.python.org/simple/packages/source/W/Werkzeug/Werkzeug-0.9.6.tar.gz#md5=f7afcadc03b0f2267bdc156c34586043 (from https://pypi.python.org/simple/werkzeug/) Cleaning up... Exception: Traceback (most recent call last): File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/basecommand.py", line 122, in main status = self.run(options, args) File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/commands/install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/req.py", line 1197, in prepare_files do_download, File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/req.py", line 1375, in unpack_url self.session, File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/download.py", line 547, in unpack_http_url resp.raise_for_status() File "/home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/_vendor/requests/models.py", line 795, in raise_for_status raise HTTPError(http_error_msg, response=self) pip._vendor.requests.exceptions.HTTPError: 404 Client Error: Not Found /home/wil/Programming/open/skinner/venv/lib/python3.5/site-packages/pip/basecommand.py:158: ResourceWarning: unclosed exit = UNKNOWN_ERROR Storing debug log for failure in /home/wil/.pip/pip.log With flask-sqlalchemy as a example. Right: https://pypi.python.org/packages/source/F/Flask-SQLAlchemy/Flask-SQLAlchemy-2.0.tar.gz#md5=06ae73194cca73b72e178f870d1dac7c PIP(wrong): https://pypi.python.org/simple/packages/source/F/Flask-SQLAlchemy/Flask-SQLAlchemy-2.0.tar.gz/#md5=06ae73194cca73b72e178f870d1dac7c Notice the simple added after to .org and the / added after .tar.gz -- messages: 226160 nosy: wilbertom priority: normal severity: normal status: open title: Pip 404's versions: Python 3.5 ___ Python tracker <http://bugs.python.org/issue22311> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22311] Pip 404's
Wilberto Morales added the comment: Good to know I'm not the only one. In the comments above, scratch the "/" after .gz. Looks like it's just a redirect adding it. This is the actual url generated. https://pypi.python.org/simple/packages/source/W/Werkzeug/Werkzeug-0.9.6.tar.gz#md5=f7afcadc03b0f2267bdc156c34586043 -- ___ Python tracker <http://bugs.python.org/issue22311> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22311] Pip 404's
Wilberto Morales added the comment: Also I see PIP is it's own project. Should I migrate the issue? It won't be as easy as I thought to fix. >>> git diff diff --git a/pip/_vendor/distlib/locators.py b/pip/_vendor/distlib/locators.py index 07bc1fd..b7ef31a 100644 --- a/pip/_vendor/distlib/locators.py +++ b/pip/_vendor/distlib/locators.py @@ -949,7 +949,7 @@ class AggregatingLocator(Locator): # versions which don't conform to PEP 426 / PEP 440. default_locator = AggregatingLocator( JSONLocator(), -SimpleScrapingLocator('https://pypi.python.org/simple/', +SimpleScrapingLocator('https://pypi.python.org/', timeout=3.0), scheme='legacy') diff --git a/pip/cmdoptions.py b/pip/cmdoptions.py index 7c68738..738bbf5 100644 --- a/pip/cmdoptions.py +++ b/pip/cmdoptions.py @@ -189,7 +189,7 @@ index_url = OptionMaker( '-i', '--index-url', '--pypi-url', dest='index_url', metavar='URL', -default='https://pypi.python.org/simple/', +default='https://pypi.python.org/', help='Base URL of Python Package Index (default %default).') extra_index_url = OptionMaker( Still gives errors. A different one. -- ___ Python tracker <http://bugs.python.org/issue22311> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com