[issue4708] os.pipe should return inheritable descriptors (Windows)

2009-01-14 Thread Aaron Brady
Aaron Brady castiro...@gmail.com added the comment: This is currently accomplished in 'multiprocessing.forking' with a 'duplicate' function. Use (line #213): rfd, wfd = os.pipe() # get handle for read end of the pipe and make it inheritable rhandle =

[issue4874] decoding functions in _codecs module accept str arguments

2009-01-14 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: On 2009-01-13 14:14, Antoine Pitrou wrote: Antoine Pitrou pit...@free.fr added the comment: The patch is probably fine, but it would be nice to add some unit tests for the new behaviour. +1 from my side. Thanks for the patch, Viktor.

[issue4931] distutils does not show any error msg when can't build C module extensions due to a missing C compiler

2009-01-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The problem has two causes: - IOError is raised when no compiler is found. DistutilsPlatformError should be used instead, this was fixed by #4702. - the distutils.util.grok_environment_error function transforms a IOError(Unable to find

[issue4781] The function, Threading.Timer.run(), may be Inappropriate

2009-01-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Indeed, Timer is designed to run the function once. -- nosy: +amaury.forgeotdarc resolution: - works for me status: open - closed ___ Python tracker rep...@bugs.python.org

[issue4929] smptlib.py can raise socket.error

2009-01-14 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' billiej...@users.sourceforge.net: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4929 ___

[issue4715] optimize bytecode for conditional branches

2009-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Your change to the LOAD_CONST trueconst JUMP_IF_FALSE xx POP_TOP optimization doesn't preserve the optimization to: def f(): return 1 and a I suspect we don't care since 0 or a wasn't optimized. Yes, this optimization seems meant for

[issue4947] sys.stdout fails to use default encoding as advertised

2009-01-14 Thread Steven D'Aprano
New submission from Steven D'Aprano st...@pearwood.info: Documentation for files states that when writing to a file, unicode strings are converted to byte strings using the encoding specified by file.encoding. http://docs.python.org/library/stdtypes.html#file.encoding sys.stdout is a file,

[issue4946] Lib/test/test__locale uses is to compare strings

2009-01-14 Thread Maciek Fijalkowski
New submission from Maciek Fijalkowski fi...@genesilico.pl: this is at least a bad practice. It also might break silently at any point. -- components: Library (Lib), Tests files: out.diff keywords: patch messages: 79846 nosy: fijal severity: normal status: open title:

[issue4715] optimize bytecode for conditional branches

2009-01-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le mercredi 14 janvier 2009 à 02:48 +, Jeffrey Yasskin a écrit : Looking through the patch... I don't really like the names for JUMP_OR_POP and POP_OR_JUMP. I don't like them either, they're the only relatively short ones I could come up

[issue1519638] Unmatched Group issue - workaround

2009-01-14 Thread Bobby Xiao
Bobby Xiao nneon...@gmail.com added the comment: Well, in this example the group (ar) is unmatched, so sre throws the error, and because of the alternation, the workaround you mentioned doesn't seem to directly apply. A better example is probably re.sub(foo(?:b(ar)|foo),\\1,foofoo) because this

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-14 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: gagenellina, My application is a little bit different from your test code. It won't wait for the exit of new process and there're file writing operations during makefile running. I changed the test code to be real multi-process and tried many file

[issue2233] Makefile.pre.in contains extra slash before $(DESTDIR) which can cause Cygwin build to fail

2009-01-14 Thread Jason Tishler
Jason Tishler ja...@tishler.net added the comment: Your latest patch is on the right track, but see my latest one, Makefile.pre.in.v2.diff, for an optimization. I tested make install with and without DESTDIR defined on the command line and both cases behaved as expected. Added file:

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-14 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: The created files are on local drive. I saw the problem on the laptop (XP-SP2), desktop(XP-SP3) and server (Win2003). But there's no such problem on the Linux and Mac boxes. I tried to use fopen/fwrite in my extension according to your suggestion.

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-14 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: There would be more chances to see the problem by doing this: C:\test\edk2 python.exe C:\test\tools\Source\Python\build\build.py -n 2 -p IntelFrameworkModulePkg\IntelFrameworkModulePkg.dsc -a IA32 -s ___ Python

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I really tried, but I can't run your script. first PYTHONPATH must be set to some value (I tried with tools\Source\Python); Also the tool is complaining about missing WORKSPACE and EDK_TOOLS_PATH env vars, and a missing file

[issue4948] Make heapq work with all mutable sequences

2009-01-14 Thread Benoit Boissinot
New submission from Benoit Boissinot bboissin+pythonb...@gmail.com: Generalize heapq to work with all kind of mutable sequences. It should be investigated PySequence_SetItem is a lot slower than PyList_SET_ITEM (same for GET_ITEM and GET_SIZE). -- components: Extension Modules messages:

[issue4932] Little improvement on urlparse module, urlparse function.

2009-01-14 Thread Andres Moreira
Andres Moreira elkpich...@gmail.com added the comment: Hi haypo, Ok I've been testing with python 2.6 and I put the results here: optimizedurlparse is the file with my patch First test optimizedurlparse, second urlparse: #:/opt/python2.6/release26-maint$ ./python mio/profile_urlparse.py

[issue4932] Little improvement on urlparse module, urlparse function.

2009-01-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Please, attach patches instead of the full file. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4932 ___

[issue4932] Little improvement on urlparse module, urlparse function.

2009-01-14 Thread Andres Moreira
Andres Moreira elkpich...@gmail.com added the comment: Hi haypo, sorry for submit all the file, it's my first time here and I'm not very used to this process yet. :) Now I attach the patch. -- keywords: +patch Added file: http://bugs.python.org/file12744/urlparse.patch

