Skip to content

Recent changes broke ez_setup.py on Windows #477

@ghost

Description

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.


Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions