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

unwanted unicode passed to args #710

Closed
jdmarino opened this issue Aug 19, 2011 · 2 comments
Closed

unwanted unicode passed to args #710

jdmarino opened this issue Aug 19, 2011 · 2 comments
Milestone

Comments

@jdmarino
Copy link

(N00b to python and iPython)

Windows, python2.7, iPython 0.11

When using "run" with args, the receiving program gets unicode, not vanilla strings. This was not the case under 0.1 and is still not the case when python is run from the windows command line (i.e.when not using iPython).

Example: optional arg is a string that looks like a list: 'abc,def'. The receiving proc now gets u'abc,def', which when split() becomes a tuple (u'abc', u'def'). This is a problem for me because the string representation of the tuple is now different than it used to be (it includes the 'u'), so using the string as a key to a shelf stored before the change does not work. (That is, the shelf was made with key "('abc', 'def')" under 0.10, but now I'm trying to find "(u'abc', u'def')" under iPython 0.11 and cannot.)

The lack of default backward compatibility is forcing me to insulate my code with str(). Is there some setting to calm down the use of unicode?

@takluyver
Copy link
Member

At present, I don't think there is. It might get looked into for 0.12 - a couple of people have mentioned it.

@fperez
Copy link
Member

fperez commented Aug 19, 2011

Let's mark this as high-priority for 0.12. It's indeed affecting more than one person, and we are breaking (albeit unintentionally) a low-level behavior that programs expect, so it's definitely a bug on our side.

minrk added a commit to minrk/ipython that referenced this issue Oct 18, 2011
Protects %run and `ipython script.py` from getting unicode sys.argv on Python 2

closes ipython#710
@minrk minrk closed this as completed in 71d3d18 Oct 19, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Protects %run and `ipython script.py` from getting unicode sys.argv on Python 2

closes ipython#710
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants