-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove import of unicode_literals #1887
Conversation
You need to be careful with converting too eagerly to unicode strings: Python 2's support for equality comparisons is garbage and doesn't work if you're dealing with non-ascii data. Really you need to deal with three types: Ideally we'd do all of the following in one huge step:
|
Awesome! Thanks for taking the first step. Yes, the majority of string literals should be
We should also consider running unicode-nazi occasionally to catch some bad comparisons. |
What will we do with SQL statements? |
Good question. After a little googling, I think the answer is native/unannotated strings. |
* acousticbrainz * badfiles * bpm
* bucket * chroma * convert * discogs
* echonest * edit * embedart * embyupdate
* fetchart * freedesktop * fromfilename * ftintitle
* fuzzy * ihate * importadded * importfeeds * info * inline
* keyfinder * lastimport * lyrics
* lastgenere * mbcollection * mbsubmit * mbsync * missing
* mpdstats * mpdupdate * permissions * zero
* play * plexpudate * random * replaygain
* rewrite * scrub * smartplaylist * spotify * the
* thumbnails * types
Ok, |
Please review the above commits and feel free to leave comments |
* nosetests ´test.test_ui´ fails for two tests
@pkess I opened a PR. I still get one failure, but I haven't looked into it yet. |
Hi, thank you for your support. I don't get any failures by running tox on my local machine. I will merge the here to see if travis reports any failures |
Most commonly, this sticks with: log.debug( 'some long message here' ) instead of placing the closing ) at the end of the string literal.
Since the list is short enough now, we don't need parentheses for the line wrap. This is a little less ugly.
AWESOME! ✨ This was a truly huge amount of work. You even got the coveted "diff too large to display" message on GitHub. 🐟 I've scanned over the entire diff and changed a few tiny style things. I also synced with the master branch so this PR can merge cleanly. Everything looks great. Unless there's anything else outstanding, I move to merge this now. |
This adds the [flake8-future-import][f] plugin for flake8, which enforces the standard set of `__future__` imports at the top of all Python files. This revealed a fair number of files that need to be fixed. To be revisited after #1887 is merged. [f]: https://github.com/xZise/flake8-future-import
Ok, would you like to hit the merge button? |
I just added a wiki page with the conventions for strings discussed here: |
Woohoo! ✨ And yes, that wiki page looks great. |
remove import of unicode_literals
This adds the [flake8-future-import][f] plugin for flake8, which enforces the standard set of `__future__` imports at the top of all Python files. This revealed a fair number of files that need to be fixed. To be revisited after beetbox#1887 is merged. [f]: https://github.com/xZise/flake8-future-import
Hi,
as mentioned in #1484 i started a new branch to remove the import of unicode_literals.
With the remove of this import we should explicit mark some strings in the code as unicode strings. In my opinion all output strings and strings compared against some input should be marked as unicode strings.
Please leave your comments!