Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
unwanted unicode passed to args #710
(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?