[issue4932] Little improvement on urlparse module, urlparse function.

2009-01-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Now I attach the patch. Your first patch for Python 2.5 was interesting, and looked close to the python 2.6 version. But your second patch (for 2.6) contains only micro-optimisations: - inline the one-line clear_cache() function

[issue4948] Make heapq work with all mutable sequences

2009-01-14 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: This was discussed at the outset and the decision was a conscious one. Do you have any particular use cases in mind (what other mutable sequences do you reach for when you need a heap)? Or is this just a general discussion

[issue4948] Make heapq work with all mutable sequences

2009-01-14 Thread Benoit Boissinot
Benoit Boissinot bboissin+pythonb...@gmail.com added the comment: I was thinking about array.array. I don't know if it would be faster than using a list, but it seemed elegant to be able to do a heap on it anyway. ___ Python tracker rep...@bugs.python.org

[issue4932] Little improvement on urlparse module, urlparse function.

2009-01-14 Thread Andres Moreira
Andres Moreira elkpich...@gmail.com added the comment: Yes are micro-optimizations, but when I parsed a lot of url(10.000 or more) that 10% or 8% or 5% is very well for me :). It was little contribution to that module, anyway, i think that there are more optimizatoins to do but I will try to do

[issue4949] Constness in PyErr_NewException

2009-01-14 Thread Andreas Kloeckner
New submission from Andreas Kloeckner inf...@tiker.net: The name argument to PyErr_NewException() should be changed from char * to const char *. Since the rest of pyerrors.h is const-correct, this seems like an omission. -- components: Interpreter Core messages: 79868 nosy: inducer

[issue4948] Make heapq work with all mutable sequences

2009-01-14 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: array.array is terribly slow. It is optimized for space, not speed. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4948 ___

[issue4950] Redundant declaration in pyerrors.h

2009-01-14 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: When compiling with -Wredundant-decls gcc spots a redundant declaration: f...@laurie:sandbox$ cat test.c #include Python.h #include stdio.h int main(void) { printf(hello\n); return 0; } f...@laurie:sandbox$ gcc

[issue4949] Constness in PyErr_NewException

2009-01-14 Thread Ulrich Eckhardt
Ulrich Eckhardt eckha...@satorlaser.com added the comment: It's not just that function, at least not in trunk. There are also PyErr_SetFromErrnoWithFilename, PyErr_SetFromErrnoWithUnicodeFilename and _PyErr_BadInternalCall which should be made const correct, see attached patch for trunk.

[issue4933] Patch to add preliminary support for Haiku

2009-01-14 Thread Scott McCreary
Scott McCreary scott...@gmail.com added the comment: On Tue, Jan 13, 2009 at 10:38 PM, Martin v. Löwis rep...@bugs.python.org wrote: Martin v. Löwis mar...@v.loewis.de added the comment: I don't have any particular interest in BeOS variants, but this comes as a surprise given that

[issue1242657] list(obj) can swallow KeyboardInterrupt

