[issue6131] test_modulefinder leaks when run after test_distutils

2009-05-27 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: Here is workaround for reference leak. I'm not sure what exactly leaks references yet. -- keywords: +patch nosy: +ocean-city Added file: http://bugs.python.org/file14103/workaround.patch ___ Python tracker

[issue6134] 2to3 tests fail on Windows due to line endings

2009-05-27 Thread James Abbatiello
New submission from James Abbatiello : The tests for 2to3 currently fail on Windows. Data is read from a file in binary mode and then written to a temporary file in text mode which doubles up the carriage returns. Additionally, several files are missing the svn:eol-style property. The attached

[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-27 Thread Alex
Alex added the comment: I now *almost* have PyCFunctions marshalling, they seem to marhshall ok but fail on unmarshalling. I think the whitespace stuff may have crept back in, sorry :( -- Added file: http://bugs.python.org/file14101/python_const_fold.diff _

[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-27 Thread Alex
Alex added the comment: Switch to using memset instead of a forloop. -- Added file: http://bugs.python.org/file14100/python_const_fold.diff ___ Python tracker ___ ___

[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-27 Thread Alex
Alex added the comment: Small update so I don't change whitespace all over the plcae. -- Added file: http://bugs.python.org/file14099/python_const_fold.diff ___ Python tracker __

[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-27 Thread Alex
Alex added the comment: Here's my work so far, it seems to work as described. Except for the fact that pyc creation with anything containign something with this optimization will give a valueerror on bad marshall data, from trying to marshall the method I assume. -- keywords: +patch Ad

[issue5353] Improve IndexError messages with actual values

2009-05-27 Thread R. David Murray
Changes by R. David Murray : -- nosy: -r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue2986] difflib.SequenceMatcher not matching long sequences

2009-05-27 Thread R. David Murray
Changes by R. David Murray : -- components: +Documentation, Library (Lib) -Extension Modules priority: -> normal stage: -> test needed type: -> feature request versions: +Python 3.2 -Python 2.5 ___ Python tracker

[issue5450] test_tcl testLoadTk fails if DISPLAY defined but connect fails, instead of being skipped

2009-05-27 Thread R. David Murray
Changes by R. David Murray : -- assignee: gpolo -> r.david.murray priority: -> low stage: -> needs patch versions: +Python 2.7, Python 3.2 ___ Python tracker ___ ___

[issue5673] Add timeout option to subprocess.Popen

2009-05-27 Thread R. David Murray
Changes by R. David Murray : -- versions: +Python 3.2 -Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5673] Add timeout option to subprocess.Popen

2009-05-27 Thread R. David Murray
Changes by R. David Murray : -- priority: -> normal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue6132] Implement the GIL with critical sections in Windows

2009-05-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not competent to review Windows-specific stuff, but some style notes: - your indentation is inconsistent with the original file (you should use tabs) - please don't use any C++-style comments -- nosy: +pitrou ___

[issue6125] 2to3 mishandles "from module_name import" when module_name includes an underscore

2009-05-27 Thread R. David Murray
Changes by R. David Murray : -- resolution: -> invalid stage: -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue1564508] RFC 2965 BaseCookie does not support "$Port"

2009-05-27 Thread Ben Anhalt
Ben Anhalt added the comment: Grrr, the link in my last comment should have been http://www.nabble.com/System.Net.CookieContainer-adding-inappropriate-%24Port-attribute-to-cookies--td23752882ef1367.html Yuck. -- ___ Python tracker

[issue6132] Implement the GIL with critical sections in Windows

2009-05-27 Thread Collin Winter
Changes by Collin Winter : -- nosy: +collinwinter ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue1564508] RFC 2965 BaseCookie does not support "$Port"

2009-05-27 Thread Ben Anhalt
Ben Anhalt added the comment: Actually, I was just bit by this. In fact, RFC 2965 prohibits clients from sending $Port if the port attribute was not included in the Set-Cookie header. But, it turns out that the mono System.Net library (at least) will add the attribute any time the URI includes

[issue6125] 2to3 mishandles "from module_name import" when module_name includes an underscore

2009-05-27 Thread Mitchell Model
Mitchell Model added the comment: I apologize. This example evolved from my attempt to simplify things from the actual code, and I oversimplified to the point where I misread the 2to3 results. I thought there was a space after the period for the modules without the underscores in their name but

[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-27 Thread Alex
New submission from Alex : Basically whenever you have a LOAD_CONST opcode, follwed by a LOAD_ATTR you can replace both with a single LOAD_CONST. This optimizes things like ", ".join or "{} {}".format (in my totally unscientific byte code hackery it's about a 30% speedup on the loading the funct

[issue6121] help('modules ') causes IndexError.

2009-05-27 Thread R. David Murray
R. David Murray added the comment: Applied in r72966, r72967 and r72968, r72970. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue6129] 2to3 does not convert imports of the form 'import sub.mod' to relative import

2009-05-27 Thread Benjamin Peterson
Benjamin Peterson added the comment: The bug tracker is not really the correct forum for this. [See the python-porting list.] You will either have to change the code to use absolute from imports and change the usage of the module in the code base (I would suggest this), or hack it like this: i

[issue6132] Implement the GIL with critical sections in Windows

2009-05-27 Thread Phillip Sitbon
Changes by Phillip Sitbon : Added file: http://bugs.python.org/file14097/LockingTest.py ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue6132] Implement the GIL with critical sections in Windows

2009-05-27 Thread Phillip Sitbon
New submission from Phillip Sitbon : At the suggestion of others on the Python-Dev list, I'm going to outline what I've been doing with the GIL and where I see possiblity for improvement. Discussion: http://mail.python.org/pipermail/python-dev/2009-May/089746.html Detail: Currently, Python's

[issue6129] 2to3 does not convert imports of the form 'import sub.mod' to relative import

2009-05-27 Thread Mitchell Model
Mitchell Model added the comment: Thanks. I sure couldn't find a way! I encountered this trying to convert someone else's code. There is a main directory and a subdirectory, both with __init__.py files. The files in the main directory import each other just by "import othermodule". 2to3 changed

[issue6129] 2to3 does not convert imports of the form 'import sub.mod' to relative import

2009-05-27 Thread Benjamin Peterson
Benjamin Peterson added the comment: This is a case that 2to3 cannot handle. There is no way to do a relative import and get the module package.module behavior of absolute import. 2to3 cannot guess how to fix this. -- nosy: +benjamin.peterson resolution: -> wont fix status: open -> clo

[issue6131] test_modulefinder leaks when run after test_distutils

2009-05-27 Thread Antoine Pitrou
New submission from Antoine Pitrou : When run independently, test_modulefinder doesn't leak: $ ./python -m test.regrtest -R 3:2 test_modulefinder test_modulefinder beginning 5 repetitions 12345 . 1 test OK. [93448 refs] But it does leak if test_distutils was run before it: $ ./python -m te

[issue6001] Test discovery for unittest

2009-05-27 Thread Michael Foord
Michael Foord added the comment: http://codereview.appspot.com/63157 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue6129] 2to3 does not convert imports of the form 'import sub.mod' to relative import

2009-05-27 Thread Mitchell Model
Mitchell Model added the comment: Yes, I meant to mention that: the directory sub does contain an __init__.py with "__all__ = ['s']". I'm attaching a zip of the test package pkg that contains the sub-package sub. It wasn't clear to me what "import sub.s" should be converted to. By analogy with

[issue6130] There ought to be a way for extension types to associate documentation with their tp_new or tp_init methods

2009-05-27 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : If an extension type supplies a tp_new or tp_init, these will be invoked by the normal instantiation logic. They will also be exposed as `__new__´ and `__init__´ attributes of the type. However, there is no way to supply a docstring for these methods.

[issue6129] 2to3 does not convert imports of the form 'import sub.mod' to relative import

2009-05-27 Thread Georg Brandl
Georg Brandl added the comment: Is there also a sub/__init__.py? -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bugs-list ma

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread Yonas
Changes by Yonas : -- versions: +Python 2.5, Python 3.0 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue6129] 2to3 does not convert imports of the form 'import sub.mod' to relative import

2009-05-27 Thread Mitchell Model
New submission from Mitchell Model : 2to3 changes "import m" to "from . import m" but it doesn't change "import sub.s". The directory q.py is in has a file m.py and a subdirectory sub. The subdirectory sub has a file s.py. File q.py contains two lines: import m import sub.s % 2to3 -f q.py ---

[issue6125] 2to3 mishandles "from module_name import" when module_name includes an underscore

2009-05-27 Thread Benjamin Peterson
Benjamin Peterson added the comment: I'm sorry; I don't see why this is a bug. Could you elaborate, please? -- nosy: +benjamin.peterson ___ Python tracker ___ ___

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread Yonas
Yonas added the comment: Here's another test, taken from the docs: http://docs.python.org/library/subprocess.html#subprocess-replacements: This is slightly better than Popen because the program executes and shows output, but worse than os.system(), because it still shows the error: --

[issue6128] Consequences of using Py_TPFLAGS_HAVE_GC are incompletely explained

2009-05-27 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : Creation of GC'd types is explained at . The docs claim that PyObject_GC_Track must be called once an object created with PyObject_GC_New is initialized. The docs fail to explain what should be done if there

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread Yonas
Yonas added the comment: os.system() works: os.system("echo `date` >> /tmp/myfile") r...@yonas-laptop:/usr/lib/exim4/local_scan# cat /tmp/myfile Wed May 27 16:04:54 EDT 2009 Wed May 27 16:04:54 EDT 2009 -- ___ Python tracker

[issue6127] Unexpected universal newline behavior (newline duplication) in Windows

2009-05-27 Thread Jason R. Coombs
Changes by Jason R. Coombs : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue5265] StringIO can duplicate newlines in universal newlines mode

2009-05-27 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've filed the Windows issue as http://bugs.python.org/issue6127 -- ___ Python tracker ___ ___ Pyth

[issue6127] Unexpected universal newline behavior (newline duplication) in Windows

2009-05-27 Thread Jason R. Coombs
New submission from Jason R. Coombs : Per http://bugs.python.org/issue5265, I'm opening up a new ticket. Universal newline behavior works as expected under Linux but differently under Windows. PS C:\Users\jaraco> python Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)

[issue6003] ZipFile.writestr "compression_type" argument

2009-05-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch looks ok. It can certainly go in trunk, as for 3.1 it's up to Benjamin to decide. Note: the docs should state that the new argument appeared in 2.7. -- ___ Python tracker

[issue6073] threading.Timer and gtk.main are not compatible

2009-05-27 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: pygtk doesn't release the GIL around its internal calls unless you call threads_init. So I think this is pretty clearly just a misuse of the pygtk library. There's nothing at all Python can do about it. If an extension library doesn't release the GIL, no

[issue6073] threading.Timer and gtk.main are not compatible

2009-05-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well I'm not a gtk user, but try to do something else than a "print" in the timer. Perhaps gtk redirects all standard IO or something. It sounds very strange that threads would stop working when gtk is imported. -- _

[issue6001] Test discovery for unittest

2009-05-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Would you like to upload your patch to Rietveld? -- nosy: +pitrou ___ Python tracker ___ ___ Python-

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread Yonas
Yonas added the comment: Could this be a permissions issue? I have no idea how permissions would effect it, though... r...@yonas-laptop:/usr/lib/exim4/local_scan# ls -la /usr/sbin/exim4 -rwsr-xr-x 1 root root 824440 2009-02-11 08:53 /usr/sbin/exim4 -- _

[issue6121] help('modules ') causes IndexError.

2009-05-27 Thread Georg Brandl
Georg Brandl added the comment: Looks good, please apply. -- assignee: -> r.david.murray nosy: +georg.brandl ___ Python tracker ___ _

[issue3020] doctest should have lib2to3 integration

2009-05-27 Thread Haoyu Bai
Changes by Haoyu Bai : -- nosy: +bhy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mail

[issue6126] Python 3 pdb: shows internal code, breakpoints don't work

2009-05-27 Thread Eric Promislow
New submission from Eric Promislow : I have a simple test file, test01.py, with this output: $ cat test01.py #!/usr/bin/env python print("Line 1") print("Line 2") print("Line 3") $ $ # Now try debugging it. $ python3.0 -mpdb test01.py --Return-- > /home/ericp/opt/Python-3.0.1/lib/python3.0/io.py

