-
Couldn't load subscription status.
- Fork 1.9k
String literals
beets is very attached to unicode input and output. So when writing code you should follow these guidelines for usage of string literals in beets source:
-
All outputs to logging module should be marked with
u. (log.debug/warn/info/etc(u'foo') -
Arguments to exceptions: Almost always
u. (raise Exception(u'foo')) -
print_and such: Alwaysu.(print(u'foo')) -
Methods
__str__()and__repr__()should always return native python strings (return 'foo') -
URLs and data for HTTP requests: native strings (
'foo') -
SQL Statements: native strings (
'foo') -
Pieces of filenames: Always
b, unless it's in some parts of thedestinationmethod before the path is encoded. (b'foo.mp3')
For details and discussion on string and unicode literals see #1887