[issue11379] Remove lightweight from minidom description
Martin v. Löwis mar...@v.loewis.de added the comment: What about this phrasing then: MiniDOM has a smaller memory footprint than some of the other DOM compliant implementations for Python (such as 4DOM), but uses about 10x more memory than the faster and simpler xml.etree.cElementTree module. But that's not a DOM implementation - so it would be comparing apples and oranges. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11379 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11379] Remove lightweight from minidom description
Stefan Behnel sco...@users.sourceforge.net added the comment: It's the tree based API most python users are parsing XML with, though. So I do not agree that it's comparing apples and oranges, not at all. It's comparing tree based XML libraries, only one of which is worth being called light weight, and that's not the one that is currently carrying that name. I think it's worth telling new users what they are committing to when they write code that uses MiniDOM. The documentation should allow them to understand that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11379 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10829] PyUnicode_FromFormatV() bugs with % and %% format strings
STINNER Victor victor.stin...@haypocalc.com added the comment: Hi, haypo, would you mind modify your newly added parse_format_flags() function so that it can diff the precision value of '%.0s' and '%s'(Currently both of them return precision as 0)? You should update your patch attached to #7330. I hope that your patch will be simpler with parse_format_flags() than before. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11379] Remove lightweight from minidom description
Martin v. Löwis mar...@v.loewis.de added the comment: It's the tree based API most python users are parsing XML with, though. So I do not agree that it's comparing apples and oranges, not at all. It's comparing tree based XML libraries, only one of which is worth being called light weight, and that's not the one that is currently carrying that name. If that is a real concern, I'd rather reduce the memory footprint of minidom than put actual performance figures into the documentation that will likely outdate over time. Notice that the documentation doesn't claim that it is a lightweight XML library, only that it's a ligthweight DOM implementation. SAX is, of course, even lighter-weight. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11379 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10833] Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated
STINNER Victor victor.stin...@haypocalc.com added the comment: I am working with Python since 5 years (and on Python since 3 years): I never seen any garbage string in error messages. My concern is to not truncate strings in error messages anymore. I consider that it is more important than using a hack to workaround some crashs. I call %.100s a hack because on a buffer overflow, other attributes are overwritten, and I think that the other attributes are more important than tp_name and the program will crash quickly. Try a buffer overflow on PyLong_Type and check how much time does it take to crash Python: I bet that the program will crash before formatting any exception. Indeed, there are no PyErr_Format(PyExc_MemoryError, ..) in the code base, but there are a few PyErr_SetString(PyExc_MemoryError, ..) such as PyErr_SetString(PyExc_MemoryError, math.fsum partials) in Modules/mathmodule.c. Maybe these should be reviewed. This instruction comes from math.fsum() which allocate a new list with the size of the input size (not exactly, but it is based on the size of the input list). Python may fail to allocate an huge list, but it doesn't mean that it will be unable to allocate memory for the short string math.fsum partials. Anyway, if the allocation of math.fsum partials string fail, another MemoryError (without any message) will be used. So it doesn't really matter. Still, there may be code paths where OOM triggers an error other than MemoryError. Same than before: Python should be able to allocate the new error object, and if it fails: it will use MemoryError anyway. In any case, I don't see anything wrong with using fixed size buffers in error handling and truncating too long output. I consider that there is no more good reason to truncate strings, I want to see the full error message! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10833 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11377] Deprecate (remove?) platform.popen()
STINNER Victor victor.stin...@haypocalc.com added the comment: Does subprocess work from inside Windows GUI applications? You mean: Python embedded in another program? I don't know. How can I test that? I never see any warning in subprocess documentation saying that subprocess doesn't work on Windows in some cases. subprocess uses CreateProcessW() (by _subprocess.CreateProcess). I suppose that CreateProcessW() can always be used. Note: subprocess does still support Windows 9x. But there is an issue to drop this support: #2405 (Drop w9xpopen and all dependencies). -- nosy: +brian.curtin, loewis, tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11377 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7330] PyUnicode_FromFormat segfault
Ray.Allen ysj@gmail.com added the comment: Here is the updated patch: 1, Work with function parse_format_flags() which is introduced in issue10829, and the patch is simpler and more clear than before. 2, Change parse_format_flags() to set precision value to -1 in the case of '%s' in order to differ with '%.0s' 3, Move call of unicode_format_align() in step 3 in order to avoid many codes like n += width PyUnicode_GET_SIZE(str) ? width : PyUnicode_GET_SIZE(str);, (following haypo's comments) -- Added file: http://bugs.python.org/file20983/issue7330_2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7330 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11377] Deprecate (remove?) platform.popen()
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: Does subprocess work from inside Windows GUI applications? You mean: Python embedded in another program? I don't know. How can I test that? Try to use platform from within IDLE or PythonWin. The popen() implementation in platform was added mostly to address issues on Windows. I never see any warning in subprocess documentation saying that subprocess doesn't work on Windows in some cases. subprocess uses CreateProcessW() (by _subprocess.CreateProcess). I suppose that CreateProcessW() can always be used. Probably yes, but it's better to check. Note: subprocess does still support Windows 9x. But there is an issue to drop this support: #2405 (Drop w9xpopen and all dependencies). The platform module in Python3 no longer needs to support platforms that are not supported by Python2. Some background on the compatibility requirements of platform: The main reason for making platform portable across various Python versions was to be able to use one version for all commonly used Python versions. It originated from code I wrote for our build machines and was intended to be used in multi-Python version build processes. For the Python3 branch, the same stability should be applied, but keeping Python 3.2 compatibility is enough, IMO, since previous 3.x versions did not get much use. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11377 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11379] Remove lightweight from minidom description
Stefan Behnel sco...@users.sourceforge.net added the comment: If that is a real concern, I'd rather reduce the memory footprint of minidom than put actual performance figures into the documentation that will likely outdate over time. Personally, I do not think it's worth putting much work into MiniDOM. I'd rather deprecate it to prevent new code from being written for it, but that's just my personal opinion, and this is the wrong place to discuss that. Given the current performance characteristics, I wouldn't be surprised if there was quite some room for improvements left in the xml.dom package. If you dislike the 10x, feel free to use several times. I doubt that MiniDOM will ever get so much closer to cET and lxml to prove that phrasing wrong. Notice that the documentation doesn't claim that it is a lightweight XML library, only that it's a ligthweight DOM implementation. I imagine that you are as aware as I am that this nuance is easy to miss, especially for a new user. From my experience, it is very common for users, especially those with a Java-ish background, to confuse the terms DOM and XML tree API/library. Hence my push to change the documentation. SAX is, of course, even lighter-weight. Not so much more light weight than cET's iterparse(), but that's getting OT here. Stefan -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11379 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10833] Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated
STINNER Victor victor.stin...@haypocalc.com added the comment: History of PyErr_Format(): - r7580 (13 years ago): creation of PyErr_Format() using a buffer of 500 bytes (fixed size buffer, allocated on the stack) - r17159 (10 years ago): PyErr_Format() allocates a dynamic buffer on the heap - r22722 (9 years ago): PyErr_Format() reuses PyString_FromFormatV() (dynamic buffer, allocated on the heap) belopolsky Limiting field width when formatting error messages belopolsky is a good safety measure. me Can you give me at least one example? I think that it is very me unlikely, or just impossible. Python allocates a dynamic buffer since r17159 (10 years ago), and the strings were *never* truncated just because %.100s format was never supported (it is interpreted as %s). If you still consider that %.100s protects is a good solution against crashes: you have to realize that Python doesn't truncate strings since 10 years, and nobody complained. -- The situation is changing because Ray Allen wrote a patch implementing %.100s: #7330. I would like to decide what to do with %.100s in error messages before commiting #7330. -- Eric and Alexander: do you still consider that %.100s is important in error messages? Or do you know agree that we can replace them with %s? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10833 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11377] Deprecate (remove?) platform.popen()
STINNER Victor victor.stin...@haypocalc.com added the comment: Try to use platform from within IDLE ... I tried subprocess.call('calc.exec'): it works. I tried p=subprocess.Popen('echo hello', shell=True, stdout=subprocess.PIPE); p.communicate(): it works too (I get the output and there is no MS-DOS popup). Hmm, but if os.popen() is no longer supported in Python 3, how can we still use it in platform ? platform.popen() and os.popen() have the same requirement: call process.wait() on file.close(). os.popen() does already implement that using _wrap_close. I don't want to copy/paste the code from os. os.popen() does still exist, why not reusing it? Anyway, if we remove os.popen(), we should remove platform.popen() too. But I don't want/plan to remove os.popen(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11377 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11377] Deprecate (remove?) platform.popen()
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: Try to use platform from within IDLE ... I tried subprocess.call('calc.exec'): it works. I tried p=subprocess.Popen('echo hello', shell=True, stdout=subprocess.PIPE); p.communicate(): it works too (I get the output and there is no MS-DOS popup). Great. Thanks for checking. Hmm, but if os.popen() is no longer supported in Python 3, how can we still use it in platform ? platform.popen() and os.popen() have the same requirement: call process.wait() on file.close(). os.popen() does already implement that using _wrap_close. I don't want to copy/paste the code from os. os.popen() does still exist, why not reusing it? Anyway, if we remove os.popen(), we should remove platform.popen() too. But I don't want/plan to remove os.popen(). Ok. If you remove the _popen class as well, the patch can go in. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11377 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7330] PyUnicode_FromFormat: implement width and precision for %s, %S, %R, %V, %U, %A
Changes by STINNER Victor victor.stin...@haypocalc.com: -- title: PyUnicode_FromFormat segfault - PyUnicode_FromFormat: implement width and precision for %s, %S, %R, %V, %U, %A ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7330 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions
Changes by Charles-Francois Natali neolo...@free.fr: -- nosy: neologix priority: normal severity: normal status: open title: some posix module functions ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
New submission from Charles-Francois Natali neolo...@free.fr: Some posix module functions unnecessarily release the GIL. For example, posix_dup, posix_dup2 and posix_pipe all release the GIL, but those are non-blocking syscalls (the don't imply any I/O, only modifying the process file descriptors table). This leads to the famous convoy effect (see http://bugs.python.org/issue7946). For example: $ cat /tmp/test_dup2.py import os import threading import sys import time def do_loop(): while True: pass t = threading.Thread(target=do_loop) t.setDaemon(True) t.start() f = os.open(sys.argv[1], os.O_RDONLY) for i in range(4, 1000): os.dup2(f, i) Whith GIL release/acquire: $ time ./python /tmp/test_dup2.py /etc/fstab real0m5.238s user0m5.223s sys 0m0.009s $ time ./python /tmp/test_pipe.py real0m3.083s user0m3.074s sys 0m0.007s Without GIL release/acquire: $ time ./python /tmp/test_dup2.py /etc/fstab real0m0.094s user0m0.077s sys 0m0.010s $ time ./python /tmp/test_pipe.py real0m0.088s user0m0.074s sys 0m0.008s -- title: some posix module functions - some posix module functions unnecessarily release the GIL ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
Changes by Eric Smith e...@trueblade.com: -- components: +Interpreter Core nosy: +eric.smith, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: On Windows at least, these functions call malloc() and DuplicateHandle(). -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11383] compilation seg faults on insanely large expressions
New submission from Nick Coghlan ncogh...@gmail.com: ~/devel/py3k$ ./python -c compile('1*'*10+'1', 'broken', 'eval') Segmentation fault Going by the gdb stack trace we're blowing the stack due to the recursive descent in compiler_visit_expr. -- messages: 129950 nosy: ncoghlan priority: normal severity: normal status: open title: compilation seg faults on insanely large expressions ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11383 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11379] Remove lightweight from minidom description
Antoine Pitrou pit...@free.fr added the comment: Agreed with Stefan's concern. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11379 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11383] compilation seg faults on insanely large expressions
Nick Coghlan ncogh...@gmail.com added the comment: Updated Lib/test/crashers/compiler_recursion.py to refer back to this issue. (As well as making it actually crash again on my system - apparently an expression nested 59k deep wasn't enough to kill the stack here, so I bumped it to 100k) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11383 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11377] Deprecate (remove?) platform.popen()
STINNER Victor victor.stin...@haypocalc.com added the comment: New patch deprecating platform.popen() and removing _popen. Marc-Andre: Do you agree to deprecate platform.popen() in favour of subprocess? -- Added file: http://bugs.python.org/file20984/platform_popen-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11377 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
Charles-Francois Natali neolo...@free.fr added the comment: I didn't even know that Windows had such calls. But anyway, if we start releasing the GIL around each malloc call, then it's going to get really complicated: static PyObject * posix_geteuid(PyObject *self, PyObject *noargs) { return PyLong_FromLong((long)geteuid()); } PyLong_FromLong - _PyLong_New - PyObject_MALLOC which can call malloc. As for DuplicateHandle, I assume it's as fast as Unix's dup(2). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11384] Deprecate, remove or document (correctly) os.popen
New submission from STINNER Victor victor.stin...@haypocalc.com: os.popen() was deprecated in Python 2.6 but it does still exist in Python 3.3. The function is no more documented: there is an entry in os documentation, but the entry is not in the index, and it has a reference to the file object creation section which doesn't have an paragraph about os.popen(). I prefer subprocess.Popen() over os.popen() because subprocess has much more options to control the child process creation (eg. change the current directory), it closes all files by default (which is more secure), it restores the signal handlers, etc. I don't know if we can directly remove os.popen() from Python 3.3, because it is no more marked as deprecated in Python 3! -- components: Library (Lib) messages: 129955 nosy: haypo priority: normal severity: normal status: open title: Deprecate, remove or document (correctly) os.popen versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11384 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11384] Deprecate, remove or document (correctly) os.popen
Neil Muller drnlmuller+b...@gmail.com added the comment: See issue6490 , which covers much of the same ground. -- nosy: +Neil Muller ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11384 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11384] Deprecate, remove or document (correctly) os.popen
Changes by STINNER Victor victor.stin...@haypocalc.com: -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11384 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: What are you trying to achieve? Do you have loops which contain no other syscall than os.dup2()? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6490] os.popen documentation in 2.6 is probably wrong
STINNER Victor victor.stin...@haypocalc.com added the comment: r55334 removed popen2, popen3 and popen4 from the os module from Python 3 (before the 3.0 release), but not os.popen. Python 3.2 has now convenience functions in subprocess to get the output of a program: - check_output() - getstatusoutput() - getoutput() They have a better API then os.popen because you can: - avoid the shell process and use a list of arguments (to avoid ugly shell quoting using ' or ) - change the current directory - decide if signal are restored or not - get easily the exit code (not 8 magical operation on the close() output) - use a different executable name - pass file descriptor - etc. I think that it's time to move forward and remove os.popen(). But... there are 66 calls to os.popen() in: Doc/tools/docutils/writers/odf_odt Lib Lib/ctypes Lib/distutils Lib/distutils/command Lib/distutils/tests Lib/idlelib Lib/multiprocessing Lib/pydoc_data Lib/test Lib/tkinter/test/test_tkinter Mac/BuildScript Mac/Tools PCbuild PC/VC6 PC/VS7.1 PC/VS8.0 Tools/msi Tools/scripts So we can maybe start with: - Restore the documentation - Mark this function as deprecated in the doc - Emit a deprecating warning in the code - Start to replace os.popen() with subprocess in Python And then maybe never drop it :-) Note: even subprocess.getstatusoutput() is implemented using os.popen()... -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6490 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6490] os.popen documentation in 2.6 is probably wrong
STINNER Victor victor.stin...@haypocalc.com added the comment: The following documentation should also be updated to use the new convenience functions: http://docs.python.org/py3k/library/subprocess.html#replacing-os-popen-os-popen2-os-popen3 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6490 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11377] Deprecate (remove?) platform.popen()
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: New patch deprecating platform.popen() and removing _popen. Patch looks good. Marc-Andre: Do you agree to deprecate platform.popen() in favour of subprocess? Yes. We can start the deprecation process in 3.3. Thank you, -- Marc-Andre Lemburg eGenix.com ::: Try our new mxODBC.Connect Python Database Interface for free ! eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11377 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
Charles-Francois Natali neolo...@free.fr added the comment: Well, those are contrived examples showing the effect of the convoy effect induced by those unneeded GIL release/acquire: releasing and re-acquiring the GIL comes with a cost (e.g. under Linux, futex are really fast in the uncontended case since handled in use space but much slower when there's contention), and subverts the OS scheduling policy (forcing the thread to drop/re-acquire the GIL make the thread block after having consumed a small amount of its time slice and increases the context switching rate). I think that releasing and re-acquiring the GIL should only be done around potentially blocking calls. Do you have loops which contain no other syscall than os.dup2()? No, but it's not a reason for penalizing threads that use dup, dup2 or pipe. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
Antoine Pitrou pit...@free.fr added the comment: Well, those are contrived examples showing the effect of the convoy effect induced by those unneeded GIL release/acquire: releasing and re-acquiring the GIL comes with a cost (e.g. under Linux, futex are really fast in the uncontended case since handled in use space but much slower when there's contention), and subverts the OS scheduling policy (forcing the thread to drop/re-acquire the GIL make the thread block after having consumed a small amount of its time slice and increases the context switching rate). I think that releasing and re-acquiring the GIL should only be done around potentially blocking calls. Do you want to propose a patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11377] Deprecate (remove?) platform.popen()
STINNER Victor victor.stin...@haypocalc.com added the comment: Commited to 3.3 (r88721). -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11377 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8513] subprocess: support bytes program name (POSIX)
STINNER Victor victor.stin...@haypocalc.com added the comment: Oh, I forget subprocess.call(b'ls'): command as a byte string = fixed in Python 3.3 (r88720). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8513 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
Charles-Francois Natali neolo...@free.fr added the comment: Do you want to propose a patch? Sure, if removing those calls to Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS seems reasonable (I might haved missed something obvious). Just to be clear, I'm not at all criticizing the current GIL implementation, there's been a great work done on it. I'm just saying that releasing and re-acquiring the GIL around fast syscalls is probaly not a good idea. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
Antoine Pitrou pit...@free.fr added the comment: Just to be clear, I'm not at all criticizing the current GIL implementation, there's been a great work done on it. I'm just saying that releasing and re-acquiring the GIL around fast syscalls is probaly not a good idea. If these syscalls aren't likely to yield control to another thread, then I agree there's no point in releasing the GIL around them. (but is it the case that they are always fast? for example, how about dup() on a network file system? or is it indifferent?) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10197] subprocess.getoutput fails on win32
STINNER Victor victor.stin...@haypocalc.com added the comment: subprocess_getoutput.patch: patch subprocess.getstatusoutput() to use directly Popen, instead of os.popen, with stderr=subprocess.STDOUT instead of 21 shell redirection. It strips also all trailing spaces and newlines, not just the last one. And finally, it removes Availability: UNIX. from the documentation. I tried to add a shell argument (to be able to disable the shell) and to accept any Popen keyword, but I don't know how to implement shell=False if the input is a list of arguments. list2cmdline() is unsafe on UNIX (see #8972). And if getstatusoutput() doesn't accept argument list, it becomes useless with shell=False (it doesn't support to call a program with arguments). Note: the status is still shifted on UNIX to be compatible with the wait() format. -- keywords: +patch Added file: http://bugs.python.org/file20985/subprocess_getoutput.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10197 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8972] subprocess.list2cmdline doesn't quote the character
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8972 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Giampaolo Rodola' g.rod...@gmail.com added the comment: Please try to provide a patch which fixes (as in makes the test pass) this specific issue only. As for other changes such as the code restyling you can open a separate ticket with another patch. Forza, Giampaolo. :) If you never patch file20960 in, the buildbots will fail for the time being. (And they do have to run Mac OS X already...) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11265] asyncore does not check for EAGAIN and EPIPE errno
Giampaolo Rodola' g.rod...@gmail.com added the comment: Fixed in r88722. I did not catch EAGAIN in connect() as it makes hang some tests. -- resolution: - fixed status: open - closed versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11265 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
Charles-Francois Natali neolo...@free.fr added the comment: 2011/3/3 Antoine Pitrou rep...@bugs.python.org: Antoine Pitrou pit...@free.fr added the comment: Just to be clear, I'm not at all criticizing the current GIL implementation, there's been a great work done on it. I'm just saying that releasing and re-acquiring the GIL around fast syscalls is probaly not a good idea. If these syscalls aren't likely to yield control to another thread, then I agree there's no point in releasing the GIL around them. (but is it the case that they are always fast? for example, how about dup() on a network file system? or is it indifferent?) The initial open can take long, but once it's open, calling dup just implies copying a reference to the open file (a pointer) to the file descriptor table. No I/O is done (I tested it one a NFS mount). Now, I don't know Windows at all, but I'm pretty sure that every operating system does more or less the same thing, and that those three calls (there might be others) don't block. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9723] Add shlex.quote
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9723 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10882] Add os.sendfile()
Giampaolo Rodola' g.rod...@gmail.com added the comment: OSX failure is tracked in issue 11351. Closing this out as fixed. -- resolution: accepted - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10882 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7839 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Giampaolo Rodola' g.rod...@gmail.com added the comment: issue11351-5.patch no longer applies cleanly and I don't have an OSX box to test against at the moment. Could you please update your patch? If you tell me it's gonna fix the test I'm going to commit it assuming everything is fine. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11259] asynchat does not check if terminator is negative integer
Giampaolo Rodola' g.rod...@gmail.com added the comment: Can you write an actual patch which includes tests? Also, I think the z.patch in attachment is targeted for python 2.x as it does not apply cleanly against the current trunk. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11259 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10197] subprocess.getoutput fails on win32
STINNER Victor victor.stin...@haypocalc.com added the comment: I tried to add a shell argument (to be able to disable the shell) and to accept any Popen keyword, but I don't know how to implement shell=False if the input is a list of arguments. list2cmdline() is unsafe on UNIX (see #8972). Example of function to escape a list of arguments on UNIX: def escapeargs(*args): return ' '.join(pipes.quote(arg) for arg in args) R. David Murray disagree with me to allow getoutput(list) (shell=True) because Popen(list, shell=True) behaves differently. subprocess.Popen(['echo Hello'], shell=True) writes 'Hello', whereas subprocess.Popen(['echo', 'Hello'], shell=True) writes nothing (because echo has no argument. I would like to do something like that: getoutput(['echo', 'Hello']) calls Popen('echo Hello', shell=True) using escapeargs() function defined above. So getoutput(list) calls shell -c arg1 arg2, whereas Popen(list, shell=True) calls shell -c arg1 arg2 arg3 ... See also issue #7839 for Popen(str, shell=False) and Popen(list, shell=True) cases. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10197 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Giampaolo Rodola' g.rod...@gmail.com added the comment: issue11351-5.patch no longer applies cleanly and I don't have an OSX box to test against at the moment. Could you please update your patch? If you tell me it's gonna fix the test I'm going to commit it assuming everything is fine. I'm at e79364a6bed8/[svn r88726]. issue11351-5.patch applies and the test is ok, at least in respect to sendfile: Using random seed 1578968 [1/1] test_os /Users/steffen/arena/code.extern.repos/py3k.hg/Lib/unittest/case.py:387: ResourceWarning: unclosed file _io.BufferedReader name='@test_59563_tmp2' function() 1 test OK. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9922] subprocess.getstatusoutput can fail with utf8 UnicodeDecodeError
STINNER Victor victor.stin...@haypocalc.com added the comment: I think that it is now too late to change getstatusoutput() output type (str-bytes). I prefer Unicode and I think that most users will have to decode bytes to Unicode anyway. So the right solution is to be able to configure encoding and errors used by TextIOWrapper: see issue #6135. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9922 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11365] Integrate Buildroot patches (cross-compilation)
Roumen Petrov bugtr...@roumenpetrov.info added the comment: All is duplicate on already posted patches . It is not work to review limited functionality posted here. -- nosy: +rpetrov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11365 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: It's ok, but for the statistics: 16:59 ~/arena/code.extern.repos/py3k.hg $ hg identify e79364a6bed8 (py3k) tip 16:59 ~/arena/code.extern.repos/py3k.hg $ hg slog -r tip Changeset: 10021:e79364a6bed8 branch: py3k tag: tip user:giampaolo.rodola date:Thu Mar 03 15:10:58 2011 +0100 summary: [svn r88726] fix attribute error 16:59 ~/arena/code.extern.repos/py3k.hg $ sh .hg/steffen/buildit.sh ./configure --prefix=$HOME/usr/opt/py3k MACOSX_DEPLOYMENT_TARGET=10.6 make all 17:04 ~/arena/code.extern.repos/py3k.hg $ hg patch --no-commit --strip 1 .hg/steffen/issue11351-5.patch applying .hg/steffen/issue11351-5.patch 17:04 ~/arena/code.extern.repos/py3k.hg $ make all /usr/bin/gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -O2 -O2 -I. -IInclude -I./Include -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o Modules/posixmodule.o /usr/bin/gcc ... 17:05 ~/arena/code.extern.repos/py3k.hg $ ./python.exe -E -Wd -m test.test_os -r -w -uall test_access (__main__.FileTests) ... ok test_closerange (__main__.FileTests) ... ok test_read (__main__.FileTests) ... ok test_rename (__main__.FileTests) ... ok test_write (__main__.FileTests) ... ok test_stat_attributes (__main__.StatAttributeTests) ... ok test_stat_attributes_bytes (__main__.StatAttributeTests) ... ok test_statvfs_attributes (__main__.StatAttributeTests) ... ok test_utime_dir (__main__.StatAttributeTests) ... ok test___repr__ (__main__.EnvironTests) Check that the repr() of os.environ looks like environ({...}). ... ok test_bool (__main__.EnvironTests) ... ok test_constructor (__main__.EnvironTests) ... ok test_environb (__main__.EnvironTests) ... ok test_get (__main__.EnvironTests) ... ok test_get_exec_path (__main__.EnvironTests) ... ok test_getitem (__main__.EnvironTests) ... ok test_items (__main__.EnvironTests) ... ok test_keys (__main__.EnvironTests) ... ok test_keyvalue_types (__main__.EnvironTests) ... ok test_len (__main__.EnvironTests) ... ok test_os_popen_iter (__main__.EnvironTests) ... ok test_pop (__main__.EnvironTests) ... ok test_popitem (__main__.EnvironTests) ... ok test_read (__main__.EnvironTests) ... ok test_setdefault (__main__.EnvironTests) ... ok test_update (__main__.EnvironTests) ... ok test_update2 (__main__.EnvironTests) ... ok test_values (__main__.EnvironTests) ... ok test_write (__main__.EnvironTests) ... ok test_traversal (__main__.WalkTests) ... ok test_exist_ok_existing_directory (__main__.MakedirTests) ... ok test_exist_ok_existing_regular_file (__main__.MakedirTests) ... ok test_makedir (__main__.MakedirTests) ... ok test_devnull (__main__.DevNullTests) ... ok test_urandom (__main__.URandomTests) ... ok test_execvpe_with_bad_arglist (__main__.ExecTests) ... ok test_execvpe_with_bad_program (__main__.ExecTests) ... ok test_internal_execvpe_str (__main__.ExecTests) ... ok test_closerange (__main__.TestInvalidFD) ... ok test_dup (__main__.TestInvalidFD) ... ok test_dup2 (__main__.TestInvalidFD) ... ok test_fchdir (__main__.TestInvalidFD) ... ok test_fchmod (__main__.TestInvalidFD) ... ok test_fchown (__main__.TestInvalidFD) ... ok test_fdatasync (__main__.TestInvalidFD) ... ok test_fdopen (__main__.TestInvalidFD) ... ok test_fpathconf (__main__.TestInvalidFD) ... ok test_fstat (__main__.TestInvalidFD) ... ok test_fstatvfs (__main__.TestInvalidFD) ... ok test_fsync (__main__.TestInvalidFD) ... ok test_ftruncate (__main__.TestInvalidFD) ... ok test_isatty (__main__.TestInvalidFD) ... ok test_lseek (__main__.TestInvalidFD) ... ok test_read (__main__.TestInvalidFD) ... ok test_tcgetpgrp (__main__.TestInvalidFD) ... ok test_tcsetpgrpt (__main__.TestInvalidFD) ... ok test_ttyname (__main__.TestInvalidFD) ... ok test_write (__main__.TestInvalidFD) ... ok test_setegid (__main__.PosixUidGidTests) ... ok test_seteuid (__main__.PosixUidGidTests) ... ok test_setgid (__main__.PosixUidGidTests) ... ok test_setregid (__main__.PosixUidGidTests) ... ok test_setregid_neg1 (__main__.PosixUidGidTests) ... ok test_setreuid (__main__.PosixUidGidTests) ... ok test_setreuid_neg1 (__main__.PosixUidGidTests) ... ok test_setuid (__main__.PosixUidGidTests) ... ok test_listdir (__main__.Pep383Tests) ... ok test_open (__main__.Pep383Tests) ... ok test_stat (__main__.Pep383Tests) ... ok test_CTRL_BREAK_EVENT (__main__.Win32KillTests) ... skipped 'Win32 specific tests' test_CTRL_C_EVENT (__main__.Win32KillTests) ... skipped 'Win32 specific tests' test_kill_int (__main__.Win32KillTests) ... skipped 'Win32 specific tests' test_kill_sigterm (__main__.Win32KillTests) ... skipped 'Win32 specific tests' test_directory_link (__main__.Win32SymlinkTests) ... skipped 'Win32 specific tests' test_file_link (__main__.Win32SymlinkTests) ... skipped 'Win32 specific tests' test_isdir_on_directory_link_to_missing_target (__main__.Win32SymlinkTests) ... skipped 'Win32 specific tests' test_remove_directory_link_to_missing_target
[issue11351] Mac OS X os.sendfile()
Giampaolo Rodola' g.rod...@gmail.com added the comment: I'm at e79364a6bed8/[svn r88726]. issue11351-5.patch applies and the test is ok, at least in respect to sendfile: Sorry, I'm still not used to the whole svn/mercurial change. I applied your patch in r88729. Let's see how the buildbot goes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11365] Integrate Buildroot patches (cross-compilation)
STINNER Victor victor.stin...@haypocalc.com added the comment: A quick search gives me: - #1006238 - #1597850 - #3754 - #5404 - #3871 Are they the same patches from Buildroot? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11365 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Giampaolo Rodola' g.rod...@gmail.com added the comment: Let's see how the buildbot goes. Italian Espressi are the best! (Our local classical radio station plays Respighi's Pini di Roma almost every day ...) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Giampaolo Rodola' g.rod...@gmail.com added the comment: =) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11381] pretending the not operator is a function behaves surprisingly
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I concur with Georg. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11381 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9100] test_sysconfig fails (test_user_similar)
Zsolt Cserna zsolt.cse...@morganstanley.com added the comment: No, I think it's not the duplicate of any of the bugs you've specified. Meanwhile I've installed to another location and it's now python 2.7.1, but the problem still present: My configure parameters are: --prefix=//ms/dist/python/PROJ/core/2.7.1-1/common --exec-prefix=//ms/dist/python/PROJ/core/2.7.1-1/.exec/ia32.linux.2.6.glibc.2.3 --enable-shared The error message is: AssertionError: '/ms/user/a/and/.local/lib/python2.7' != '/ms/user/a/and/.local/exec/lib/python2.7' I'm executing the python interpreter from: //ms/dist/python/PROJ/core/2.7.1/exec/bin/python (which is the same as //ms/dist/python/PROJ/core/2.7.1-1/.exec/ia32.linux.2.6.glibc.2.3/bin/python) In the unittest I have the following variables: sysconfig.get_config_var('base') = '/ms/dist/python/PROJ/core/2.7.1' sysconfig.get_config_var('userbase') = '/ms/user/a/and/.local' sysconfig.get_path('stdlib', 'posix_prefix') = '/ms/dist/python/PROJ/core/2.7.1/lib/python2.7' sysconfig.get_path('stdlib', 'posix_user') = '/ms/user/a/and/.local/lib/python2.7' sysconfig.get_path('platstdlib', 'posix_prefix') = '/ms/dist/python/PROJ/core/2.7.1/exec/lib/python2.7' sysconfig.get_path('platstdlib', 'posix_user') = '/ms/user/a/and/.local/lib/python2.7' sysconfig.get_path('purelib', 'posix_prefix') = '/ms/dist/python/PROJ/core/2.7.1/lib/python2.7/site-packages' sysconfig.get_path('purelib', 'posix_user') = '/ms/user/a/and/.local/lib/python2.7/site-packages' sysconfig.get_path('platlib', 'posix_prefix') = '/ms/dist/python/PROJ/core/2.7.1/exec/lib/python2.7/site-packages' sysconfig.get_path('platlib', 'posix_user') = '/ms/user/a/and/.local/lib/python2.7/site-packages' I think the problem is that while get_path('platstdlib', 'posix_prefix') returns an exec-specific path different from get_path('stdlib', 'posix_prefix'), get_path('platstdlib', 'posix_user') returns the same as get_path('stdlib', 'posix_user'). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9100 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10833] Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated
Eric Smith e...@trueblade.com added the comment: I don't feel strongly one way or the other about it. I was just relaying the reason I heard when I asked the question about why it's done the way it is. I suggest mentioning that you're going to commit this change on python-dev, since this seems like an issue that people might care about without knowing about its existence in the bug tracker. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10833 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11306] mailbox should test for errno.EROFS
R. David Murray rdmur...@bitdance.com added the comment: Committed to py3k in r88730, 3.2 in r88731, and 2.7 in r88732. I tested it by hand; mbox open failed before patch, succeeded (read-only) after patch. I also changed two other cases of EACCES tests without testing them; I don't see how it could hurt to add EROFS. I did not touch the os2-specific cases as there it looks like EROFS might require a different semantic from EACCES. -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed versions: +Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11306 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Eli Bendersky eli...@gmail.com added the comment: Committed the bytearray methods in revision 88733. Closing this issue. Will handle wrong exception and MutableSequence ABC method addition in separate issues. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11385] TextTestRunner methods are not documented
New submission from anatoly techtonik techto...@gmail.com: TextTestRunner has a run method, which is not documented. It is also is not clear how to add suite to TextTestRunner to be executed later by unittest.main() -- assignee: docs@python components: Documentation, Tests messages: 129988 nosy: docs@python, techtonik priority: normal severity: normal status: open title: TextTestRunner methods are not documented versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11385 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11386] Fix exception thrown by bytearray.pop() for empty bytearrays
New submission from Eli Bendersky eli...@gmail.com: bytearray.pop() currently throws OverflowError when popping an empty bytearray, instead of IndexError. See Issue #10516 for reference discussion. -- assignee: rhettinger components: Interpreter Core keywords: easy, needs review messages: 129989 nosy: eli.bendersky, georg.brandl, ncoghlan, rhettinger, terry.reedy priority: normal severity: normal stage: patch review status: open title: Fix exception thrown by bytearray.pop() for empty bytearrays type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11386 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11387] Tkinter, callback functions
New submission from Nikolay Fomichev morphsa...@gmail.com: A simple code: class App(): def __init__(self): self.root = tk.Tk() self.btn = tk.Button(self.root, text='Click me') self.btn.pack() self.btn.bind('Button-1', self.click) self.root.mainloop() def click(self, event): # Messagebox or filedialog pass When the button is clicked, it calls the function where a filedialog or messagebox is called. After the function is done the button changes - it looks like it's pressed. Its relief is sunken. Something like self.btn.config(relief=tk.RAISED) has no effect - relief is raised, but the button still looks pressed. If no dialogs are called, all is fine. But... if instead of bind I use config option command, it works - the function goes well with dialogs, etc and the button is really raised. I checked this in 2.6.6, 2.7, 3.1.2 and 3.2 on Linux and Win, everywhere is the same tune. -- components: Tkinter messages: 129990 nosy: Nikolay.Fomichev priority: normal severity: normal status: open title: Tkinter, callback functions versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11387 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11265] asyncore does not check for EAGAIN and EPIPE errno
Марк Коренберг socketp...@gmail.com added the comment: I did not catch EAGAIN in connect() as it makes hang some tests. maybe incorrect tests? which test(s) failed ? mmarkk@fad:/usr/include$ fgrep EWOULDB -r . ./asm-generic/errno.h:#define EWOULDBLOCK EAGAIN /* Operation would block */ So not catching EAGAIN ( at least in Linux) can not make some tests hang. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11265 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11386] Fix exception thrown by bytearray.pop() for empty bytearrays
Eli Bendersky eli...@gmail.com added the comment: The attached patch changes the exception thrown to IndexError, as well as aligning the error message to the one thrown by list. -- keywords: +patch Added file: http://bugs.python.org/file20986/issue11386.1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11386 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9795] nntplib.NNTP should support the context protocol
Giampaolo Rodola' g.rod...@gmail.com added the comment: Committed in r88734. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9795 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11388] Implement MutableSequence.clear()
New submission from Eli Bendersky eli...@gmail.com: Now that both list and bytearray support the clear() method (see issue #10516), MutableSequence.clear() has to be implemented. This is pending on commit for issue #11386, which fixes the exception thrown by bytearray.pop() when the bytearray is empty. -- assignee: eli.bendersky components: Library (Lib) keywords: easy messages: 129994 nosy: eli.bendersky, georg.brandl, ncoghlan, rhettinger, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Implement MutableSequence.clear() type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11388 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11259] asynchat does not check if terminator is negative integer
Changes by Марк Коренберг socketp...@gmail.com: Added file: http://bugs.python.org/file20987/z31.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11259 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11259] asynchat does not check if terminator is negative integer
Марк Коренберг socketp...@gmail.com added the comment: actual patch which includes tests I do not understand you. Probably I can not write that patch. Do not know how to. Sorry :( -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11259 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11386] Fix exception thrown by bytearray.pop() for empty bytearrays
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: The patch looks fine. Please apply and backport. Also, please search all other pop() methods in the standard library to see if this bug occurred anywhere else. Popping from an empty container should be a LookupError, either IndexError for sequences or KeyError for mappings. -- assignee: rhettinger - eli.bendersky nosy: +nnorwitz resolution: - accepted versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11386 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11388] Implement MutableSequence.clear()
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: s/has to be/could be/ But yes, this would be a worthwhile addition to MutableSequence :-) -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11388 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11388] Implement MutableSequence.clear()
Georg Brandl ge...@python.org added the comment: +1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11388 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11259] asynchat does not check if terminator is negative integer
Giampaolo Rodola' g.rod...@gmail.com added the comment: By writing a test I mean adding a unittest-based test case in Lib/test/test_asynchat.py which fails before fixing Lib/asynchat.py and succeeds afterwards. Now, I'm not even sure I properly understood your bug exactly. I've never used negative terminators in asynchat and I'm not even sure why one would want to. In this case, taking a look at a test would help me (and others) to understand what you are complaining about exactly and figure out whether this is actually a bug and if it is worth fixing it. As for how to properly write a patch see: http://www.python.org/dev/faq/ All new patches should be applied to python 3.3 first so every time you submit a new one you should work on the 3.3 branch (current trunk) which is: http://svn.python.org/projects/python/branches/py3k/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11259 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11388] Implement MutableSequence.clear()
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11388 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
Charles-Francois Natali neolo...@free.fr added the comment: Attached is a patch removing useless calls to Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS for several posix functions. It's straigthforward, but since I only have Linux boxes, I couldn't test it under Windows. -- keywords: +patch Added file: http://bugs.python.org/file20988/gil_release_py3k.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___Index: Modules/posixmodule.c === --- Modules/posixmodule.c (révision 88734) +++ Modules/posixmodule.c (copie de travail) @@ -3041,9 +3041,7 @@ if (!PyArg_ParseTuple(args, ii, which, who)) return NULL; errno = 0; -Py_BEGIN_ALLOW_THREADS retval = getpriority(which, who); -Py_END_ALLOW_THREADS if (errno != 0) return posix_error(); return PyLong_FromLong((long)retval); @@ -3063,9 +3061,7 @@ if (!PyArg_ParseTuple(args, iii, which, who, prio)) return NULL; -Py_BEGIN_ALLOW_THREADS retval = setpriority(which, who, prio); -Py_END_ALLOW_THREADS if (retval == -1) return posix_error(); Py_RETURN_NONE; @@ -5712,9 +5708,7 @@ return NULL; if (!_PyVerify_fd(fd)) return posix_error(); -Py_BEGIN_ALLOW_THREADS fd = dup(fd); -Py_END_ALLOW_THREADS if (fd 0) return posix_error(); return PyLong_FromLong((long)fd); @@ -5733,9 +5727,7 @@ return NULL; if (!_PyVerify_fd_dup2(fd, fd2)) return posix_error(); -Py_BEGIN_ALLOW_THREADS res = dup2(fd, fd2); -Py_END_ALLOW_THREADS if (res 0) return posix_error(); Py_INCREF(Py_None); @@ -6116,9 +6108,7 @@ HFILE read, write; APIRET rc; -Py_BEGIN_ALLOW_THREADS rc = DosCreatePipe( read, write, 4096); -Py_END_ALLOW_THREADS if (rc != NO_ERROR) return os2_error(rc); @@ -6127,9 +6117,7 @@ #if !defined(MS_WINDOWS) int fds[2]; int res; -Py_BEGIN_ALLOW_THREADS res = pipe(fds); -Py_END_ALLOW_THREADS if (res != 0) return posix_error(); return Py_BuildValue((ii), fds[0], fds[1]); @@ -6137,9 +6125,7 @@ HANDLE read, write; int read_fd, write_fd; BOOL ok; -Py_BEGIN_ALLOW_THREADS ok = CreatePipe(read, write, NULL, 0); -Py_END_ALLOW_THREADS if (!ok) return win32_error(CreatePipe, NULL); read_fd = _open_osfhandle((Py_intptr_t)read, 0); ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11389] unittest: no way to control verbosity of doctests from cmd
New submission from anatoly techtonik techto...@gmail.com: I can't find a way to execute DocTests contained in a separate README.txt file using unittest.main() function. That doesn't allow to control verbosity for debugging. I am doing it this way in the tests.py import doctest import unittest if __name__ == '__main__': runner = unittest.TextTestRunner() runner.run(doctest.DocFileSuite('README.txt', optionflags=doctest.ELLIPSIS)) I could find a way to subclass TestLoader.loadTestsFromNames() by looking at the source code of undocumented TestProgram. I'd like to see this use case at least covered by documentation if not properly developed for stdlib of Python4. -- assignee: docs@python components: Documentation, Tests messages: 130001 nosy: docs@python, techtonik priority: normal severity: normal status: open title: unittest: no way to control verbosity of doctests from cmd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11389 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11390] doctest: add cmdline parameters
New submission from anatoly techtonik techto...@gmail.com: doctest module need to parse -h/--help parameters, and accept flags like ELLIPSIS from command line. Otherwise it very hard to debug tests like contained in the attached README. It is also worth to make it parameter compatible with unittest.main() Usage: tests.py [options] [test] [...] Options: -h, --help Show this message -v, --verboseVerbose output -q, --quiet Minimal output -f, --failfast Stop on first failure -c, --catch Catch control-C and display results -b, --buffer Buffer stdout and stderr during test runs -- files: README.txt messages: 130002 nosy: techtonik priority: normal severity: normal status: open title: doctest: add cmdline parameters versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file20989/README.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11390 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Buildbot ok, i hope it's ok for you all that i close this heavy-load issue. More fun further on up the road ... from a non-MQ user. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Changes by Steffen Daode Nurpmeso sdao...@googlemail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- resolution: - fixed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Giampaolo Rodola' g.rod...@gmail.com added the comment: Thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11351] Mac OS X os.sendfile()
Ned Deily n...@acm.org added the comment: Looks good to me and the test does now run successfully. Note that sendfile() was introduced with OS X 10.5 so, like a number of other similar calls, os.sendfile() will not be present on 32-bit-only OS X installer builds which are built with a minimum deployment target of 10.3. It will be available on the 64-/32-bit installers which have a 10.6 minimum deployment target. -- stage: patch review - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11351 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9922] subprocess.getstatusoutput can fail with utf8 UnicodeDecodeError
Ned Deily n...@acm.org added the comment: I don't have a strong feeling about it but it seems to me that getstatusoutput is broken now so something should needs to be changed. If I understand your suggestion, adding a universal_newlines option to getstatusoutput similar to Popen, with a True (default) to return str False to return bytes, should provide an upwards compatible compromise. And whatever solution is adopted for Issue6135 should be able to be applied here as well. On the other hand, getstatusoutput was a carryover from the commands module in Python 2 and I'm not sure why it was not just removed in Python 3 as it seems to duplicate what can be done with Popen. Perhaps it should just be deprecated and removed? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9922 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10592] pprint module doesn't work well with OrderedDicts
Changes by Craig McQueen pyt...@craig.mcqueen.id.au: -- nosy: +cmcqueen1975 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10592 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1661754] ftplib passive ftp problem on multihomed clients
Giampaolo Rodola' g.rod...@gmail.com added the comment: Patch in attachment updates the previous one which no longer applies cleanly in py 3.3. The control connection address is used for *both* passive (PASV) and active (PORT) connections, which is the same approach I used in pyftpdlib. Removed test_source_address_passive_connection test because we do not want that the same (host, port) is used for both control and data connections. I think it makes sense to port this patch in previous python versions as well. -- nosy: +exarkun, pitrou stage: test needed - patch review versions: +Python 3.3 Added file: http://bugs.python.org/file20990/ftplib.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1661754 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1661754] ftplib passive ftp problem on multihomed clients
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- assignee: - giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1661754 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10924] Adding salt and Modular Crypt Format to crypt library.
Changes by Dave Malcolm dmalc...@redhat.com: -- nosy: +dmalcolm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10924 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11391] mmap write segfaults if PROT_WRITE bit is not set in prot
New submission from Charles-Francois Natali neolo...@free.fr: $ cat /tmp/test_mmap.py import mmap m = mmap.mmap(-1, 1024, prot=mmap.PROT_READ|mmap.PROT_EXEC) m[0] = 0 $ ./python /tmp/test_mmap.py Segmentation fault When trying to perform a write, is_writable is called to check that we can indeed write to the mmaped area. is_writable just checks the access mode, and if it's not ACCESS_READ, we go ahead and proceed to the write. The problem is that under Unix, it's possible to pass ACCESS_DEFAULT, and in that case no check is done on prot value. In that case, is_writable will return true (since ACCESS_DEFAULT != ACCESS_READ), but if prot doesn't include PROT_WRITE bit, we'll segfault. Attached is a patch including fix and specific test. -- files: mmap_check_prot_py3k.diff keywords: patch messages: 130008 nosy: neologix priority: normal severity: normal status: open title: mmap write segfaults if PROT_WRITE bit is not set in prot Added file: http://bugs.python.org/file20991/mmap_check_prot_py3k.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11391 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1661754] ftplib passive ftp problem on multihomed clients
Giampaolo Rodola' g.rod...@gmail.com added the comment: we do not want that the same (host, port) is used for both control and data connections. I meant *port*, not (host, port). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1661754 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11391] mmap write segfaults if PROT_WRITE bit is not set in prot
Antoine Pitrou pit...@free.fr added the comment: Patch looks mostly good. Why do you use ~PROT_WRITE instead of PROT_READ|PROT_EXEC as in your example? (I'm unsure whether a POSIX implementation could refuse such a value) -- nosy: +pitrou stage: - patch review type: - crash versions: +Python 2.7, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11391 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9173] logger statement not guarded in shutil._make_tarball
v_peter leanmeandonothingmach...@gmail.com added the comment: I think it would be nice to get this test in. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9173 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11392] Turtle - better explain 'chaos' demo
New submission from Sandro Tosi sandro.t...@gmail.com: Following up http://mail.python.org/pipermail/docs/2011-January/002786.html I prepared this patch to - correct Verhulst name - explain that the results can be against common sense Also, what's exactly related to world coordinates in this example? -- assignee: docs@python components: Documentation files: turle_demo_chaos-py3k.patch keywords: patch messages: 130012 nosy: docs@python, sandro.tosi priority: low severity: normal stage: patch review status: open title: Turtle - better explain 'chaos' demo versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file20992/turle_demo_chaos-py3k.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11392 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11393] Integrate faulthandler module into Python 3.3
New submission from STINNER Victor victor.stin...@haypocalc.com: Fault handler for SIGSEGV, SIGFPE, SIGBUS and SIGILL signals: display the Python backtrace and restore the previous handler. Allocate an alternate stack for this handler, if sigaltstack() is available, to be able to allocate memory on the stack, even on stack overflow (not available on Windows). Import the module and call faulthandler.enable() to enable the fault handler. The fault handler is called on catastrophic cases and so it can only use signal-safe functions (eg. it doesn't allocate memory on the heap). That's why the backtrace is limited: it only supports ASCII encoding (use the backslashreplace error handler for non-ASCII characters), doesn't print the source code in the backtrace (only the filename, the function name and the line number), is limited to 100 frames and 100 threads. By default, the Python backtrace is written to the standard error stream. Start your graphical applications in a terminal and run your server in foreground to see the backtrace, or pass a file to faulthandler.enable(). faulthandler is implemented in C using signal handlers to be able to dump a backtrace on a crash or when Python is blocked (eg. deadlock). https://github.com/haypo/faulthandler faulthandler works on Python 2.5 .. 3.3. -- faulthandler is an alternative to gdb7 + python-gdb.py to dump the backtrace. faulthandler already helped me to debug a PyQt crash on Windows: I don't know how to install gdb on Windows, especially with faulthandler! But I didn't get a lot of feedbacks. -- I don't know if the whole module should be included or not. TODO list: * add something to enable faulthandler on the command line: an option on the command line (eg. python -x faulthandler script.py) or an environment variable (PYTHONFAULTHANDLER=y python script.py)? * decide what to do with child processes: disable the faulthandler after a fork? * use something else than Py_AtExit() to unload the module? * dump the Python backtrace on a fatal error (and/or maybe catch SIGABRT) * use maybe something else than alarm()+SIGARLM for dumpbacktrace_later() because it interrupts the current system call -- History of this module. I first proposed a segfault handler using setjmp/longjmp to raise a classic Python exception. So it was possible to execute Python code after a segfault (including stack overflow). But the idea was rejected because the Python internal state may be corrupted if the segfault was an invalid memory write (buffer overflow?), and anyway we cannot warranty that the internal state is still consistent after a long jump. = http://bugs.python.org/issue3999 (sept. 2009) After that, I proposed to just display the Python backtrace on segfault. The signal handler was enabled by default. Because some people was concerned about possible bugs or security vulnerabilities introduced by the signal handler, I proposed options to disable it. Finally, I proposed to disable it by default and add options to enable it, but it was too late for an inclusion into Python 3.2. Anyways, the project (a patch) was young and the API not correctly defined. = http://bugs.python.org/issue8863 (may 2010) I converted my patch into a module. During this conversion, I realized that a module API is more natural than options using environment variables or functions in the sys module (I proposed sys.setfaulthandlerenabled(), an horrible name :-)). And it becomes more natural to enable the faulthandler by importing a module and calling a function (faulthandler.enable()). Later I added functions to display the Python backtrace not only on a crash, but after a certain amount of time, or when an user signal is raised. You can also call the function directly to dump the backtrace. And finally, I added many option to configure how the backtrace is displayed: current thread of all threads, sys.stderr or another file, ... -- I hope that this module will help to understand multiprocessing issues on the buildbots! -- components: Library (Lib) messages: 130013 nosy: haypo priority: normal severity: normal status: open title: Integrate faulthandler module into Python 3.3 versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11393 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11393] Integrate faulthandler module into Python 3.3
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +dmalcolm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11393 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11393] Integrate faulthandler module into Python 3.3
STINNER Victor victor.stin...@haypocalc.com added the comment: I tested faulthandler on Linux, FreeBSD and Windows XP: it works well. I suppose that it works on any operating systems. You can also try it on know crashers: Lib/test/crashers/ (you have to modify the files to add: import faulthandler; faulthandler.enable()). Example: $ ./python Lib/test/crashers/bogus_code_obj.py Fatal Python error: Segmentation fault Traceback (most recent call first): File , line 1 in File Lib/test/crashers/bogus_code_obj.py, line 20 in module Erreur de segmentation The backtrace is not revelant here because the file is very short, but faulthandler is more useful on an huge application. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11393 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11266] asyncore does not handle EINTR in recv, send, connect, accept,
Giampaolo Rodola' g.rod...@gmail.com added the comment: Again, it's not clear to me what you are complaining about. Please try to be more clear and/or provide a patch. -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11266 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11266] asyncore does not handle EINTR in recv, send, connect, accept,
Changes by Florian Mayer florma...@aim.com: -- nosy: +segfaulthunter ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11266 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11373] Fix 2 new typos in the docs
Changes by STINNER Victor victor.stin...@haypocalc.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11342] ResourceWarning: unclosed file _io.TextIOWrapper
LW cjejuni2...@yahoo.com added the comment: so i downloaded the python-3.2 source again, applied the .diff file. still getting _io.TextIOWrapper open file error. then ran the major 5 individual make test_ files errors. hope u can find from these: === les@Liquid:~/Desktop/Python-3.2$ ./python -m test -v test_distutils == CPython 3.2 (r32:88445, Mar 3 2011, 16:17:04) [GCC 4.4.5] == Linux-2.6.35-27-generic-pae-i686-with-debian-squeeze-sid little-endian == /home/les/Desktop/Python-3.2/build/test_python_32202 Testing with flags: sys.flags(debug=0, division_warning=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0) test_no_optimize_flag (distutils.tests.test_bdist_rpm.BuildRpmTestCase) ... unknown, 0: Warning: using regular magic file `/etc/magic' ok test_quiet (distutils.tests.test_bdist_rpm.BuildRpmTestCase) ... unknown, 0: Warning: using regular magic file `/etc/magic' ok == == ./python -m test -v test_parser test_trigger_memory_error (test.test_parser.ParserStackLimitTestCase) ... Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow ok = ./python -m test -v test_startfile test_startfile skipped -- module os has no attribute startfile = = ./python -m test -v test_subprocess test_executable_without_cwd (test.test_subprocess.ProcessTestCase) ... skipped 'need an installed Python. See #7774' test_stdout_none (test.test_subprocess.ProcessTestCase) ... this bit of output is from a test of stdout in a different process ... ok test_pass_fds (test.test_subprocess.POSIXProcessTestCase) ... -- maxfd = 1024 -- fds that should have been closed: {4, 5, 6, 7, 8, 9, 10, 11, 12} -- fds that remained open: {0, 1, 2, 3} -- fds that should have been closed: {3, 5, 6, 7, 8, 9, 10, 11, 12} -- fds that remained open: {0, 1, 2, 4} -- fds that should have been closed: {3, 4, 6, 7, 8, 9, 10, 11, 12} -- fds that remained open: {0, 1, 2, 5} -- fds that should have been closed: {3, 4, 5, 7, 8, 9, 10, 11, 12} -- fds that remained open: {0, 1, 2, 6} -- fds that should have been closed: {3, 4, 5, 6, 8, 9, 10, 11, 12} -- fds that remained open: {0, 1, 2, 7} -- fds that should have been closed: {3, 4, 5, 6, 7, 9, 10, 11, 12} -- fds that remained open: {0, 1, 2, 8} -- fds that should have been closed: {3, 4, 5, 6, 7, 8, 10, 11, 12} -- fds that remained open: {0, 1, 2, 9} -- fds that should have been closed: {3, 4, 5, 6, 7, 8, 9, 11, 12} -- fds that remained open: {0, 1, 2, 10} -- fds that should have been closed: {3, 4, 5, 6, 7, 8, 9, 10, 12} -- fds that remained open: {0, 1, 2, 11} -- fds that should have been closed: {3, 4, 5, 6, 7, 8, 9, 10, 11} -- fds that remained open: {0, 1, 2, 12} ok test_executable_without_cwd (test.test_subprocess.ProcessTestCasePOSIXPurePython) ... skipped 'need an installed Python. See #7774' == == ./python -m test -v test_urllib2_localnet test_sending_headers (test.test_urllib2_localnet.TestUrlopen) ... ok == FAIL: test_proxy_with_bad_password_raises_httperror (test.test_urllib2_localnet.ProxyAuthTests) -- Traceback (most recent call last): File /home/les/Desktop/Python-3.2/Lib/test/test_urllib2_localnet.py, line 267, in test_proxy_with_bad_password_raises_httperror self.URL) AssertionError: HTTPError not raised by open == FAIL: test_proxy_with_no_password_raises_httperror (test.test_urllib2_localnet.ProxyAuthTests) -- Traceback (most recent call last): File /home/les/Desktop/Python-3.2/Lib/test/test_urllib2_localnet.py, line 273, in test_proxy_with_no_password_raises_httperror self.URL) AssertionError: HTTPError not raised by open -- Ran 18 tests in 1.888s FAILED (failures=2) test test_urllib2_localnet failed -- multiple errors occurred 1 test failed: test_urllib2_localnet thanks again -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11342 ___ ___ Python-bugs-list mailing list Unsubscribe:
[issue11373] Fix 2 new typos in the docs
Bob Wintemberg rwi...@gmail.com added the comment: The following is a patch to fix this documentation issue in release27-maint. -- keywords: +patch nosy: +rwinte Added file: http://bugs.python.org/file20993/patch-27.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com