Skip to content

Recent changes broke ez_setup.py on Windows #477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Dec 16, 2015 · 5 comments
Closed

Recent changes broke ez_setup.py on Windows #477

ghost opened this issue Dec 16, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 16, 2015

Originally reported by: niik (Bitbucket: niik, GitHub: niik)


This diff or commits 16007a2acbc5662238695f42d3d2ec1db09f0208 and 1e3d99eb4258dc5e7eb506509221c9d350acb9c3 broke downloading the setup zip on WIndows systems with powershell.

The return value from _resolve_version ends up being a unicode string which in turn makes the string interpolation in download_file_powershell produce a string similar to (new-object System.Net.WebClient).DownloadFile(u'https://pypi.python.org/packages/source/s/setuptools/setuptools-19.1.zip', u'setuptools-19.1.zip') which obviously powershell doesn't like:

At line:1 char:48
+ (new-object System.Net.WebClient).DownloadFile(u'https://pypi.python.org/package ...
+                                                ~
Missing ')' in method call.
At line:1 char:48
+ (new-object System.Net.WebClient).DownloadFile(u'https://pypi.python.org/package ...
+                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'u'https://pypi.python.org/packages/source/s/setuptools/setuptools-19.1.zip'' in expression or stateme
nt.
At line:1 char:123
+ ... tools-19.1.zip', u'e:\tmp\setuptools-19.1.zip')
+                    ~
Missing argument in parameter list.
At line:1 char:154
+ ... tools-19.1.zip')
+                    ~
Unexpected token ')' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall

The quick and dirty fix is to change the return line in _resolve_version to return doc['info']['version'].encode('ascii') but I'm guessing switching to the something like str.format which does implicit conversion is preferable.


@ghost
Copy link
Author

ghost commented Dec 17, 2015

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Duplicate of #476.

@ghost
Copy link
Author

ghost commented Dec 17, 2015

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Thanks for the bug report. As the cause is the same, I'm marking this as a duplicate, even though the failure mode is very different.

@ghost
Copy link
Author

ghost commented Dec 17, 2015

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


On second thought, this issue is in fact distinct.

@ghost
Copy link
Author

ghost commented Dec 17, 2015

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Explicitly quote strings rather than relying on repr. Fixes #477.

@ghost
Copy link
Author

ghost commented Dec 17, 2015

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


bootstrap script has been updated and I confirmed the bootstrap installer now passes on Python 2 on Windows.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants