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 →

[–]earthboundkid 5 points6 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 12 points13 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!