[issue3920] OpenBSD 4.4 still doesn't support _XOPEN_SOURCE
Martin v. Löwis mar...@v.loewis.de added the comment: I have now committed bsd3.diff as r78194, r78195, r78196, and r78197 -- resolution: - accepted status: open - closed versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.5, Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3920 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7903] Configure script incorrect for reasonably recent OpenBSD
Martin v. Löwis mar...@v.loewis.de added the comment: This issue is now superseded by issue 3920. It would be good if somebody could confirm that the approach taken for 4.4 continues to work in more recent releases. -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7903 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7930] pydoc.stripid doesn't strip ID in py25, py26, py31
Ezio Melotti ezio.melo...@gmail.com added the comment: This is the stripid implementation: _re_stripid = re.compile(r' at 0x[0-9a-f]{6,16}(+)$', re.IGNORECASE) def stripid(text): Remove the hexadecimal id from a Python object representation. # The behaviour of %p is implementation-dependent in terms of case. if _re_stripid.search(repr(Exception)): return _re_stripid.sub(r'\1', text) return text The problem is that repr(Exception) used to return class exceptions.Exception at 0x00A64510 on Py=2.4 but now returns type 'exceptions.Exception', so the code inside the if is never executed (this is what happens where there are no unittests). That 'if' has been introduced in r19750 and I think that the reason is to check if the id in 'text' is really an id and hence has the same format of the ids of other objects. I don't think this is really necessary though. -- assignee: - ezio.melotti nosy: +ezio.melotti priority: - normal stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7930 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1652] subprocess should have an option to restore SIGPIPE to default action
Antoine Pitrou pit...@free.fr added the comment: I think restore_sigpipe=True would be a reasonable default. As RDM says, adding an unit test would be better, but it may be difficult to do so (we probably can't spawn Python itself since it will change the default SIGPIPE handler at startup). Looking at the patch, you don't need to import `signal` again: it's already imported at the top level. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1652 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7173] Cython compiler run crashes CPython 3.1.1 and 3.2
Stefan Behnel sco...@users.sourceforge.net added the comment: I tried several times to debug it myself, but I don't understand the exception cleanup macros in ceval.c (UNWIND_EXCEPTION_HANDLER and friends, new in Py3). If someone can get me set up to debug them, I can give it another shot. I assume there are a couple of invariants involved in them? Is there any interaction with generators that I should know about? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7173 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7173] Cython compiler run crashes CPython 3.1.1 and 3.2
Antoine Pitrou pit...@free.fr added the comment: I tried several times to debug it myself, but I don't understand the exception cleanup macros in ceval.c (UNWIND_EXCEPTION_HANDLER and friends, new in Py3). If someone can get me set up to debug them, I can give it another shot. I assume there are a couple of invariants involved in them? Is there any interaction with generators that I should know about? The exception state (what sys.exc_info() gives you) in 3.x is lexically scoped (which it wasn't in 2.x). Which means that given: try: 1/0 except ZeroDivisionError: # A try: [][0] except IndexError: # B pass # C The exception state in C will hold the ZeroDivisionError, not the IndexError (it is the reverse in 2.x). For that, each try/except block needs to save the previous exception state; it is saved on the frame's stack. When the try/except block is left, UNWIND_EXC_HANDLER is used to restore the previous exception state. And, yes, there's an interaction with generators, because yield can be invoked from an except block. In that case, we have to temporarily restore the caller's exception state. See the SWAP_EXC_STATE() call in YIELD_VALUE. Also, the generator's exception state is restored when resuming it, which is done in line 1162 and following in ceval.c. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7173 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7935] Cross-reference ast.literal_eval() from eval() docs
New submission from Kent Johnson k...@kentsjohnson.com: eval() is a known security hole. Since Python 2.6 ast.literal_eval() provides a better alternative in many cases. literal_eval() is not as well known as eval() and not easy to find even if you know it exists (but don't remember the name). eval() comes up over and over in the Python-tutor list and the attendant warnings are repeated ad nauseum; literal_eval() is rarely mentioned as an alternative. Suggestion: in the docs for eval(), put a warning about security risks and a cross-reference to literal_eval(). For example: Warning: eval() executes any expression and should be used only with trusted input. ast.literal_eval() is a safe alternative for evaluating expressions containing only Python literals. Thanks! -- assignee: georg.brandl components: Documentation messages: 99363 nosy: georg.brandl, kjohnson severity: normal status: open title: Cross-reference ast.literal_eval() from eval() docs type: feature request versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7935 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7903] Configure script incorrect for reasonably recent OpenBSD
Stefan Krah stefan-use...@bytereef.org added the comment: In my testing of issue 3920 I missed that the original approach also fixed the ncurses.h problem, so it should be preferred over bsd3.diff. I attach a patch that reverts the recent commit and extends the xopen_source=no up to version 4.9. I've tested it on 4.4 and 4.6, johns did essentially the same on 4.7. I agree with Skip and johns that at least all 4.* versions should be covered, otherwise we have this situation every 6 months. -- keywords: +patch Added file: http://bugs.python.org/file16224/use-xopen-source-no.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7903 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7903] Configure script incorrect for reasonably recent OpenBSD
Martin v. Löwis mar...@v.loewis.de added the comment: Stefan, what ncurses problem are you referring to? I quite object to working around OpenBSD limitations, and would rather hope that OpenBSD fixes their POSIX support at some point. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7903 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7936] sys.argv contains only scriptname
New submission from JT Johnson svedgeb...@gmail.com: I am running Python 2.6.4 on Windows Vista and when I try to get any command line arguments via sys.argv, it only contains sys.argv[0], but nothing else. Even if I supply several parameters. The only third-parts modules I am using are Pygame, but even before Pygame imports, there is nothing in sys.argv. I've tried creating a shortcut with the args in it, but it still doesn't work. Note that I also have a couple other Python versions installed (2.5, 2.7a, and 3.1) maybe somehow they are conflicting? -- components: IO messages: 99367 nosy: JT.Johnson severity: normal status: open title: sys.argv contains only scriptname type: behavior versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7936 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7173] Cython compiler run crashes CPython 3.1.1 and 3.2
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Is it normal that even after the call to next(), the generator frame contains a reference to the RuntimeError? Long explanation: - When the function exits, there is a cycle [parent frame]- ['it' variable]- [generator frame]- [RuntimeError]- [parent frame]. - gc.collect() collects them all, destroys the generator, this causes GeneratorExit exception to be sent into the generator frame. - This executes SWAP_EXC_STATE() in ceval.c (/* We were in an except handler when we left, restore the exception state which was put aside */), this *moves* the reference to the exception from the frame to the thread state. - The exception is resurrected, but this does not prevent the gc from calling its tp_clear method! and setting exc_info() as a side-effect of gc.collect() is really weird... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7173 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7173] Cython compiler run crashes CPython 3.1.1 and 3.2
Antoine Pitrou pit...@free.fr added the comment: Is it normal that even after the call to next(), the generator frame contains a reference to the RuntimeError? As long as it's executing the generator it's quite normal. The generator must be able to restore the caller's RuntimeError when interrupted by a yield. But after the yield, the generator normally doesn't retain a reference (thanks to SWAP_EXC_STATE() in YIELD_VALUE). - This executes SWAP_EXC_STATE() in ceval.c (/* We were in an except handler when we left, restore the exception state which was put aside */), this *moves* the reference to the exception from the frame to the thread state. Actually, it (does/should) execute SAVE_EXC_STATE() instead, because the thread's exception state was empty when yielding. The following patch seems to do the trick: diff -r 4465a45b8876 Python/ceval.c --- a/Python/ceval.cMon Feb 15 09:35:16 2010 +0100 +++ b/Python/ceval.cMon Feb 15 20:51:58 2010 +0100 @@ -1159,7 +1159,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int assert(stack_pointer != NULL); f-f_stacktop = NULL; /* remains NULL unless yield suspends frame */ - if (f-f_code-co_flags CO_GENERATOR) { + if (!throwflag (f-f_code-co_flags CO_GENERATOR)) { if (f-f_exc_type != NULL f-f_exc_type != Py_None) { /* We were in an except handler when we left, restore the exception state which was put aside -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7173 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7932] print statement delayed IOError when stdout has been closed
tholzer thol...@wetafx.co.nz added the comment: This is not quite correct: The following 2 lines fail as expected (unbuffered): pre python -u -c 'import sys; print sys.stdout, x' 1- ; echo $? python -u -c 'import sys; print sys.stderr, x' 2- ; echo $? /pre whereas in the following example, the first command succeeds and the second one fails: pre python -c 'import sys; print sys.stdout, x' 1- ; echo $? python -c 'import sys; print sys.stderr, x' 2- ; echo $? /pre This is counter-intuitive and somewhat contradicts the documentation, as stderr always seems to be unbuffered (irrespective of the -u option). IMHO, they should either both fail or both succeed. They seem to behave the same in 2.5 2.6, however in 3.1, they all die with a SIGABRT, which I guess could be questioned as well. IMHO, they should just throw an exception like in 2.6. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7932 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7903] Configure script incorrect for reasonably recent OpenBSD
Stefan Krah stefan-use...@bytereef.org added the comment: On OpenBSD the ncurses.h header has been broken for quite some time, see e.g. http://bugs.python.org/issue1244610. The problem is that when _XOPEN_SOURCE_EXTENDED is defined, wchar_t is defined twice. I can confirm that it is still broken on 4.6, but it appears that it has been fixed in current. So I propose to use the old method up to 4.6, and use the new method from 4.7 on. I attach a patch that has been tested on an OpenBSD snapshot (which will become version 4.7). -- Added file: http://bugs.python.org/file16226/openbsd_configure.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7903 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7903] Configure script incorrect for reasonably recent OpenBSD
Martin v. Löwis mar...@v.loewis.de added the comment: Thanks for the tests, and the patch. Committed as r78202, r78203, r78204, and r78205. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7903 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6375] compile failure in Modules/python.c
Martin v. Löwis mar...@v.loewis.de added the comment: Closing this as unreproducible. -- resolution: - works for me status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6375 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4639] Build failure on OpenBSD 4.4-current regarding lstat()
Martin v. Löwis mar...@v.loewis.de added the comment: Can you please try the Python trunk (or release26-maint branch) and report whether the problem still occurs? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4639] Build failure on OpenBSD 4.4-current regarding lstat()
Stefan Krah stefan-use...@bytereef.org added the comment: This is fixed in trunk by the configure.in patch. I've tested trunk on 4.4 and 4.7. -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7938] makesetup interprets macros -DA=B as a Make variable definition
New submission from Willem de Bruijn wdebr...@dds.nl: (this is very low priority: an issue in a nonstandard build) I am porting Python 2.6.4 to a system with only partial Posix support that requires static linking for all modules. To enable sqlite, I added the line _sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -DMODULE_NAME='sqlite3' -IModules/_sqlite ... to Modules/Setup, but found that it would not end up in the main binary. Instead of adding it to MODOBJS, makesetup put it in BASEMODLIBS The problem occurs in Modules/makesetup, line 131, which matches all lines containing = and treats them as Make definitions. In this case, it matches the equal sign in the C macro MODULE_NAME. The problem goes away when I tighten the check at that line: - *=*)DEFS=$line$NL$DEFS; continue;; + [[:alpha:]]*=*) DEFS=$line$NL$DEFS; continue;; (see the attached file for the trivial patch in diff -Nur format) This patch comes with a big warning: my sh-regex foo is very poor. I wanted to write a test that only accepted ^[:alpha:][^ ]*=*, but that did not work. The above did, but I cannot oversee all consequences. cheers, Willem -- components: Build files: pydiff messages: 99378 nosy: wdebruij severity: normal status: open title: makesetup interprets macros -DA=B as a Make variable definition type: compile error versions: Python 2.6 Added file: http://bugs.python.org/file16227/pydiff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7938 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7936] sys.argv contains only scriptname
JT Johnson svedgeb...@gmail.com added the comment: Actually, I was playing around with it and I found that using the python command before it does work. Now, when I type what you said to do, it shows that there is no association, even though i can run a program without the python command. This is quite strange... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7936 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7936] sys.argv contains only scriptname
JT Johnson svedgeb...@gmail.com added the comment: Sorry for a double-comment, but I thought of posting this after I already submitted the last one and I found no edit button. Here's some output: Microsoft Windows [Version 6.0.6001] Copyright (c) 2006 Microsoft Corporation. All rights reserved. C:\Users\JTassoc .py File association not found for extension .py C:\Users\JTassoc py File association not found for extension py C:\Users\JT\Desktop\Programming Projectspythonversion.py 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] C:\Users\JT\Desktop\Programming Projectsftype Python.File File type 'Python.File' not found or no open command associated with it. C:\Users\JT\Desktop\Programming Projectsassoc py File association not found for extension py C:\Users\JT\Desktop\Programming Projectsassoc .py File association not found for extension .py C:\Users\JT\Desktop\Programming Projectsassoc .pyw File association not found for extension .pyw C:\Users\JT\Desktop\Programming Projectsassoc pyw File association not found for extension pyw C:\Users\JT\Desktop\Programming Projectsassoc pyc File association not found for extension pyc C:\Users\JT\Desktop\Programming Projectsassoc .pyc File association not found for extension .pyc C:\Users\JT\Desktop\Programming Projectsassoc .pyo File association not found for extension .pyo C:\Users\JT\Desktop\Programming Projectsassoc pyo File association not found for extension pyo (Sorry it's so long, I cut out the blank lines as it is) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7936 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7931] Python hangs after last thread has exited
Nikolaus Rath nikol...@rath.org added the comment: Here is a short testcase that reproduces the problem. If you run the script it daemonizes correctly, but then the daemon does not terminate but hangs forever. The crucial part seems to be to daemonize the program while there is more than one thread running. -- Added file: http://bugs.python.org/file16228/test.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7931 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7931] Interpreter does not terminate if daemonized while running multithreaded
Changes by Nikolaus Rath nikol...@rath.org: -- title: Python hangs after last thread has exited - Interpreter does not terminate if daemonized while running multithreaded ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7931 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7846] Fnmatch cache is never cleared during usage
Éric Araujo mer...@netwok.org added the comment: Hello The feature seems useful to me and the patch straightforward. I wonder why you used a global name for the max length (“_MAXCACHE”) instead of inlining the value where it is used. Does it feel more constanty? ;) I fear that the leading underscore won’t discourage users from touching it, so I’d suggest making it public or completely hidden. On second thought, you could argue that Python is a matter of consenting adults, and that leading underscore is okay. Regards -- nosy: +merwok ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7846 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7751] urllib.urlopen(///C|/foo/bar/spam.foo) IOError: [Errno 22]
Éric Araujo mer...@netwok.org added the comment: Hello I’m no expert on Python bugs, but I believe a test for the fixed behavior would improve your patch. Maybe a link to some documentation in a comment (or in an entry in Misc/NEWS) too. Regards -- nosy: +merwok ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7751 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7930] pydoc.stripid doesn't strip ID in py25, py26, py31
Ezio Melotti ezio.melo...@gmail.com added the comment: Here's a patch with a minimal unittest. -- keywords: +easy, needs review, patch stage: test needed - patch review versions: -Python 2.5 Added file: http://bugs.python.org/file16229/issue7930.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7930 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7751] urllib.urlopen(///C|/foo/bar/spam.foo) IOError: [Errno 22]
Christoph Gohlke cgoh...@uci.edu added the comment: A testcase is attached. Information about the file URI scheme can be found at: http://en.wikipedia.org/wiki/File_URI_scheme http://tools.ietf.org/html/draft-hoffman-file-uri-03 http://blogs.msdn.com/ie/archive/2006/12/06/file-uris-in-windows.aspx http://www.cs.tut.fi/~jkorpela/fileurl.html -- Added file: http://bugs.python.org/file16230/test_nturl2path.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7751 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com