2009-01-14 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Reassigning to Raymond (as per the thread at http://mail.python.org/pipermail/python-dev/2009-January/085030.html) -- assignee: georg.brandl - rhettinger nosy: +ncoghlan ___ Python tracker

[issue2233] Makefile.pre.in contains extra slash before $(DESTDIR) which can cause Cygwin build to fail

2009-01-14 Thread Roumen Petrov
Roumen Petrov bugtr...@roumenpetrov.info added the comment: Hi Jason, quick review without tests - I expect $${DESTDIR:-/} to work without : in expression, i.e. just $${DESTDIR-/}. The : in expression is not so portable (some shells fail on this). Please see Shell Substitutions in autoconf

[issue4933] Patch to add preliminary support for Haiku

2009-01-14 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Ok, I'm closing this patch as rejected. If the discussion on python-dev turns out that Haiku support should be added, then please create a new issue (with a patch for 2.7 - clearly, for 2.6, no new features can be added). --

[issue4908] adding a get_metadata in distutils

2009-01-14 Thread Tarek Ziadé
Changes by Tarek Ziadé ziade.ta...@gmail.com: Added file: http://bugs.python.org/file12746/get_metadata.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4908 ___

[issue4908] adding a get_metadata in distutils

2009-01-14 Thread Tarek Ziadé
Changes by Tarek Ziadé ziade.ta...@gmail.com: Removed file: http://bugs.python.org/file12692/get_metadata.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4908 ___

[issue4908] adding a get_metadata in distutils

2009-01-14 Thread Tarek Ziadé
Tarek Ziadé ziade.ta...@gmail.com added the comment: I have improved the patch (uploaded here) (some cases are not done yet, still work in progress) Ray, it should work with egg generated by setuptools now, (zipped as well) Andi, right ! - fixed in the current patch

[issue2233] Makefile.pre.in contains extra slash before $(DESTDIR) which can cause Cygwin build to fail

2009-01-14 Thread Jason Tishler
Jason Tishler ja...@tishler.net added the comment: I guess you mean the following: ${var:-value} Old BSD shells, including the Ultrix sh, don't accept the colon for any shell substitution, and complain and die. If so, should we just go forward without the colon? The bash manpage indicates

[issue4933] Patch to add preliminary support for Haiku

2009-01-14 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: FWIW, I've launched a discussion on python-dev. If the OP is willing to maintain the deltas over a long period of time (and perhaps provide a buildbot for Haiku), then I fully support his effort. -- nosy: +rhettinger

[issue4946] Lib/test/test__locale uses is to compare strings

2009-01-14 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: Yes, checking object identity is wrong in this case. Your patch looks fine to me. I've found several other is comparisons that should not be there -- working on a patch right now. -- nosy: +gagenellina

[issue4933] Patch to add preliminary support for Haiku

2009-01-14 Thread Guido van Rossum
Guido van Rossum gu...@python.org added the comment: [Copy of a post I just made to python-dev] I'm with Martin. In these days of distributed version control systems, I would think that the effort for the Haiku folks to maintain a branch of Python in their own version control would be minimal.

[issue4951] failure in test_httpservers

2009-01-14 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: This one seems to pop up rather frequently on the buildbots: == FAIL: test_post (test.test_httpservers.CGIHTTPServerTestCase)

[issue4929] smptlib.py can raise socket.error

2009-01-14 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: On Windows, if you exit a process abnormally (using e.g. os._exit() in Python) while it still has open connections, the other side receives a WSAECONNRESET (error 10054). So, you could write a test case using a dumb server (running

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-14 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: I agree multithread programming is kind of difficult and tricky. But I don't think there's a race condition in _MultiThreadBuildPlatform method, because I do have only one producer. And the consumer consumes the product only when it's done (i.e.

[issue4947] sys.stdout fails to use default encoding as advertised

2009-01-14 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: It probably uses sys.getdefaultencoding() instead. That would be wrong too, according to the cited documentation. file.encoding is a read only attribute; it can be set in C code using PyFile_SetEncoding. Apart from its definition in

[issue4952] Running Python Script to Run a C++ Code

2009-01-14 Thread Gil
New submission from Gil mathnasium...@gmail.com: Attached you will find my attachment testdll.zip, my dilemma was how to run the attached C++ program using python scripts. Please advise. Thanks, Gil -- components: IDLE files: testdll.zip messages: 79888 nosy: dominade27 severity:

[issue4952] Running Python Script to Run a C++ Code

2009-01-14 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: Please post your question to the Python users mailing list: python- l...@python.org -- mirrored as the comp.lang.python newsgroup too. Also, gmane.org provides a web interfase: http://dir.gmane.org/ gmane.comp.python.general Back to

[issue4952] Running Python Script to Run a C++ Code

2009-01-14 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: The bug tracker is not a place to obtain help, but to offer help (e.g. by proposing patches to Python). As Gabriel explains, there are better places to get help with Python. Closing the report as invalid. -- nosy: +loewis resolution:

[issue1242657] list(obj) can swallow KeyboardInterrupt

2009-01-14 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Here's a patch that fixes-up length_hint and it's internal callers. I think there are plenty of other places that also swallow exceptions but will leave those for someone who wants to look at every instance of PyErr_Clear()