Adding missing unicode_literals imports#83
Conversation
|
I direct your attention to this abomination, among others. The Python 2 standard library frequently expects byte strings and chokes on unicode. Every time you wrap an argument to a standard libary call in |
|
sideboard/sideboard/tests/test_sa.py Line 246 in 24d9fd6 |
|
Feel free to merge this, but know you do against my wishes! Not angry, just disappointed 😢 |
|
RobRuana
left a comment
There was a problem hiding this comment.
Approved... begrudgingly...
Haha, but tell me how you really feel! FWIW, I've updated several codebases to Python 3 and have found that
In each of those cases, the annoying tricks we have to do in order to support If you're ever in a situation where you have a big legacy Python 2.7 codebase and want to port it to Python 3, I strongly recommend that you start by adding With all that being said, I'm okay with relaxing the I'm hoping that by the end of the year we'll have dropped support for enough of our Python 2.7 plugins that we can pull the trigger on officially deprecating Python 2.7 support in Sideboard and then rip out all of the kludgy hacks like that. In the meantime, we can either merge this in or I can go into our local Jenkins jobs and disable the check for |
|
Okay, you have still failed to outline the benefits of |
|
Also, I reject your appeal to authority regarding the projects you've ported to python 3. Just because you've stabbed yourself in the eye a hundred times doesn't mean that we should all continue stabbing ourselves in the eye. |
Fair enough! Saying "I've ported several codebases and found it helpful" is not the same as actually taking the time to explain why. Which I'm probably going to be a jerk and head home for the night without doing since it's well after 8pm :P Two things before I leave:
|
|
Feel free to put For what it's worth I have ALSO ported several projects from python 2 to python 3. I've worked on projects that use On your next project, try doing it without |
|
Haha, fair enough. FWIW, you do have me questioning whether But now I'm wondering whether that was just a coincidence, since protlib involves a lot of serialization and I/O, which is more prone to caring about bytes/unicode distinctions. http://www.reactiongifs.com/wp-content/uploads/2013/10/tim-and-eric-mind-blown.gif On the other hand, I probably still stand by my recommendation to use |
MAGFest uses Python 3 and so doesn't care about
from __future__ import unicode_literalsbut at my day job we still use Python 2.7 for a couple of legacy codebases and so we have our local builds check for the presence of that line in every Python file in the Sideboard codebase. I've added it in to a few new files where it was missing; I didn't think to check for it when I was reviewing those files since all of my new projects have been on Python 3 for some time.I also removed the unnecessary Travis line we discussed in the other PR.