[issue4117] missing update() in _Screen.setup() of Lib/turtle.py

2008-10-13 Thread Gregor Lingl
Gregor Lingl <[EMAIL PROTECTED]> added the comment: This patch applies to Python 2.6 as well Gregor -- versions: +Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4116] name conflict in ScrolledCanvas.__init__() in Lib/turtle.py

2008-10-13 Thread Gregor Lingl
Gregor Lingl <[EMAIL PROTECTED]> added the comment: This patch applies to Python 2.6 as well Gregor -- versions: +Python 2.6 ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4119] ssl wrapper: add makefile() method

2008-10-13 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: Ooops, ssl already has a makefile() method from socket object! I was confused because of the Python 2.6 version of socket module... -- resolution: -> invalid status: open -> closed ___ Python tra

[issue3727] poplib module broken by str to unicode conversion

2008-10-13 Thread STINNER Victor
Changes by STINNER Victor <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file11781/poplib_unicode-4.patch ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3727] poplib module broken by str to unicode conversion

2008-10-13 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: @giampaolo.rodola: Right, I also prefer encoding as a class attribute. So I wrote a new patch: - encoding is now a class attribute - continue SSL code factorization: SSL code is now around 10 lines instead of 70 lines! Added file: http://

[issue3727] poplib module broken by str to unicode conversion

2008-10-13 Thread STINNER Victor
Changes by STINNER Victor <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file11780/poplib_unicode-3.patch ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3727] poplib module broken by str to unicode conversion

2008-10-13 Thread STINNER Victor
Changes by STINNER Victor <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file11778/poplib_unicode-2.patch ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3727] poplib module broken by str to unicode conversion

2008-10-13 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: New version: - remove duplicate methods of POP3_SSL() - use makefile('r', encoding=self.encoding) to get a nice text wrapper with universal newline - remove newline conversion (done by TextIOWrapper) Finally my patch removes more code in

[issue3727] poplib module broken by str to unicode conversion

2008-10-13 Thread Giampaolo Rodola'
Giampaolo Rodola' <[EMAIL PROTECTED]> added the comment: I haven't tried the patch but I think that "encoding" should be a class attribute as it is in ftplib and similar py3k network related modules. ___ Python tracker <[EMAIL PROTECTED]>

[issue4119] ssl wrapper: add makefile() method

2008-10-13 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- assignee: -> janssen nosy: +janssen ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue3727] poplib module broken by str to unicode conversion

2008-10-13 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: New version: - fix SSL: self.file contains the SSL socket and not the raw socket! - upgrade test_poplib.py from Python trunk poplib should be refactored to reuse the new IO library. But I don't know how to build a TextIO wrapper for a sock

[issue4119] ssl wrapper: add makefile() method

2008-10-13 Thread STINNER Victor
New submission from STINNER Victor <[EMAIL PROTECTED]>: ssl module of Python 2.6 has a makefile() method whereas Python3 has not. Attached patch fix this issue. There a just a difference between Python2 and Python3 makefile() method: Python3 has not bufsize optional argument because SocketIO()

[issue1479099] 'compile' built-in function failures when missing EOL

