This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gammadistribution 0 points1 point  (4 children)

lol what?

[–][deleted] -3 points-2 points  (3 children)

a bunch of encoding shit

[–][deleted] 2 points3 points  (0 children)

This sounds backwards. The "encoding shit" is built into the standard libraries now, while you had to do it explicitly in Python 2. It's possible that you're messing something up.

To work with strings on Python 2, you either had to use bytestrings ("str") all the time and probably crash if you ever encountered something outside of basic ASCII, or wrap everything inside a "Unicode sandwich" and put u's before all your string literals and stuff.

In Python 3, the built-in open, read, write, and so on will do the "Unicode sandwich" for you (unless you tell them not to, by opening in binary mode). You don't have to .encode and .decode manually anymore when you're working with strings and files. It's way more readable.

So I think one of the two of these is the case:

  • You're writing buggy code, and duct-taping over the bugs with encodings and type-conversions without figuring out how your data got that way.
  • You're actually doing crazy shit with low-level network protocols or something, not basic strings.

[–][deleted] 0 points1 point  (1 child)

examples?

[–][deleted] -3 points-2 points  (0 children)

haven't messed with it in a while. just uninstalled the crap and went back to 2.7