Quote:
Originally Posted by siebert
I don't quite understand why it is necessary to change this in python 2, as for python 3 r"C:\Users\foo\Dropbox" works just fine.
|
Because writing code that works properly in both python2 and python3 has found lots of actual, legitimate bugs (some of which were always a problem even on python2), and the downsides of using unicode_literals (something which is recommended for all new code on principle) are nonexistent. I guess you could try reporting a bug against Python 2.7 recommending that it behave the same as Python 3...
"regression" does not mean "it behaves differently", it means "
supported functionality was lost or became broken". This has not happened here -- your ambiguous bytestring has never had a formally documented contract of correctness, and it was arguably always wrong, so "writing python2 compatible code" has always meant doing the most correct thing and being compatible with unicode strings.
Given that unicode_literals is more helpful to people who contribute to calibre development than it is obstructionist to people who don't contribute to calibre development, it seems perfectly reasonable to carry on as-is.
But if you have suggestions backed by code, that suit your needs while at the same time fitting in with the development ideologies represented by the last 9 months of calibre's git history and the various discussions occurring on Github, then by all means, suggest away -- we shall be all ears.