2008-10-13 Thread Terry J. Reedy
Terry J. Reedy <[EMAIL PROTECTED]> added the comment: As near as I can tell, for 2.5.2 and 3.0c1, the limitation on compile only applies when the last line only contains a comment. >>> print (compile("def f():\n pass #haha",'','exec')) at 00AADAD0, file "", line 1> >>> print (compile("def f()

[issue4118] Built-in compile() and ast module doc issues

2008-10-13 Thread Terry J. Reedy
New submission from Terry J. Reedy <[EMAIL PROTECTED]>: >From docs.python.org 2.6: Compile the source into a code or AST object. 3.0: Compile the source into a code object. Add 'or AST ' to the latter. Both: Refer to the _ast module documentation Both: for information on how to compile into an

[issue3727] poplib module broken by str to unicode conversion

2008-10-13 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: Ooops, my previous patch was wrong (startswith => not startswith). I tested python trunk test for poplib: with minor changes, all tests are ok except tests using SSL. I get a "select.error: (9, 'Bad file descriptor')" from asyncore. So I tr

[issue4117] missing update() in _Screen.setup() of Lib/turtle.py

2008-10-13 Thread Gregor Lingl
New submission from Gregor Lingl <[EMAIL PROTECTED]>: In Lib/turtle.py _Screen.setup() needs a final update() call in order to ensure, that immediately following calls of window_width() or window_height() return correct values. Consequently the setup() method call in _Screen.__init__() has to t

[issue3727] poplib module broken by str to unicode conversion

2008-10-13 Thread STINNER Victor
Changes by STINNER Victor <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file11775/poplib_unicode.patch ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue4116] name conflict in ScrolledCanvas.__init__() in Lib/turtle.py

2008-10-13 Thread Gregor Lingl
New submission from Gregor Lingl <[EMAIL PROTECTED]>: In ScrolledCanvas.__init__() there's a name conflict with a methodname of the parentclass Frame: _root. The bugfix consists in renaming this attribute, which occurs only twice. No change in behaviour at all. Regards, Gregor -- compo

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: > Don't hesitate to reopen the bug if you consider that > something should be fixed in Python. I agree that it should be closed; people should read general CS introductory material to learn how floating point numbers work. > @loewis: Yes, t

[issue4115] split() method

2008-10-13 Thread Terry Scott
Terry Scott <[EMAIL PROTECTED]> added the comment: Benjamin, Thanks. The documentation cleared this up for me. Thanks. Terry On Mon, 13 Oct 2008, Benjamin Peterson wrote: > > Changes by Benjamin Peterson <[EMAIL PROTECTED]>: > > > -- > resolution: -> invalid > status: open -> closed

[issue4115] split() method

2008-10-13 Thread Terry Scott
Terry Scott <[EMAIL PROTECTED]> added the comment: Tim, Duh, thanks sorry I didn't check the documentation. Thanks. Terry On Mon, 13 Oct 2008, Tim Gordon wrote: > > Tim Gordon <[EMAIL PROTECTED]> added the comment: > > This is the intended behaviour. See > http://www.python.org/doc/2.5.2/lib

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: @loewis: Yes, the initial problem is about unpack("f", bytes). It's not possible to exact original 32 bits float value because Python forces a conversion to 64 bits float. The behaviour should be documented. Don't hesitate to reopen the bug

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: > "Python is just reflecting what C is doing": the problem is deeper in > the silicium. If you want a better precision, use an arbitrary > precision float type like decimal.Decimal() or the GMP library > (Python: gmpy) The problem is inde

[issue4115] split() method

2008-10-13 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- resolution: -> invalid status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue4115] split() method

2008-10-13 Thread Tim Gordon
Tim Gordon <[EMAIL PROTECTED]> added the comment: This is the intended behaviour. See http://www.python.org/doc/2.5.2/lib/string-methods.html for details. -- nosy: +QuantumTim ___ Python tracker <[EMAIL PROTECTED]>

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: "Since 32 bit floats only have ~7 digits of precision, I expected to get the same thing back. Not 7 digits + garbage." This problem is a well known problem of conversion from base 2 (IEEE float) to base 10 (Python unicode string). Search fo

[issue4115] split() method

2008-10-13 Thread Terry Scott
New submission from Terry Scott <[EMAIL PROTECTED]>: x = "Four score and seven" x.split() => ["Four", "score", "and", "seven"] x.split(" ") => ["Four", "score", " ", "and", "seven"] Probably not a big deal but it seems that it should be consistent. One of my students spotted it. -- c

[issue214033] re incompatibility in sre

2008-10-13 Thread STINNER Victor
Changes by STINNER Victor <[EMAIL PROTECTED]>: -- components: +Regular Expressions -Extension Modules ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread TD22057
TD22057 <[EMAIL PROTECTED]> added the comment: Martin is correct. I expected (naively) that struct would zero pad the digits beyond the significant digits of a float. As to whether it's exact or not, see my first message: >>> v=1.8183e-7 >>> v 1.81830001e-07 Since 32 bit floats only ha

[issue3727] poplib module broken by str to unicode conversion