[issue6116] frame.f_locals keeps references to things for too long

2009-05-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Regarding the first solution, my only question right now is whether this > should be a new attribute/method, or if the behavior of f_locals should > just be changed. The former would be nicer, I think, and perhaps > f_locals can be deprecated in favor of it.

[issue6116] frame.f_locals keeps references to things for too long

2009-05-27 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Oh, I forgot dictionaries aren't weakrefable. That's such a pain, I thought the third solution would be a good balance between easy and good. :/ Regarding the first solution, my only question right now is whether this should be a new attribute/method, or

[issue6116] frame.f_locals keeps references to things for too long

2009-05-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: IMO, any of these three solutions should be accepted. The second is of course the nicest but also the most complex one, and it's probably not worth it. I'm not sure the third solution is easily feasible given that dicts currently don't accept weakref'ing. We cou

[issue6125] 2to3 mishandles "from module_name import" when module_name includes an underscore

2009-05-27 Thread Mitchell Model
New submission from Mitchell Model : 2to3 -f import l.py --- l.py (original) File p.py (the four modules exist in the same directory as p.py): from mod_a import a from modb import b from mod_c import * from modd import * % 2to3 -f import p.py +++ p.py (refactored) @@ -1,5 +1,5 @@ -from mod_a i

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread Yonas
Yonas added the comment: I didn't find anything unusual about how exim uses dlopen, but if you want to see the code, it's here: http://pastebin.com/m52398b30 Line 166 is the actual call. Again, no problems except with Python's Popen(). -- ___ Pyth

[issue6081] str.format_from_mapping()

