mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-12 23:56:13 +01:00
36f7b8ffe9
If no "dest" argument is specified when calling CpioRead.copyin or CpioRead.copyin_file, a TypeError occurs in CpioRead._copyin_file because os.getcwd(), which returns a str, is used as dest and, hence, the subsequent os.path.join(...) fails (because it tries to join a str and a bytes). In order to avoid this, encode the result of os.getcwd(). Note that the existing archive.copyin_file(hdr.filename, os.path.dirname(tmpfile), os.path.basename(tmpfile)) was OK because CpioRead._copyin_file os.path.join()s "dest" and "new_fn", which are both str. It is just changed to stress that CpioRead is a bytes-only API. Fixes: #865 ("Traceback in osc/util/cpio.py line 128: TypeError: Can't mix strings and bytes in path components") |
||
---|---|---|
.. | ||
__init__.py | ||
ar.py | ||
archquery.py | ||
cpio.py | ||
debquery.py | ||
helper.py | ||
packagequery.py | ||
repodata.py | ||
rpmquery.py | ||
safewriter.py |