This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年07月23日 07:42 by sjdv1982, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| py_compile.py | sjdv1982, 2011年07月23日 07:42 | py_compile.py, fixed in line 133 | ||
| py_compile.diff | sjdv1982, 2011年07月23日 09:43 | diff with 3.2 release | ||
| issue12618-0.patch | meador.inge, 2011年10月26日 04:29 | Patch v0 against tip (3.3.0a0) | review | |
| issue12618-1.patch | meador.inge, 2011年11月27日 01:08 | review | ||
| Messages (25) | |||
|---|---|---|---|
| msg140940 - (view) | Author: Sjoerd de Vries (sjdv1982) | Date: 2011年07月23日 07:42 | |
When you specify cfile to be in the current directory, an error occurs (line 133). I have fixed the file, see attached |
|||
| msg140941 - (view) | Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) | Date: 2011年07月23日 07:46 | |
Please create a patch in unified format. |
|||
| msg140945 - (view) | Author: Sjoerd de Vries (sjdv1982) | Date: 2011年07月23日 08:18 | |
The attached file just works. You can diff with trunk, or wherever python devs store the latest version. |
|||
| msg140946 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2011年07月23日 08:21 | |
It might work right now, but in case the file changes before your change can be processed, we will lose the previous changes if we just copy in your new file. IOW, you're making our work much harder and your change is less likely to be applied. |
|||
| msg140953 - (view) | Author: Sjoerd de Vries (sjdv1982) | Date: 2011年07月23日 09:43 | |
Makes no sense to me: since I don't have the trunk version, I can only diff -c against 3.2 release. Doing a diff against trunk is 1 sec of work for you. But I am just being a helpful user; so if a diff is what you want, here it is. No trouble for me, since I am on Linux. Not a very nice policy to any helpful Windows users, though: they won't have diff installed and they would waste an hour or so on this. |
|||
| msg140959 - (view) | Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) | Date: 2011年07月23日 09:54 | |
It's a context patch, not a unified patch, and it is reversed :) . |
|||
| msg140964 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2011年07月23日 10:43 | |
Well, we can work with this patch. Thanks. Yes, we can diff against 3.2, but for that you would have at least needed to specify * that you worked on a released version * and that that version is 3.2 Otherwise, we cannot know what to diff against. Note that even Windows users usually use Python from Mercurial for developing, so that they can use "hg diff" to create a patch easily. |
|||
| msg140990 - (view) | Author: Sjoerd de Vries (sjdv1982) | Date: 2011年07月23日 15:26 | |
Good to hear that the patch is helpful. Again, I am just trying to be a helpful user, making a (very very little) contribution to make Python better. I am not a Python dev at all: Python is already awesome enough for me, no desire to change it :-) I just want to say that a "we only accept patches" policy is not being very nice to similar helpful users on Windows, who don't have diff or Mercurial but who did manage to fix a file themselves. I did indicate "Python 3.2" in the bug report, maybe something went wrong. |
|||
| msg141064 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2011年07月24日 23:41 | |
It's rare to receive fixes from Windows users that don't have a dev environment set up (i.e. they just edited their stdlib code in place, or copied it and created a modified version). Thanks for persisting in the face of invalid assumptions on our part. |
|||
| msg146098 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年10月21日 15:58 | |
Sjoerd, can you paste the code that produces the bug? It would help create a test. |
|||
| msg146309 - (view) | Author: Sjoerd de Vries (sjdv1982) | Date: 2011年10月24日 17:00 | |
Hi Éric, There you go, adapted from http://effbot.org/librarybook/py-compile.htm : ############ # File: py-compile-example-1.py import py_compile # explicitly compile this module py_compile.compile("py-compile-example-1.py","py-compile-example-1.pyc") ############ Also, I tested and this bug is present neither on 3.1 nor on 2.x cheers Sjoerd |
|||
| msg146372 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年10月25日 15:16 | |
I can reproduce in 3.2 and 3.3. I’ll commit a test and patch when I get the time, or another dev can take this over. |
|||
| msg146410 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年10月26日 04:29 | |
I think it might be easier to just always use the absolute path rather than looking at the directory length. Maybe something like the attached. I added unit tests as well. |
|||
| msg148049 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年11月21日 14:55 | |
Thanks for the patch Meador, I hadn’t realized we had no tests for py_compile (it is however used in test_import and test_compileall). I think it would be nice to commit the tests first (except for the one that’s the object of this bug report) in order to have a baseline, and then see about fixing this bug. I’ll do that in a few days if nobody objects. I’m not sure there would be no negative side-effects to using os.path.abspath; we don’t know what people do with symlinks and relative paths out there, so I’d prefer adding a safe special case* rather than always calling abspath. What do you think? * Instead of using len, something like this would be clear IMO: if parent: # empty string means current directory, skip creating the dir os.makedirs(parent) |
|||
| msg148189 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年11月23日 16:48 | |
Meador, maybe you would like to commit the tests (except for the one that’s the object of this report) yourself? I don’t mind doing it, but as you have push rights now maybe you prefer to have your name directly associated with your work. |
|||
| msg148329 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年11月25日 15:58 | |
Éric, sure, I will commit the tests sometime today. Then I will respond to the 'os.path.abspath' question as well. |
|||
| msg148380 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年11月26日 05:45 | |
New changeset bcc7bf3963cc by Meador Inge in branch '2.7': Issue #12618: create unit tests for the py_compile module http://hg.python.org/cpython/rev/bcc7bf3963cc New changeset 2be3a2e63683 by Meador Inge in branch '3.2': Issue #12618: create unit tests for the py_compile module http://hg.python.org/cpython/rev/2be3a2e63683 New changeset f8f58db0715e by Meador Inge in branch 'default': Issue #12618: create unit tests for the py_compile module http://hg.python.org/cpython/rev/f8f58db0715e |
|||
| msg148400 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2011年11月26日 13:17 | |
The tests break on the Windows buildbots: ====================================================================== ERROR: test_relative_path (test.test_py_compile.PyCompileTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea3円.x.bolen-windows\build\lib\test\test_py_compile.py", line 33, in test_relative_path py_compile.compile(os.path.relpath(self.source_path), File "D:\cygwin\home\db3l\buildarea3円.x.bolen-windows\build\lib\ntpath.py", line 622, in relpath raise ValueError(error) ValueError: path is on mount 'c:', start on mount 'D:' |
|||
| msg148411 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年11月26日 14:52 | |
On Sat, Nov 26, 2011 at 7:17 AM, Antoine Pitrou <report@bugs.python.org> wrote: > The tests break on the Windows buildbots: I am investigating now. |
|||
| msg148418 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年11月26日 18:01 | |
New changeset b23453530d5f by Meador Inge in branch '2.7': Issue #12618: fix py_compile unit tests to handle different drives on Windows http://hg.python.org/cpython/rev/b23453530d5f New changeset 7097d52cacee by Meador Inge in branch '3.2': Issue #12618: fix py_compile unit tests to handle different drives on Windows http://hg.python.org/cpython/rev/7097d52cacee New changeset 5243752e19aa by Meador Inge in branch 'default': Issue #12618: fix py_compile unit tests to handle different drives on Windows http://hg.python.org/cpython/rev/5243752e19aa |
|||
| msg148419 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年11月26日 18:06 | |
The tests are fixed now. A relative path was being computed, but on Windows the current working directory drive and the drive of the relative path we were computing was different (and so this test bug would *not* be seen if running on a Windows box with a single "C: drive" setup). /me sighs at the concept of Windows drives. Thanks for the heads up on the test break Antoine. |
|||
| msg148434 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年11月27日 01:08 | |
> we don’t know what people do with symlinks and relative paths out > there, so I’d prefer adding a safe special case* rather than always > calling abspath. What do you think? Éric, I agree. I didn't know about the strange symlink + relative path behavior with 'os.path.normpath', but [1] cleared me up. With that in mind the special casing is OK. I have attached an updated patch with a unit test. Also, this is not an issue for Python 2.7. The 2.7 implementation assumes any directories mentioned in the path already exist. So, I removed 2.7 from the affected versions. [1] http://mail.python.org/pipermail/python-dev/2005-December/058452.html |
|||
| msg148479 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年11月28日 13:59 | |
> I have attached an updated patch with a unit test. LGTM. > Also, this is not an issue for Python 2.7. The 2.7 implementation assumes any > directories mentioned in the path already exist. Cool. The test can still be committed in that branch too. |
|||
| msg148491 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年11月28日 15:39 | |
New changeset 661fb211f220 by Meador Inge in branch '3.2': Issue #12618: py_compile cannot create files in current directory http://hg.python.org/cpython/rev/661fb211f220 New changeset e3647275f468 by Meador Inge in branch 'default': Issue #12618: py_compile cannot create files in current directory http://hg.python.org/cpython/rev/e3647275f468 |
|||
| msg148492 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年11月28日 15:40 | |
> Cool. The test can still be committed in that branch too. The regression test for this issue was already committed for 2.7 in bcc7bf3963cc as a part of creating the unit test baseline. I just committed the bug fix to 3.2 and default. Thanks for the fix Sjoerd. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:20 | admin | set | github: 56827 |
| 2011年11月28日 15:41:28 | meador.inge | set | status: open -> closed stage: patch review -> resolved |
| 2011年11月28日 15:40:40 | meador.inge | set | resolution: fixed messages: + msg148492 |
| 2011年11月28日 15:39:18 | python-dev | set | messages: + msg148491 |
| 2011年11月28日 13:59:50 | eric.araujo | set | assignee: meador.inge messages: + msg148479 versions: + Python 2.7 |
| 2011年11月27日 01:08:18 | meador.inge | set | files:
+ issue12618-1.patch messages: + msg148434 versions: - Python 2.7 |
| 2011年11月26日 18:06:28 | meador.inge | set | messages: + msg148419 |
| 2011年11月26日 18:01:22 | python-dev | set | messages: + msg148418 |
| 2011年11月26日 14:52:15 | meador.inge | set | messages: + msg148411 |
| 2011年11月26日 13:17:42 | pitrou | set | nosy:
+ pitrou messages: + msg148400 |
| 2011年11月26日 05:45:36 | python-dev | set | nosy:
+ python-dev messages: + msg148380 |
| 2011年11月25日 15:58:26 | meador.inge | set | messages: + msg148329 |
| 2011年11月23日 16:48:34 | eric.araujo | set | messages: + msg148189 |
| 2011年11月21日 20:12:59 | eric.snow | set | nosy:
+ eric.snow |
| 2011年11月21日 14:55:39 | eric.araujo | set | messages: + msg148049 |
| 2011年10月26日 04:29:53 | meador.inge | set | files:
+ issue12618-0.patch nosy: + meador.inge messages: + msg146410 stage: test needed -> patch review |
| 2011年10月25日 15:16:17 | eric.araujo | set | messages: + msg146372 |
| 2011年10月24日 17:00:49 | sjdv1982 | set | messages: + msg146309 |
| 2011年10月21日 15:58:12 | eric.araujo | set | messages: + msg146098 |
| 2011年07月29日 16:23:03 | eric.araujo | set | keywords:
+ easy nosy: + eric.araujo stage: test needed versions: + Python 2.7, Python 3.3 |
| 2011年07月24日 23:41:21 | ncoghlan | set | nosy:
+ ncoghlan messages: + msg141064 |
| 2011年07月23日 15:26:27 | sjdv1982 | set | messages: + msg140990 |
| 2011年07月23日 10:43:12 | georg.brandl | set | messages: + msg140964 |
| 2011年07月23日 09:54:16 | Arfrever | set | messages: + msg140959 |
| 2011年07月23日 09:43:46 | sjdv1982 | set | files:
+ py_compile.diff keywords: + patch messages: + msg140953 |
| 2011年07月23日 08:21:38 | georg.brandl | set | nosy:
+ georg.brandl messages: + msg140946 |
| 2011年07月23日 08:18:16 | sjdv1982 | set | messages: + msg140945 |
| 2011年07月23日 07:46:23 | Arfrever | set | nosy:
+ Arfrever messages: + msg140941 |
| 2011年07月23日 07:42:50 | sjdv1982 | create | |