__future__.unicode_literals: don't use r'C:\U' as python2 dislikes it

You get this instead:

SyntaxError: (unicode error) 'rawunicodeescape' codec can't decode bytes in position 2-3: truncated \uXXXX

It does work fine in python3 with native unicode str()
This commit is contained in:
Eli Schwartz 2019-08-28 14:40:23 -04:00
parent dde0e3cd9d
commit d12af03e00
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -24,7 +24,7 @@ class AddFromISBN(QDialog):
QDialog.__init__(self, parent)
self.setup_ui()
path = r'C:\Users\kovid\e-books\some_book.epub' if iswindows else \
path = 'C:\\Users\\kovid\\e-books\\some_book.epub' if iswindows else \
'/Users/kovid/e-books/some_book.epub'
self.label.setText(unicode_type(self.label.text())%path)