mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
python3: don't require bytestring for unrardll comments
unrardll explictly decodes to unicode Note: unrar.py already uses unicode_literals
This commit is contained in:
parent
b6d4442b23
commit
2271463d27
@ -114,20 +114,20 @@ def test_basic():
|
||||
b"Rar!\x1a\x07\x00\xcf\x90s\x00\x00\r\x00\x00\x00\x00\x00\x00\x00\x14\xe7z\x00\x80#\x00\x17\x00\x00\x00\r\x00\x00\x00\x03\xc2\xb3\x96o\x00\x00\x00\x00\x1d3\x03\x00\x00\x00\x00\x00CMT\x0c\x00\x8b\xec\x8e\xef\x14\xf6\xe6h\x04\x17\xff\xcd\x0f\xffk9b\x11]^\x80\xd3dt \x90+\x00\x14\x00\x00\x00\x08\x00\x00\x00\x03\xf1\x84\x93\\\xb9]yA\x1d3\t\x00\xa4\x81\x00\x001\\sub-one\x00\xc0\x0c\x00\x8f\xec\x89\xfe.JM\x86\x82\x0c_\xfd\xfd\xd7\x11\x1a\xef@\x9eHt \x80'\x00\x0e\x00\x00\x00\x04\x00\x00\x00\x03\x9f\xa8\x17\xf8\xaf]yA\x1d3\x07\x00\xa4\x81\x00\x00one.txt\x00\x08\xbf\x08\xae\xf3\xca\x87\xfeo\xfe\xd2n\x80-Ht \x82:\x00\x18\x00\x00\x00\x10\x00\x00\x00\x03\xa86\x81\xdf\xf9fyA\x1d3\x1a\x00\xa4\x81\x00\x00\xe8\xaf\xb6\xe6\xaf\x94\xe5\xb1\x81.txt\x00\x8bh\xf6\xd4kA\\.\x00txt\x0c\x00\x8b\xec\x8e\xef\x14\xf6\xe2l\x91\x189\xff\xdf\xfe\xc2\xd3:g\x9a\x19F=cYt \x928\x00\x11\x00\x00\x00\x08\x00\x00\x00\x03\x7f\xd6\xb6\x7f\xeafyA\x1d3\x16\x00\xa4\x81\x00\x00F\xc3\xbc\xc3\x9fe.txt\x00\x01\x00F\xfc\xdfe\x00.txt\x00\xc0<D\xfe\xc8\xef\xbc\xd1\x04I?\xfd\xff\xdbF)]\xe8\xb9\xe1t \x90/\x00\x13\x00\x00\x00\x08\x00\x00\x00\x03\x1a$\x932\xc2]yA\x1d3\r\x00\xa4\x81\x00\x002\\sub-two.txt\x00\xc0\x10\x00S\xec\xcb\x7f\x8b\xa5(\x0b\x01\xcb\xef\xdf\xf6t\x89\x97z\x0eft \x90)\x00\r\x00\x00\x00\r\x00\x00\x00\x03c\x89K\xd3\xc8fyA\x140\x07\x00\xff\xa1\x00\x00symlink\x00\xc02/sub-two.txt\xeb\x86t\xe0\x90#\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\xb9]yA\x140\x01\x00\xedA\x00\x001\x00\xc0\xe0Dt\xe0\x90#\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\xc2]yA\x140\x01\x00\xedA\x00\x002\x00\xc0u\xa1t \x80,\x00\r\x00\x00\x00\r\x00\x00\x00\x03T\xea\x04\xca\xe6\x84yA\x140\x0c\x00\xa4\x81\x00\x00uncompresseduncompressed\n\xda\x10t \x900\x00\x0e\x00\x00\x00\x04\x00\x00\x00\x035K.\xa6\x18\x85yA\x1d5\x0e\x00\xa4\x81\x00\x00max-compressed\x00\xc0\x00\x08\xbf\x08\xae\xf2\xcc\x01s\xf8\xff\xec\x96\xe8\xc4={\x00@\x07\x00") # noqa }}}
|
||||
|
||||
tdata = {
|
||||
u'1': b'',
|
||||
u'1/sub-one': b'sub-one\n',
|
||||
u'2': b'',
|
||||
u'2/sub-two.txt': b'sub-two\n',
|
||||
u'F\xfc\xdfe.txt': b'unicode\n',
|
||||
u'max-compressed': b'max\n',
|
||||
u'one.txt': b'one\n',
|
||||
u'symlink': b'2/sub-two.txt',
|
||||
u'uncompressed': b'uncompressed\n',
|
||||
u'\u8bf6\u6bd4\u5c41.txt': b'chinese unicode\n'}
|
||||
'1': b'',
|
||||
'1/sub-one': b'sub-one\n',
|
||||
'2': b'',
|
||||
'2/sub-two.txt': b'sub-two\n',
|
||||
'F\xfc\xdfe.txt': b'unicode\n',
|
||||
'max-compressed': b'max\n',
|
||||
'one.txt': b'one\n',
|
||||
'symlink': b'2/sub-two.txt',
|
||||
'uncompressed': b'uncompressed\n',
|
||||
'\u8bf6\u6bd4\u5c41.txt': b'chinese unicode\n'}
|
||||
|
||||
def do_test(stream):
|
||||
c = comment(stream)
|
||||
if c != b'some comment\n':
|
||||
if c != 'some comment\n':
|
||||
raise ValueError('Comment not read: %r != %r' % (c, b'some comment\n'))
|
||||
if set(names(stream)) != {
|
||||
'1/sub-one', 'one.txt', '2/sub-two.txt', '诶比屁.txt', 'Füße.txt',
|
||||
|
Loading…
x
Reference in New Issue
Block a user