Ensure package name isn't unicode in Python2 distutils#597
Conversation
|
Since the issue only affects Python 2, I'd expect the fix to only affect Python 2, which would also provide a clearer indication of the scope of the error. As written, I wouldn't expect my future self to know that this code can be removed when Python 2.7 support is removed. Also, why select on |
|
@jaraco -- you are right, and I didn't research if later Python 2 distutils versions have fixed this. I think it would be okay to not care which distutils versions exactly are causing the issue and simplify this as a Python 2 fix, expressing that in the comments...? |
Yes. Read #190:
|
|
I guess what I'm getting at is that since the Python 3 implementation does the right thing currently, this code shouldn't affect that, but this code does. In particular, the proposed implementation will convert bytes into the repr of their value, masking the underlying error. How about instead, something like: That implementation (a) captures the PY2 specific behavior, (b) only affects if unicode is passed, and (c) provides forward-compatibility, allowing for unicode values to be passed and treated just like unicode values are handled on Python 3. |
|
Hi @jaraco
Thanks for dedicating interest and putting thought into a better solution! I agree, it's a better fix, cleaner and doesn't affect Python 3 behaviour. Squashed into 1 commit and |
|
Thanks for bringing the suggestions to the table and working through my concerns. |
Problem encountered on Ubuntu 14.04
Fixes #190
If people need to fix this without this patch, they have to wrap their package names in
str()like so: