Quote:
Originally Posted by Rev. Bob
And I, for one, am not fluent in Python 3. I can get by enough to make monkey-see, monkey-do tweaks and fixes, as I have in the past, but that kind of wholesale upgrade is beyond me.
|
Most of changes are really easy
_ Correcting mix between space and tabs in source code (should be done even for python 2.6)
_ iteritems() -> items()
_ iterkeys() -> keys()
_ from urlparse import urldefrag, urlparse, urlunparse
-> from urllib.parse import urldefrag, urlparse, urlunparse
_ from urllib import unquote as urlunquote
-> from urllib.parse import unquote as urlunquote
_ unicode -> str (all strings are utf8 now)
The only tricky part is bytes vs str (and file opened or not with b). Sometimes this is utf8 strings sometimes binary data. You just have to add a .decode("utf-8")/ .encode("utf-8") and open files with b option when you are reading/writing binary data. But you need to know what data is expected.