2009-05-27 Thread Eric Smith
Eric Smith added the comment: I think this would be useful. I don't fee terribly strongly about it, but I think I'd like the name str.format_using_mapping(). When I initially saw this, I thought from the name it was creating a format object (whatever that would be) from a mapping object. -

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread Yonas
Yonas added the comment: Thanks for testing, it works when running ./main, but not when run through exim. -- ___ Python tracker ___ __

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: your program works for me. How did you compile the files? I used the following commands: $ gcc -fPIC -I/usr/local/include/python2.6/ mylib.c -L /usr/local/lib -lpython2.6 --shared -o mylib.so $ gcc main.c -ldl $ ./a.out test (after removing all refere

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread Yonas
Yonas added the comment: The test doesn't fail when run directly from ./main, but it fails when run from exim4 mail server. exim will dlopen() mylib and run local_scan(). Besides using Popen, I haven't had any problems. -- Added file: http://bugs.python.org/file14094/exim_local_scan2

[issue6106] read_until

2009-05-27 Thread Pal Subbiah
Pal Subbiah added the comment: Thanks for your support. But the telnetlib from 3.1 also behaves in the same way. "read_until" always times out and returns b''. The problem seems to be with the byte string expected. The string after letter b is not passed properly. --

[issue6074] .pyc files created readonly if .py file is readonly, python won't overwrite

2009-05-27 Thread Peter Simanyi
Peter Simanyi added the comment: Re: chmod 0666 inappropriate: I agree that leaving a file 0666 is inappropriate, however theoretically the code should never leave the file 0666 since the unlink will delete the file. The code was intended to show what the problem is by demonstrating a solutio

[issue6124] Tkinter should support the OS X zoom button

2009-05-27 Thread Marc Culler
New submission from Marc Culler : As far as I can tell, no Tkinter event or pseudo event is generated by clicking the green "zoom" button on Mac OS X windows. This makes it impossible to support that OS X paradigm in a Tkinter application. I would like to be able to bind "<>" to a command that

[issue5851] Add a stream parameter to gc.set_debug

2009-05-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Would you like to work on a patch? -- components: +Interpreter Core -Extension Modules nosy: +amaury.forgeotdarc ___ Python tracker ___ __

[issue6120] zipfile.ZipFile's extractall works inproperly under Windows

2009-05-27 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: Oops, sorry. I forgot to update working copy. I confirmed this was fixed already. -- status: pending -> closed ___ Python tracker ___ ___

[issue6123] tarfile: opening an empty tar file fails

2009-05-27 Thread Evan Jones
Changes by Evan Jones : -- title: tarfile: -> tarfile: opening an empty tar file fails ___ Python tracker ___ ___ Python-bugs-list mail

[issue6123] tarfile:

2009-05-27 Thread Evan Jones
New submission from Evan Jones : tarfile.open() with an empty tar archive fails with a ReadError exception. GNU tar refuses to create empty archives, but tarfile allows it. See the following code which reproduces the error. I used the version of tarfile.py from subversion (revision 72458) with Py

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread R. David Murray
Changes by R. David Murray : -- components: +Library (Lib) type: crash -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing

[issue6120] zipfile.ZipFile's extractall works inproperly under Windows

2009-05-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I think this was fixed by r72893: Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists. -- nosy: +amaury.forgeotdarc resolution: -> duplicate status: open -> pending __

[issue6102] When the package has non-ascii path and .pyc file, we cannot import them.

2009-05-27 Thread Suzumizaki
Suzumizaki added the comment: Thanks for reply. I tried Python 3.1 Beta, and the testcode goes fine. (and my current work also.) I checked with Windows XP, I told before. My problem seems resolved, and here is answers only to make sure. >(What is the value of sys.maxunicode there though?) 6

[issue6120] zipfile.ZipFile's extractall works inproperly under Windows

2009-05-27 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: Here is traceback for trunk(Py2.7) Traceback (most recent call last): File "b.py", line 3, in f.extractall() File "e:\python-dev\trunk\lib\zipfile.py", line 947, in extractall self.extract(zipinfo, path, pwd) File "e:\python-dev\trunk\lib\zipf

[issue6120] zipfile.ZipFile's extractall works inproperly under Windows

2009-05-27 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: I confirmed error happened on Python2.6, 2.7, 3.0. But not happen on Python3.1. Interesting. -- versions: +Python 2.7, Python 3.0 ___ Python tracker

[issue6077] Unicode issue with tempfile on Windows

2009-05-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: File descriptors wrapped by the new IO module should be opened in binary mode. The attached patch changes TemporaryFile and NamedTemporaryFile to always call os.open() in binary mode; the mode is really used by the io.open() function. mkstemp() returns a

[issue6102] When the package has non-ascii path and .pyc file, we cannot import them.

2009-05-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Could you test with the 3.1 beta? There's a Windows installer here: http://python.org/download/releases/3.1/ -- nosy: +pitrou ___ Python tracker ___

[issue6120] zipfile.ZipFile's extractall works inproperly under Windows

2009-05-27 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file14090/unnamed ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The content of exim_local_scan2.py would be useful as well. -- nosy: +amaury.forgeotdarc ___ Python tracker ___ __

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread Yonas
Changes by Yonas : -- type: -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mai

[issue6122] OSError: [Errno 10] No child processes

2009-05-27 Thread Yonas
Changes by Yonas : -- title: [Errno 10] No child processes -> OSError: [Errno 10] No child processes ___ Python tracker ___ ___ Python-

[issue6122] [Errno 10] No child processes

2009-05-27 Thread Yonas
Changes by Yonas : Added file: http://bugs.python.org/file14089/main.c ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue6122] [Errno 10] No child processes

2009-05-27 Thread Yonas
New submission from Yonas : I always get a subprocess error when using embedded Python 2.6.2: File "/usr/lib/python2.6/subprocess.py", line 1123, in wait: pid, sts = os.waitpid(self.pid, 0): OSError: [Errno 10] No child processes Sample library and main files attached. -- files: my

[issue1731717] race condition in subprocess module

2009-05-27 Thread Yonas
Changes by Yonas : Added file: http://bugs.python.org/file14087/main.c ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1731717] race condition in subprocess module

2009-05-27 Thread Yonas
Yonas added the comment: I always get a subprocess error when using embedded python 2.6.2: File "/usr/lib/python2.6/subprocess.py", line 1123, in wait: pid, sts = os.waitpid(self.pid, 0): OSError: [Errno 10] No child processes Example library and main program are attached. -- nosy