[obs-commits] [openSUSE/osc] 36f7b8: Fix a potential TypeError in CpioRead.copyin and C...
Branch: refs/heads/master Home: https://github.com/openSUSE/osc Commit: 36f7b8ffe91ff759c938b1afce5f83be57b39671 https://github.com/openSUSE/osc/commit/36f7b8ffe91ff759c938b1afce5f83be57b39... Author: Marcus Huewe <suse-tux@gmx.de> Date: 2020-11-20 (Fri, 20 Nov 2020) Changed paths: M osc/fetch.py M osc/util/cpio.py Log Message: ----------- Fix a potential TypeError in CpioRead.copyin and CpioRead.copyin_file 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") Commit: 5e313ed48505e070e3343457e45e4ecd82b6ea29 https://github.com/openSUSE/osc/commit/5e313ed48505e070e3343457e45e4ecd82b6e... Author: Marco Strigl <lethliel@gmx.de> Date: 2020-11-20 (Fri, 20 Nov 2020) Changed paths: M osc/fetch.py M osc/util/cpio.py Log Message: ----------- Merge pull request #866 from marcus-h/cpio_bytes_fix Fix a potential TypeError in CpioRead.copyin and CpioRead.copyin_file Compare: https://github.com/openSUSE/osc/compare/d7594ddeda63...5e313ed48505
participants (1)
-
Marco Strigl