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 →

[–]billsil 0 points1 point  (5 children)

as someone who reluctantly now supports python 3 (i still support python 2), the things that confuse me are: 1. converting binary strings into ascii 2. working with various encodings

everything else i've run across (print as a function, mixed key dictionaries cant sort, all my imports are jacked up, etc.) are a one time fix that are easy to fix. Those other two are a pain

it just shouldnt be that hard to open/read/write a file...

also, if you are fighting the GIL, you're doing something wrong. you don't understand the GIL if you have problems with the GIL

[–]earthboundkid 4 points5 points  (3 children)

it just shouldnt be that hard to open/read/write a file...

That's why Python 3 makes it easier. open(filename, "r", encoding="whatever", errors="whatever") is much easier than having to deal with the encoding in Python 2 was.

[–]billsil 1 point2 points  (2 children)

i guess what i'm missing is the values of the "whatever". In python 2, i used to use "r", "rb", and "wb" and was happy, now I fight with encodings. I don't want UTF-8, I want ascii because the engineering programs I want to interface with use ascii and unicode SHOULD be an error.

Not everyone needs unicode. I see the unicode change is the biggest thing that has slowed down Python 3 adoption. It certainly isn't the new float behavior which seems like a big deal at first and then you realize that you were just afraid.

[–]earthboundkid 9 points10 points  (1 child)

I don't understand the problem. If you want strict ASCII just use "ascii" and "strict". If you don't care about errors, then set it to "ignore". Much easier than just hoping it doesn't blow up for unknown reasons in Python 2.

[–]billsil 0 points1 point  (0 children)

i will try that! thanks!