Roundup Robot added the comment:
New changeset e2ccfb096e6a by Brett Cannon in branch 'default':
Issue #17222: fix a mix-up in some exception messages.
http://hg.python.org/cpython/rev/e2ccfb096e6a
--
___
Python tracker rep...@bugs.python.org
Changes by Brett Cannon br...@python.org:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17222
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
stage: - committed/rejected
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17222
___
Arfrever Frehtes Taifersar Arahesis added the comment:
Exception messages are wrong. They contain name of source file instead of
target file.
--
resolution: fixed -
stage: committed/rejected -
status: closed - open
___
Python tracker
Changes by Brett Cannon br...@python.org:
--
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17222
___
Roundup Robot added the comment:
New changeset 46ef1d2af352 by Brett Cannon in branch 'default':
Issue #17222: Raise FileExistsError when py_compile.compile would
http://hg.python.org/cpython/rev/46ef1d2af352
--
___
Python tracker
Armin Rigo added the comment:
Brett: I don't really have a constructive opinion on this matter. I could
suggest putting a bit more logic in py_compile.compile(cfile=...) to revert to
the old behavior if we specify an already-existing target, in order to fix the
other reported issue that
Brett Cannon added the comment:
Thanks for the clarification, Armin!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17222
___
___
Brett Cannon added the comment:
OK, so here was what a patch will need:
* Change py_compile to raise an exception when ``not os.path.isfile(cfile) or
os.path.islink(cfile)``; probably raise ValueError and mention that import
itself would replace the file w/o raising an exception
* Add tests
*
Brett Cannon added the comment:
I'm going to resolve this issue myself, but blog about it on core-mentorship
so others can follow along with how I resolve the bug.
--
assignee: - brett.cannon
___
Python tracker rep...@bugs.python.org
Brett Cannon added the comment:
I'm going to toss Armin's request over to core-mentorship since the fix is
easy. Is all you are after, Armin, a ``not os.path.isfile(cfile) or
os.path.islink(cfile)`` check which if true raises an exception?
--
assignee: brett.cannon -
status: closed -
Armin Rigo added the comment:
That's not really what I'm after, but that's a workaround I proposed to avoid
the worst breakage. I don't have an opinion about what to do with symlinks.
--
___
Python tracker rep...@bugs.python.org
Brett Cannon added the comment:
Armin: I'm going off of http://bugs.python.org/msg189428 where you say you want
an exception raised. If there is something else you want to suggest that's fine
as long as it's not to revert the semantics since I'm not willing to do that.
--
Brett Cannon added the comment:
If someone wants to submit a patch to make the change that's fine, but they are
going to have the same issue when they simply execute an import that
byte-compiles as a side-effect so you will have to decide if you are only
worried about py_compile.
--
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
title: py_compile.compile() explicitly sets st_mode for written files -
py_compile.compile() replaces target files, breaking special files and symlinks
___
Python tracker
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
16 matches
Mail list logo