Re:Sunsetting Python 2
by mikepurvis on Monday September 09, 2019 @08:12PM
(#20923924)
Nice. Yeah my life got a lot easier when I learned about `universal_newlines` changing the subprocess return type under Python 3.
The much worse case of this that I dealt with a few years ago was reading in and modifying XML files, and then saving the modified XML contents as strings in a yaml file (a keyed cache). The input XML files (which I didn't control) were not consistent about having the encoding marked, and that really made things a mess for ElementTree.
A taste: https://github.com/ros-infrastructure/rosdistro/search?q=utf...
This program would crash with a UnicodeEncodeError upon encountering any file with a non-latin character in its name on Windows with Python 3.5 or earlier.
I know that's not the version of Python you were targeting, and I know you didn't write this program to be cross-platform, but I wrote a similar program and I was repeatedly surprised by those sorts of problems. I don't entirely agree with mikepurvis, but I do feel his pain.
Python 2.7: https://repl.it/repls/OrchidDirtyNotification