2008-10-13 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: Here is a patch proposition: - a socket uses bytes - makefile() creates an unicode file using 'r' mode - default encoding ISO-8859-1 because I guess that most servers use this encoding, but you can change the encoding using "encoding" con

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: I think the complaint is that presumably, when expanding the float to double in unpacking, the result is not zero-padded. I cannot reproduce the problem, though: py> hexlify(struct.pack(">d",struct.unpack(">f",struct.pack(">f",1.8183e-7))[0]

[issue2956] 2to3 should have a way to disable some fixers

2008-10-13 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Done in r66885. -- nosy: +benjamin.peterson resolution: -> accepted status: open -> closed ___ Python tracker <[EMAIL PROTECTED]>

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: The problem is not from Python but from your FPU during the conversion from 64 bits float to 32 float (made by struct.pack). Example in C: #include int main() { float f; double d; d = 1.8183; printf("d=%.20f\n", d); f =

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread TD22057
TD22057 <[EMAIL PROTECTED]> added the comment: I'm receiving a 32 bit floating point number encoded in binary format. The correct value for that number is 1.8183e-7 which can be expressed in single precision just fine. Given that the number in the binary encoding is 1.8183e-7, I expected to get

[issue2819] Full precision summation

2008-10-13 Thread STINNER Victor
Changes by STINNER Victor <[EMAIL PROTECTED]>: -- nosy: +haypo ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing l

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: I don't understand your problem/question. It's not a bug of Python, it's a problem of conversion between the types float (32 bits) and double (64 bits). ___ Python tracker <[EMAIL PROTECTED]>

[issue3487] sre "bytecode" verifier

2008-10-13 Thread Jesús Cea Avión
Changes by Jesús Cea Avión <[EMAIL PROTECTED]>: -- nosy: +jcea ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing l

[issue2898] Add memory footprint query

2008-10-13 Thread Jesús Cea Avión
Changes by Jesús Cea Avión <[EMAIL PROTECTED]>: ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue3863] 2.6rc1: test_threading hangs on FreeBSD 6.3 i386

2008-10-13 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Apparently this can be merged in py3k. (in http://www.python.org/dev/buildbot/trunk/x86%20FreeBSD%20trunk/builds/1589/step-test/0 : [...] test_threading [18218 refs] [18576 refs] [17539 refs] [17539 refs] [17539 refs] Skipping test_3_join_i

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread TD22057
TD22057 <[EMAIL PROTECTED]> added the comment: That's not my code - it's an example ;) My code reads binary data from a hardware system that is encoding 32 bit floats. The numbers I get back from struct.decode have garbage appended on the end of the floating point numbers beyond the 32 bit rang

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: Why do you use float (32 bits) instead of double (64 bits)? Your example use: double (python) -> float (C) -> double (python) If you convert 64 bits float to 32 bits, for sure you will loose some digits. It's not a bug in Python, but a pro

[issue4114] struct returns incorrect 4 byte float

2008-10-13 Thread TD22057
New submission from TD22057 <[EMAIL PROTECTED]>: FYI Actual version is 2.5.2 running on Linux RHE4. >>> import struct >>> fmt ='>f' >>> v=1.8183e-7 >>> v 1.81830001e-07 >>> s=struct.pack(fmt,v) >>> struct.unpack(fmt,s) (1.818300034983622e-07,) Looks to me like the float->double conversi

[issue694374] Recursive regular expressions

2008-10-13 Thread Matthew Barnett
Matthew Barnett <[EMAIL PROTECTED]> added the comment: Perl (?number) for calling numbered groups and (?&name) for named groups (Perl also supports (?P>name)). (?R) is equivalent to (?0). It's interesting that the documentation for both Perl and PCRE say that they support (?P>name) because that

[issue1708652] Exact matching

2008-10-13 Thread Tom Lynn
Tom Lynn <[EMAIL PROTECTED]> added the comment: Yes, that's right. The binary aspect of it was something of a red herring, I'm afraid, although I still think that (or parsing in general) is an important use case. The prime motivation it that it's easy to either forget the '\Z' or to use '$' inste

[issue694374] Recursive regular expressions

2008-10-13 Thread Jeffrey C. Jacobs
Jeffrey C. Jacobs <[EMAIL PROTECTED]> added the comment: The PCRE has some interesting suggestions on how the grammar for a recursive regular expressions might work. I am concerned about the use of (?P>name) to call a regexp subexpression as an atomic subroutine. The (? P>name) format has nev

[issue4091] python dll not installed in windows system directory

2008-10-13 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: r61109 became obsolete when I added support for the merge module; here is a patch that fixes this. An installer demonstrating the change is available from http://www.dcl.hpi.uni-potsdam.de/home/loewis/u/python-2.7.14165.msi -- keywo

[issue1708652] Exact matching

2008-10-13 Thread Jeffrey C. Jacobs
Jeffrey C. Jacobs <[EMAIL PROTECTED]> added the comment: Binary format searches should be supported once issue 1282 is implemented, likely as part of issue 2636 Item 32. That said, I'm not clear what you mean by exact search; wouldn't you want match instead? If your main issue is you want so

[issue1456280] Traceback error when compiling Regex

2008-10-13 Thread Jeffrey C. Jacobs
Jeffrey C. Jacobs <[EMAIL PROTECTED]> added the comment: This is another version of the redundant repeat issue defined in issues 2537 and 1633953 and although not described by the original report for issue 214033, the comments further down that issue also describe a similar situation. In this

[issue214033] re incompatibility in sre

2008-10-13 Thread Jeffrey C. Jacobs
Jeffrey C. Jacobs <[EMAIL PROTECTED]> added the comment: The duplicate zero-or-one repeat operator bug described in this issue originally no longer exists in python 2.6. However, Trent Mick brings up a fair point in that expressions of the form (x*)? generate an error (issue 1456280) when inte

[issue1683368] object.__init__ shouldn't allow args/kwds

2008-10-13 Thread Jesús Cea Avión
Changes by Jesús Cea Avión <[EMAIL PROTECTED]>: -- nosy: +jcea ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailin

[issue2819] Full precision summation

2008-10-13 Thread Jesús Cea Avión
Changes by Jesús Cea Avión <[EMAIL PROTECTED]>: -- nosy: +jcea ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing l

[issue1381] cmath is numerically unsound

2008-10-13 Thread Jesús Cea Avión
Changes by Jesús Cea Avión <[EMAIL PROTECTED]>: -- nosy: +jcea ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing l

[issue1878] class attribute cache failure (regression)

2008-10-13 Thread Jesús Cea Avión
Changes by Jesús Cea Avión <[EMAIL PROTECTED]>: -- nosy: +jcea ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing l

[issue1685986] Method cache

2008-10-13 Thread Jesús Cea Avión
Changes by Jesús Cea Avión <[EMAIL PROTECTED]>: -- nosy: +jcea ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailin

[issue4113] functools.partial(), no __name__; wrong __doc__

2008-10-13 Thread Andrew Stribblehill
New submission from Andrew Stribblehill <[EMAIL PROTECTED]>: When I partially apply a function using functools.partial(), the resultant function doesn't have the same name as the original function (it has no __name__) and its docstring is that of functools.partial() rather than that of the functi

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-10-13 Thread Jesús Cea Avión
Changes by Jesús Cea Avión <[EMAIL PROTECTED]>: -- nosy: +jcea ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailin

[issue4018] "for me" installer problem on x64 Vista

2008-10-13 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: Thanks for the confirmation. Committed as r66881, r66882, and r66883. -- resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]>

