Skip to content
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

Twine does not work on Windows #116

Closed
mhils opened this issue Jul 21, 2015 · 4 comments
Closed

Twine does not work on Windows #116

mhils opened this issue Jul 21, 2015 · 4 comments
Labels

Comments

@mhils
Copy link
Contributor

mhils commented Jul 21, 2015

Twine fails on Windows as it apparently treats all input as unicode:

> twine upload dist/*
Uploading distributions to https://pypi.python.org/pypi
Enter your username: mhils
TypeError: must be char, not unicode

> twine upload -u mhils netlib-0.13.0.tar.gz
Uploading distributions to https://pypi.python.org/pypi
TypeError: must be char, not unicode

> twine upload -u mhils -p test netlib-0.13.0.tar.gz
Uploading distributions to https://pypi.python.org/pypi
Uploading netlib-0.13.0.tar.gz
HTTPError: 401 Client Error: Incorrect password
> python --version
Python 2.7.10
> pip freeze | grep twine
twine==1.5.0

twine cuts off the stack trace for some reason, so I don't have any other info - sorry.

mhils added a commit to mhils/twine that referenced this issue Jul 21, 2015
`getpass.getpass` only accepts `str` as its first parameter on Windows.
@mhils mhils mentioned this issue Jul 21, 2015
@lrq3000
Copy link

lrq3000 commented Jul 29, 2015

The error is utils.py, in get_password, getpass.getpass somehow generates a unicode string to print the stars to hide the password, and the Windows console doesn't support unicode.

@lrq3000
Copy link

lrq3000 commented Jul 29, 2015

After some quick googling, it seems to be a pretty common problem (see here and even here in django) with getpass on Windows with Python < 3.

Here is a quick and dirty fix, you should maybe adapt it with python version checking and platform checking :

Change

getpass.getpass, 'Enter your password: ',

into:

getpass.getpass, str('Enter your password: '),

@sigmavirus24
Copy link
Member

@mhils feel like updating your PR?

@mhils
Copy link
Contributor Author

mhils commented Jul 29, 2015

Sorry, super busy the last days. It's definitely on my todo list, but may
take a bit. If you want to get it fixed ASAP, go ahead. :-)

Ian Cordasco [email protected] schrieb am Mi., 29. Juli 2015 18:03:

@mhils https://github.com/mhils feel like updating your PR?


Reply to this email directly or view it on GitHub
#116 (comment).

mhils added a commit to mhils/twine that referenced this issue Aug 7, 2015
mhils added a commit to mhils/twine that referenced this issue Aug 8, 2015
sigmavirus24 added a commit that referenced this issue Sep 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants