[New-bugs-announce] [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks

Arfrever Frehtes Taifersar Arahesis report at bugs.python.org
Sun Feb 17 22:23:44 CET 2013


New submission from Arfrever Frehtes Taifersar Arahesis:

Since d4eb02b6aac9 py_compile.compile() replaces target files, breaking special files and symlinks. Any custom permissions set on target files are also lost. This is a major regression.

# cd /tmp
# touch test.py
# ls -l /dev/null
crw-rw-rw- 1 root root 1, 3 Feb 17 21:16 /dev/null
# python3.3 -c 'import py_compile; py_compile.compile("test.py", cfile="/dev/null")'
# ls -l /dev/null
crw-rw-rw- 1 root root 1, 3 Feb 17 21:16 /dev/null
# python3.4 -c 'import py_compile; py_compile.compile("test.py", cfile="/dev/null")'
# ls -l /dev/null
-rw-r----- 1 root root 102 Feb 17 21:53 /dev/null

----------
messages: 182283
nosy: Arfrever, brett.cannon, eric.snow, ncoghlan
priority: high
severity: normal
status: open
title: py_compile.compile() replaces target files, breaking special files and symlinks
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17222>
_______________________________________


More information about the New-bugs-announce mailing list