[issue4709] Mingw-w64 and python on windows x64

2008-12-21 Thread Cournapeau David
New submission from Cournapeau David da...@ar.media.kyoto-u.ac.jp: I believe the current pyport.h for windows x64 has some problems. It does not work for compilers which are not MS ones, because building against the official binary (python 2.6) relies on features which are not enabled unless

[issue4707] round() shows undocumented behaviour

2008-12-21 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Martin, that gives some answers like round(51, -2) -- 0 instead of 100. I see. Here is a version that fixes that. def round(n, i): i = 10**(-i) r = n%(2*i) o = i/2 n -= r if r = o: return n elif r 3*o:

[issue4631] urlopen returns extra, spurious bytes

2008-12-21 Thread Martin v. Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- priority: critical - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4631 ___ ___

[issue4707] round() shows undocumented behaviour

2008-12-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Updated patch: fix test_builtin. (Rest of the patch unchanged.) Added file: http://bugs.python.org/file12412/round_int_int2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4707

[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly

2008-12-21 Thread Kuba Wieczorek
New submission from Kuba Wieczorek faw...@gmail.com: This behaviour has been known of course for quite long time. I suppose this is not intentional so I've played a bit with this and I hope you'll consider some little change. Currently, if a ZIP archive contains some subdirectories then

[issue4631] urlopen returns extra, spurious bytes

2008-12-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The patch should have at least a test so that we don't have a regression on this one. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4631 ___

[issue4707] round() shows undocumented behaviour

2008-12-21 Thread Daniel Diniz
Daniel Diniz aja...@gmail.com added the comment: Hi Mark, I think there's an overflow for ndigits that predates your patch: round(2, -2**31 +1) 2 round(2, -2**31 +2) nan (it looks like these lines above make 2.6 hang :/) Now, I'm getting a segfault in 3.0 when Ctrl + C-ing during a long

[issue4707] round() shows undocumented behaviour

2008-12-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: round(2, -2**31 + 2) # Press Ctrl + C Segmentation fault (backtrace below) Thanks, Daniel. It looks like I messed up the refcounting in the error- handling section of the code. I'll fix this. I don't think the hang itself should be

[issue4707] round() shows undocumented behaviour

2008-12-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Cause of segfault was doing Py_XDECREF on a pointer that hadn't been initialised to NULL. Here's a fixed patch. I still get the instant result: round(2, -2**31+1) 2 which is a little odd. It's the correct result, but I can't see how it

[issue4707] round() shows undocumented behaviour

2008-12-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Aha. The special result for round(x, 1-2**31) has nothing to do with this particular patch. It's a consequence of: #define UNDEF_NDIGITS (-0x7fff) /* Unlikely ndigits value */ in bltinmodule.c. The same behaviour results for all

[issue4707] round() shows undocumented behaviour

2008-12-21 Thread Daniel Diniz
Daniel Diniz aja...@gmail.com added the comment: Mark Dickinson rep...@bugs.python.org wrote: I don't think the hang itself should be considered a bug, any more than the hang from 10**(2**31-1) is a bug. Well, besides the fact that you can stop 10**(2**31-1) with Ctrl+C but not round(2,

[issue4707] round() shows undocumented behaviour

2008-12-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: [Me] which is a little odd. It's the correct result, but I can't see how [Daniel] Is it correct? No. :-) It should be 0, as you say. Given that round(2, 2**31) throws an OverflowError I think this is wrong, too. It should be 2. It's

[issue4711] Wide literals in the table of contents overflow in documentation

2008-12-21 Thread Scott Dial
New submission from Scott Dial sc...@scottdial.com: There is a problem with the table contents with respect to literals that cannot be word-wrapped. I see this issue here: http://docs.python.org/dev/2.6/library/multiprocessing.html The line in the table of contents that reads The

[issue4666] test_bad_address in test_urllib2_localnet often fails

2008-12-21 Thread Roumen Petrov
Roumen Petrov bugtr...@roumenpetrov.info added the comment: Tests (trunk 21 dec 2008) fail as before (i.e. test_curses, test_urllib2_localnet and test_urllibnet) but now test_smtplib fail too. Single test always succeed as example: $ echo test_smtplib /tmp/pynexttest $ ./python -E -tt

[issue1712522] urllib.quote throws exception on Unicode URL

2008-12-21 Thread Valery
Valery khame...@gmail.com added the comment: Hi, gurus, can anyone then give a hint what we mortals should use in order to form the URL with non-ascii symbols? We loved so much idea to feed our national symbols to urllib.quote as unicode string... and now we are quite disoriented... Thanks