[issue4112] Subprocess: Popen'ed children hang due to open pipes

2008-10-13 Thread Boye Høverstad
New submission from Boye Høverstad <[EMAIL PROTECTED]>: subprocess.Popen.wait() hangs if you have spawned multiple child processes that do not terminate until their standard input is closed ('cat' is example of such a process). This happens on POSIX platforms. I'm using Python 2.5.1, but I beli

[issue3451] Asymptotically faster divmod and str(long)

2008-10-13 Thread Pernici Mario
Pernici Mario <[EMAIL PROTECTED]> added the comment: In this patch I added to the patch by Mark in issue 3944 the code in the previous patch, modified to release memory in case of exceptions. Benchmark for division on Athlon 64 3800+ with respect to Python3.0: (1) Python with patch 30bit.patch

[issue2751] Regression for executing packages

2008-10-13 Thread Nick Coghlan
Nick Coghlan <[EMAIL PROTECTED]> added the comment: (Adding some additional details regarding the reasons why this became an error again in 2.6) The ImportError when attempting to execute a package was lost during the conversion from the C-based implementation in 2.4 to the runpy module based im

[issue4100] xml.etree.ElementTree does not read xml-text over page bonderies

2008-10-13 Thread roland rehmnert
roland rehmnert <[EMAIL PROTECTED]> added the comment: We had to be careful how we should handle this. http://effbot.org/zone/element-iterparse.htm A note on this site says following : Note: The tree builder and the event generator are not necessarily synchronized; the latter usually lags beh