On Nov 5, 12:35 am, Stefan Behnel <stefan...@behnel.de> wrote: > John Machin, 04.11.2009 02:56: > > > On Nov 4, 12:14 pm, Kee Nethery wrote: > >> The reason I am confused is that getResponse2 is classified as an > >> "str" in the Komodo IDE. I want to make sure I don't lose the non- > >> ASCII characters coming from the URL. > > > str is all about 8-bit bytes. > > True in Py2.x, false in Py3.
And the context was 2.x. > What you mean is the "bytes" type, which, sadly, was named "str" in Python > 2.x. What you mean is the "bytes" concept. > The problem the OP ran into was due to the fact that Python 2.x handled > "ASCII characters in a unicode string" <-> "ASCII encoded byte string" > conversion behind the scenes, which lead to all sorts of trouble to loads > of people, and was finally discarded in Python 3.0. What you describe is the symptom. The problems are (1) 2.X ET expects a str object but the OP supplied a unicode object, and (2) 2.X ET didn't check that, so it accidentally "worked" provided the contents were ASCII-only, and otherwise gave a novice-mystifying error message. -- http://mail.python.org/mailman/listinfo/python-list