[issue1267] Py3K cannot run as ``python -S``

2007-10-20 Thread Christian Heimes
Christian Heimes added the comment: > I think find_module() should return a file descriptor (fd), not a > FILE*, but most of the rest of the code should call fdopen() on that > fd. Only call_find_module() should use the fd to turn it into a Python > file object. Then the amount of change should b

[issue1302] Fixes for profile/cprofile

2007-10-20 Thread Christian Heimes
Christian Heimes added the comment: The new patch does a far more better job. I had the idea after a discussion with Alexandre on #python and a small debugging session. The tests for profile, cProfile and doctest are failing on my Linux box because Py_FileSystemDefaultEncoding is "UTF-8" but PyU

[issue1307] smtpd.SMTPServer throws exception on MAIL command with no arg

2007-10-20 Thread Derek Shockey
Derek Shockey added the comment: Very simple patch that adds a ternary operator to skip the call to __getaddr if there is no arg. Added file: http://bugs.python.org/file8583/smtpd.diff __ Tracker <[EMAIL PROTECTED]> ___

[issue1263] PEP 3137 patch - str8/str comparison should return false

2007-10-20 Thread Brett Cannon
Brett Cannon added the comment: Attached is a fix for test_subprocess. Simply had to change a call to str8() to str(). I am going to run the test suite, but that should leave only test_struct failing and that can be fixed as soon as Guido makes a call on whether str8 or str should be used for t

[issue1263] PEP 3137 patch - str8/str comparison should return false

2007-10-20 Thread Brett Cannon
Brett Cannon added the comment: Guido, what do you want to do about the struct module for the various string formats (i.e., c, s, p)? Should they return str8 or Unicode? __ Tracker <[EMAIL PROTECTED]> ___

[issue1263] PEP 3137 patch - str8/str comparison should return false

2007-10-20 Thread Brett Cannon
Brett Cannon added the comment: Attached is a patch to fix test_str. Basically there were a bunch of redundant tests for making sure that calling str() on an object called it's __str__ method. str8 no longer is directly relevant since it is no longer an actual string type. Added file: http://b

[issue1307] smtpd.SMTPServer throws exception on MAIL command with no arg

2007-10-20 Thread Derek Shockey
New submission from Derek Shockey: smtpd.SMTPChannel contains a bug such that when connected to an SMTPServer (or any subclass thereof), issuing a MAIL command with no argument closes the socket and gives this error on the server: (:'NoneType' object is unsubscriptable ... smtpd.py|__getaddr|

[issue1263] PEP 3137 patch - str8/str comparison should return false

2007-10-20 Thread Brett Cannon
Brett Cannon added the comment: Attached is a fix for sqlite3. First issue was that the dictionary that was being used to store converters was having keys in Python code as Unicode but being compared against str8 in C. The second issue was that when an object was serialized using __conform__ an

[issue1263] PEP 3137 patch - str8/str comparison should return false

2007-10-20 Thread Brett Cannon
Brett Cannon added the comment: Attached is a fix for modulefinder. It is an ugly hack as modulefinder took the numeric opcode numbers from dis and passed them to chr(). But that doesn't work since that returns Unicode. So I took those single characters and passed them to str8(). Once str8()

[issue1267] Py3K cannot run as ``python -S``

2007-10-20 Thread Guido van Rossum
Guido van Rossum added the comment: > Is PyFile_FromFd and PyFile_FromFdEx fine with you or do you prefer a > different name like PyFile_FromFD and PyFile_FromFDEx or > PyFile_FromFileDescriptor? Let's have a single function PyFile_FromFd(fd, name, mode, buffering, encoding, newline). > I've an

[issue1267] Py3K cannot run as ``python -S``

2007-10-20 Thread Christian Heimes
Christian Heimes added the comment: > The dangers of switching between fileno(fp) and fp are actually well > documented in the C and/or POSIX standards. The problem is caused in > PyFile_FromFileEx() -- it creates a Python file object from the file > descriptor. The fix actually only works becaus

[issue1267] Py3K cannot run as ``python -S``

2007-10-20 Thread Christian Heimes
Christian Heimes added the comment: Guido van Rossum wrote: > I think find_module() should return a file descriptor (fd), not a > FILE*, but most of the rest of the code should call fdopen() on that > fd. Only call_find_module() should use the fd to turn it into a Python > file object. Then the a

[issue1267] Py3K cannot run as ``python -S``

2007-10-20 Thread Guido van Rossum
Guido van Rossum added the comment: > Guido, Brett, how much of the code should I change? import.c is mainly > using file pointers. Should I replace all operations on FILE with > operations on a file descriptor? I think find_module() should return a file descriptor (fd), not a FILE*, but most of

[issue1267] Py3K cannot run as ``python -S``

2007-10-20 Thread Christian Heimes
Christian Heimes added the comment: > Yes, I think you got it. Guido, Brett, how much of the code should I change? import.c is mainly using file pointers. Should I replace all operations on FILE with operations on a file descriptor? Christian __ Tracker <[EMAIL

[issue1267] Py3K cannot run as ``python -S``

2007-10-20 Thread Brett Cannon
Brett Cannon added the comment: On 10/20/07, Christian Heimes <[EMAIL PROTECTED]> wrote: > > Christian Heimes added the comment: > > Guido van Rossum wrote: > > You're right that a lot of this could be avoided if we used file > > descriptors consistently. It seems find_module() itself doesn't rea

[issue1267] Py3K cannot run as ``python -S``

2007-10-20 Thread Christian Heimes
Christian Heimes added the comment: Guido van Rossum wrote: > You're right that a lot of this could be avoided if we used file > descriptors consistently. It seems find_module() itself doesn't read > the file; it just needs to know that it's possible to open the file. > > Rewriting everywhere th

[issue1294] Management of KeyboardInterrupt in cmd.py

2007-10-20 Thread BULOT
BULOT added the comment: Well, I made it with a diff -ruN, it works fine on my ubuntu. It is only a ctrl-C management only, not a ctrl-D. What do you mean by broken? Regards. Stephbul 2007/10/19, Guido van Rossum <[EMAIL PROTECTED]>: > > > Guido van Rossum added the comment: > > Hmm... I don't

[issue1267] Py3K cannot run as ``python -S``

2007-10-20 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, I was wrong about the encoding leak; you fixed that. The FILE/fd issue is real though. __ Tracker <[EMAIL PROTECTED]> __ _

[issue1267] Py3K cannot run as ``python -S``

2007-10-20 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for persevering!!! The dangers of switching between fileno(fp) and fp are actually well documented in the C and/or POSIX standards. The problem is caused in PyFile_FromFileEx() -- it creates a Python file object from the file descriptor. The fix actuall

[issue1306] Embedded python reinitialization

2007-10-20 Thread Karemir
New submission from Karemir: Hi, I'm embedding stackless python in a c++ application under linux. When I try to Finalize and Initialize again, I'm getting errors. this is a sample code that doesn't work: int main() { Py_Initialize(); Py_Finalize(); Py_Initialize();

[issue1061] ABC caches should use weak refs

2007-10-20 Thread Georg Brandl
Georg Brandl added the comment: Attaching a new patch; this one passes regrtest -R:: of test_io without apparent reference leaks. -- assignee: georg.brandl -> gvanrossum Added file: http://bugs.python.org/file8577/wr.diff __ Tracker <[EMAIL PROTECTED]>