[issue4712] Document pickle behavior for subclasses of dicts/lists

2008-12-21 Thread Georg Brandl
New submission from Georg Brandl ge...@python.org: When unpickling dict subclasses, the dict is filled via setitem before __setstate__ is called. This, and other behavior around subclasses of classes that have special pickle behavior should be documented. -- assignee: georg.brandl

[issue1712522] urllib.quote throws exception on Unicode URL

2008-12-21 Thread Valery
Valery khame...@gmail.com added the comment: (self-answer to msg78153) the working recipe is: http://www.nabble.com/Re:-Problem:-neither-urllib2.quote-nor- urllib.quote-encode-the--unicode-strings-arguments-p19823144.html ___ Python tracker

[issue4713] Installing sgmlop can crash xmlrpclib

2008-12-21 Thread Christoph Zwerschke
New submission from Christoph Zwerschke c...@online.de: If you install sgmlop (downloadable from http://effbot.org/downloads/#sgmlop) under Python 2.x, then this can break xmlrpclib. You can reproduce this problem as follows (I have tested with Py 2.4, 2.5 and 2.6): data = ?xml

[issue4713] Installing sgmlop can crash xmlrpclib

2008-12-21 Thread Christoph Zwerschke
Changes by Christoph Zwerschke c...@online.de: -- keywords: +patch Added file: http://bugs.python.org/file12418/xmlrpclib.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4713 ___

[issue4714] print opcode stats at the end of pybench runs

2008-12-21 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: This patch prints opcode statistics at the end of a pybench run if DYNAMIC_EXECUTION_PROFILE has been enabled when compiling the interpreter. Is it ok? Is it better to add it to the Benchmark class? -- components: Demos and Tools

[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly

2008-12-21 Thread Koen van de Sande
Koen van de Sande k...@tibed.net added the comment: I'm no expert, but is it possible for ZIP files to have Windows-style path seperators ('\') as well? And is this new behavior desirable for existing code as well? It might break existing applications, so perhaps a new extractrecursive()

[issue4715] optimize bytecode for conditional branches

2008-12-21 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: This patch optimizes the bytecode for conditional branches. For example, the list comprehension [x for x in l if not x] produced the following bytecode: 1 0 BUILD_LIST 0 3 LOAD_FAST0 (.0)

[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly

2008-12-21 Thread Kuba Wieczorek
Kuba Wieczorek faw...@gmail.com added the comment: I'm not sure if it would make sense to save current extract()/extractall() behaviour and implement new with another function because current one is simply faulty. And if it's about BC breaks then well... it may be introduced in 3.0 line, I think

[issue1706039] Added clearerr() to clear EOF state

2008-12-21 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Unfortunately, the patch is broken. The program fname='test123' f=open(fname,'w') f.read() crashes with the patch applied. I think I will revert the patch in 2.5.3, release 2.5.4, and reject the patch.

[issue1706039] Added clearerr() to clear EOF state

2008-12-21 Thread Guilherme Polo
Guilherme Polo ggp...@gmail.com added the comment: It isn't being careful when calling PyErr_SetFromErrno inside the Py_UniversalNewlineFread function since this function is being called all over fileobject after releasing the GIL.. so, isn't this just a matter of adding pairs of

[issue1706039] Added clearerr() to clear EOF state

2008-12-21 Thread Guilherme Polo
Guilherme Polo ggp...@gmail.com added the comment: On Sun, Dec 21, 2008 at 9:52 PM, Martin v. Löwis rep...@bugs.python.org wrote: Martin v. Löwis mar...@v.loewis.de added the comment: It isn't being careful when calling PyErr_SetFromErrno inside the Py_UniversalNewlineFread function since

[issue4715] optimize bytecode for conditional branches

2008-12-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Here is an optional patch which provides the two opcodes I was talking about (I've called them POP_OR_JUMP and JUMP_OR_POP). Together with a bit of work on the peepholer they make the bytecode expression of boolean calculations very concise. A

[issue3297] Python interpreter uses Unicode surrogate pairs only before the pyc is created

2008-12-21 Thread hippietrail
Changes by hippietrail hippytr...@gmail.com: -- nosy: +hippietrail ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3297 ___ ___ Python-bugs-list

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

2008-12-21 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: From the thread in c.l.p: Pros (of changing os.pipe() to return inheritable pipes): - as it isn't explicitely documented whether os.pipe() returns inheritable pipes or not, both versions are right according to the documentation.