[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: Committed revision 58466. Fingers crossed. -- resolution: - accepted status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1272 __

[issue1130] Idle - Save (buffer) - closes IDLE and does not save file (Windows XP)

2007-10-15 Thread Kurt B. Kaiser
Kurt B. Kaiser added the comment: I caught the first part, but not the second using GNU/Linux. I think that eol_convention can be a class variable, since os.linesep isn't going to change from file to file. Thanks for the report! r58465. __ Tracker [EMAIL

[issue1643641] Fix Bug 1362475 Text.edit_modified() doesn't work

2007-10-15 Thread Georg Brandl
Changes by Georg Brandl: -- resolution: - duplicate status: open - closed superseder: - Text.edit_modified() fails _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1643641 _

[issue1074462] Irregular behavior of datetime.__str__()

2007-10-15 Thread Zooko O'Whielacronx
Zooko O'Whielacronx added the comment: Here is a note for the next person who comes to this ticket wondering why isoformat() exhibits this slightly un-Pythonic behavior. If you want to use isoformat() to produce, for example, timestamps for your logfiles, you'll need to do something like the

[issue1031213] Use correct encoding for printing SyntaxErrors

2007-10-15 Thread atsuo ishimoto
atsuo ishimoto added the comment: That's fine with me. Please replace PyErr_Print() with PyErr_Clear(). _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1031213 _ ___

[issue1074462] Irregular behavior of datetime.__str__()

2007-10-15 Thread Skip Montanaro
Skip Montanaro added the comment: Zooko Here is a note for the next person who comes to this ticket Zooko wondering why isoformat() exhibits this slightly un-Pythonic Zooko behavior. What are you referring to, that it doesn't display any microseconds when the microsecond field happens

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

2007-10-15 Thread Thomas Lee
Thomas Lee added the comment: Hack to make Python/codecs.c use Unicode strings internally. I recognize the way I have fixed it here is probably not ideal (basically ripped out PyString_*, replaced with a PyMem_Malloc/PyMem_Free call) but it fixes 10-12 tests that were failing with my earlier

[issue1279] os.system() oddity under Windows XP SP2

2007-10-15 Thread Stefan Sonnenberg-Carstens
New submission from Stefan Sonnenberg-Carstens: When doing such os.system(a command wich writes a outfile) f = open(the file the command before wrote) the file is empty. If I do this: os.popen(a command wich writes a outfile) f = open(the file the command before wrote) everything is fine

[issue1074462] Irregular behavior of datetime.__str__()

2007-10-15 Thread Zooko O'Whielacronx
Zooko O'Whielacronx added the comment: I meant that it special-cases .microseconds == 0. If I want to produce a custom output format using Python Standard Library, I expect to have to slice, add my own fields and so forth, but I don't expect to need an if to handle a special-case that is there

[issue1279] os.system() oddity under Windows XP SP2

2007-10-15 Thread Tim Golden
Tim Golden added the comment: Not, apparently, on my (XP SP2) box: dump Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import os os.system (python -c f=open

[issue1074462] Irregular behavior of datetime.__str__()

2007-10-15 Thread Skip Montanaro
Skip Montanaro added the comment: Zooko I meant that it special-cases .microseconds == 0. Tim indicated in his comment that the behavior is both by design and documented and isn't going to change. In an earlier comment I showed how to achieve the result you ased for in one line. Here's

[issue1280] PEP 3137: Make PyString's indexing and iteration return integers

2007-10-15 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti: Here a preliminary patch to make PyString return integers on indexing and iteration. There is still quite a few XXX in the patch, that I would like to fix. However, the good thing is all tests passes. -- components: Interpreter Core files:

[issue1074462] Irregular behavior of datetime.__str__()

2007-10-15 Thread Zooko O'Whielacronx
Zooko O'Whielacronx added the comment: Thank you for the one-liner. I was about to use it in the allmydata.org project, but I remembered that my programming partner would probably prefer the larger but more explicit if:else: over the clever one-liner. Perhaps it will be useful to someone else.

[issue1258] Removal of basestring type

2007-10-15 Thread Christian Heimes
Christian Heimes added the comment: Here is an updated patch which applies cleanly and fixes some additional unit tests and removes one that doesn't make sense any more (re.compile doesn't accept bytes). The unit tests profile, cProfile and doctest fail w/ and w/o this patch. They seem to

[issue1031213] Use correct encoding for printing SyntaxErrors

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: atsuo ishimoto added the comment: That's fine with me. Please replace PyErr_Print() with PyErr_Clear(). Done. Committed revision 58471. _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1031213

[issue1258] Removal of basestring type

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: Hm? This is a one-word patch to email/generator.py. On 10/15/07, Christian Heimes [EMAIL PROTECTED] wrote: Christian Heimes added the comment: Here is an updated patch which applies cleanly and fixes some additional unit tests and removes one that

[issue1253] IDLE - Percolator overhaul

2007-10-15 Thread Kurt B. Kaiser
Kurt B. Kaiser added the comment: Thanks for the patch, it will definitely be applied once I finish reviewing it! Good job splitting off TkTextPercolator and inheriting from Delegator. -- assignee: - kbk priority: - normal __ Tracker [EMAIL PROTECTED]

[issue1280] PEP 3137: Make PyString's indexing and iteration return integers

2007-10-15 Thread Martin v. Löwis
Changes by Martin v. Löwis: -- keywords: +patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1280 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1276] LookupError: unknown encoding: X-MAC-JAPANESE

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: Marc-Andre, do you understand this issue? Your name is in Tools/unicode/Makefile; the patch deletes the line $(RM) build/mac_japanese.* from the apple target, which seems rather arbitrary. -- assignee: - lemburg nosy: +gvanrossum, lemburg

[issue1277] mailbox.Maildir: factory not used

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: Patch please? -- nosy: +gvanrossum __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1277 __ ___ Python-bugs-list mailing list

[issue1278] imp.find_module() ignores -*- coding: Latin-1 -*-

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: Can you suggest a patch? Adding Brett Cannon to the list, possibly his import-in-python would supersede this? -- nosy: +brett.cannon, gvanrossum __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1278

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

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: I'll look at this at some point. One quick comment: the lnotab and bytecode should use PyString, which will be 'bytes' in 3.0a2. They must be immutable because code objects must be immutable (it must not be possible to modify an existing code object). On

[issue1278] imp.find_module() ignores -*- coding: Latin-1 -*-

2007-10-15 Thread Christian Heimes
Christian Heimes added the comment: Can you suggest a patch? Adding Brett Cannon to the list, possibly his import-in-python would supersede this? No, I can't suggest a patch. I don't know how we could get the encoding from the tokenizer or AST. Brett is obviously the best man to fix the

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-15 Thread Bill Janssen
Bill Janssen added the comment: Perhaps we shouldn't expose this at the application level. We could check, in the C module's sslwrap, whether the socket is blocking or not, and do the right thing there, so that sslwrap would always succeed in one call. Since we are releasing the GIL

[issue1276] LookupError: unknown encoding: X-MAC-JAPANESE

2007-10-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: My name appears in that Makefile because I wrote it and used it to create the charmap codecs. The reason why the Mac Japanese codec was not created for 2.x was the size of the mapping table. Ideal would be to have the C version of the CJK codecs support

[issue1276] LookupError: unknown encoding: X-MAC-JAPANESE

2007-10-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Adding Python 2.6 as version target. -- versions: +Python 2.6 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1276 __ ___

[issue1278] imp.find_module() ignores -*- coding: Latin-1 -*-

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: No, I can't suggest a patch. I don't know how we could get the encoding from the tokenizer or AST. Try harder. :-) Look at the code that accomplishes this feat in the regular parser... __ Tracker [EMAIL PROTECTED]

[issue1278] imp.find_module() ignores -*- coding: Latin-1 -*-

2007-10-15 Thread Christian Heimes
Christian Heimes added the comment: Try harder. :-) Look at the code that accomplishes this feat in the regular parser... I've already found the methods that find the encoding in Parser/tokenizer.c: check_coding_spec() and friends. But it seems like a waste of time to use

[issue1281] type in docutmentatio section 14.3.3.4

2007-10-15 Thread Ben Sherman
New submission from Ben Sherman: If, a little later on, -tracks=4 is seen, it does: options.tracks.append(int(4)) That should read --tracks=4, not -tracks=4 Found at http://docs.python.org/lib/optparse-standard-option-actions.html -- components: Documentation messages: 56460 nosy:

[issue1278] imp.find_module() ignores -*- coding: Latin-1 -*-

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: Call PyTokenizer_Get until the line number is 2? On 10/15/07, Christian Heimes [EMAIL PROTECTED] wrote: Christian Heimes added the comment: Try harder. :-) Look at the code that accomplishes this feat in the regular parser... I've already found the

[issue1278] imp.find_module() ignores -*- coding: Latin-1 -*-

2007-10-15 Thread Brett Cannon
Brett Cannon added the comment: No, my work has the exact same problem. Actually, this bug report has confirmed for me why heapq could not be imported when I accidentally forced all open text files to use UTF-8. I just have not gotten around to trying to solve this issue yet. But since

[issue1281] type in docutmentation - lib ref section 14.3.3.4

2007-10-15 Thread Ben Sherman
Ben Sherman added the comment: Typos corrected. -- title: type in docutmentatio section 14.3.3.4 - type in docutmentation - lib ref section 14.3.3.4 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1281 __

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

2007-10-15 Thread Christian Heimes
Christian Heimes added the comment: I've some code around which sets sys.stdin, out and err in C code. The code is far from perfect and I haven't checked it for reference leaks yet. I like to get your comment on the style and error catching. -- nosy: +tiran

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

2007-10-15 Thread Brett Cannon
Changes by Brett Cannon: -- assignee: - brett.cannon keywords: +patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1267 __ ___ Python-bugs-list mailing list

[issue1261] PEP 3137: make bytesobject.c methods

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: Is it worth my time to review this yet? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1261 __ ___ Python-bugs-list mailing list

[issue1258] Removal of basestring type

2007-10-15 Thread Guido van Rossum
Changes by Guido van Rossum: __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1258 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1258] Removal of basestring type

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: The unit tests profile, cProfile and doctest fail w/ and w/o this patch. They seem to suffer from the latest changes of our previous patch and additional calls to utf_8_decode(). Any details on those? They don't fail for me.

[issue1261] PEP 3137: make bytesobject.c methods

2007-10-15 Thread Gregory P. Smith
Changes by Gregory P. Smith: __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1261 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1258] Removal of basestring type

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: I'll check this in as soon as there's agreement on the list about this. Not that I expect disagreement, but I just realized it was never brought up and it isn't in PEP 3137 (yet). __ Tracker [EMAIL PROTECTED]

[issue1258] Removal of basestring type

2007-10-15 Thread Christian Heimes
Christian Heimes added the comment: Any details on those? They don't fail for me. Here you are. $ ./python Lib/test/test_cProfile.py 121 function calls (101 primitive calls) in 1.000 CPU seconds Ordered by: standard name ncalls tottime percall cumtime percall

[issue1258] Removal of basestring type

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: BTW we need a 2to3 fixer for this. Should be trivial -- just replace *all* occurrences of basestring with str. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1258 __

[issue1282] re module needs to support bytes / memoryview well

2007-10-15 Thread Guido van Rossum
New submission from Guido van Rossum: Once PEP 3137 is fully implemented, the re module needs to be fixed so that the regex argument, the substitution argument, and the argument being searched/replaced are allowed to be arbitrary bytes arrays; where hashing is needed a copy in an immutable bytes

[issue1258] Removal of basestring type

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: Even before this patch, the re module doesn't work very well on byte strings. IMO this should be fixed. I've filed a separate bug to remind us: bug 1282. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1258

[issue1258] Removal of basestring type

2007-10-15 Thread Christian Heimes
Christian Heimes added the comment: Guido van Rossum wrote: BTW we need a 2to3 fixer for this. Should be trivial -- just replace *all* occurrences of basestring with str. I believe you that it's trivial for *you* but I've never dealt with the fixers or the grammar. Fortunately for me I was

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-15 Thread Chris Stawarz
Chris Stawarz added the comment: Bill, You seem to be missing the whole point of doing non-blocking I/O, which is to handle multiple concurrent, I/O-bound tasks in a single OS thread. The application must be able to try the handshake, detect that it didn't complete because I/O needs to

[issue1261] PEP 3137: make bytesobject.c methods

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: Very impressive! (Apologies if these lines are occasionally out of order.) +extern PyObject* _bytes_isspace(const char *cptr, const Py_ssize_t len); IMO all these functions should have names starting with _Py or _Py_, since they are visible to the linker.

[issue1283] PyBytes (buffer) .extend method needs to accept any iterable of ints

2007-10-15 Thread Gregory P. Smith
New submission from Gregory P. Smith: The PyBytes (pep3137 buffer) .extend() method currently only accepts as input something supporting the pep3118 buffer API. It also needs to accept an iterable of ints in the 0..255 range. -- keywords: py3k messages: 56478 nosy: gregory.p.smith

[issue1261] PEP 3137: make bytesobject.c methods

2007-10-15 Thread Gregory P. Smith
Changes by Gregory P. Smith: __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1261 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1261] PEP 3137: make bytesobject.c methods

2007-10-15 Thread Gregory P. Smith
Changes by Gregory P. Smith: __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1261 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1284] typo in lib doc 7.3.2.1 MaildirMessage

2007-10-15 Thread Eric Wollesen
New submission from Eric Wollesen: get_subdir( ) Return either new (if the message should be stored in the new subdirectory) or cur (if the message should be stored in the cur subdirectory). Note: A message is typically moved from new to cur after its mailbox has been accessed, whether

[issue1278] imp.find_module() ignores -*- coding: Latin-1 -*-

2007-10-15 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti: -- nosy: +alexandre.vassalotti __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1278 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1272] Decode __file__ and co_filename to unicode using fs default

2007-10-15 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: I wrote in msg56419: It is not perfect, since the extra function calls in the codecs module causes test_profile and test_doctest to fail. How this was resolved? __ Tracker [EMAIL PROTECTED]

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

2007-10-15 Thread Christian Heimes
Christian Heimes added the comment: I've carefully checked and tested the initstdio() method. I'm sure that I've catched every edged case. The unit tests pass w/o complains. I've also added a PyErr_Display() call to Py_FatalError(). It's still hard to understand an error in io.py but at least

[issue1251] ssl module doesn't support non-blocking handshakes

2007-10-15 Thread Bill Janssen
Bill Janssen added the comment: You seem to be missing the whole point of doing non-blocking I/O, You know, I think that's right. I'm so used to using threads by now that the whole select-based approach seems very odd to me by now. OK, I've folded your patch into the PyPI version, ssl 1.8.

[issue1261] PEP 3137: make bytesobject.c methods

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: Good! Check it in before I change my mind. :-) The words can be tweaked later. 04b is the same as 04, i just fixed the docstrings that i had missed in stringlib/transmogrify.h to use 'B' instead of 'S' and say they return a modified copy of B instead of a

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

2007-10-15 Thread Guido van Rossum
Guido van Rossum added the comment: I've carefully checked and tested the initstdio() method. I'm sure that I've catched every edged case. The unit tests pass w/o complains. I've also added a PyErr_Display() call to Py_FatalError(). It's still hard to understand an error in io.py but at

[issue1259] string find and rfind methods give a TypeError that is misleading

2007-10-15 Thread Robert Collins
Robert Collins added the comment: The error message is wrong: it's a TypeError, but the message should say something like... TypeError: slice indices must be integers or have an __index__ method This would be a false message, as, as my report demonstrated, slice indices *can* be None.

[issue1663329] subprocess/popen close_fds perform poor if SC_OPEN_MAX is hi

2007-10-15 Thread Mike Klaas
Mike Klaas added the comment: This problem has also afflicted us. Attached is a patch which adds closerange(fd_low, fd_high) to the posix (and consequently os) module, and modifies subprocess to use it. Patch is against trunk but should work for 2.5maint. I don't really think that this is

[issue1663329] subprocess/popen close_fds perform poor if SC_OPEN_MAX is hi

2007-10-15 Thread Mike Klaas
Mike Klaas added the comment: I see that some spaces crept in to the patch. I can fix that (and perhaps rename the function to start with an underscore) if desired. _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1663329

[issue1663329] subprocess/popen close_fds perform poor if SC_OPEN_MAX is hi

2007-10-15 Thread Mike Klaas
Mike Klaas added the comment: Finally, I did not include any platform-specific optimizations, as I don't have AIX or solaris boxes on which to test them (and they can easily be added later). An order-mag speedup on all *nix platforms is a good start. _

[issue1663329] subprocess/popen close_fds perform poor if SC_OPEN_MAX is hi

2007-10-15 Thread Martin v. Löwis
Changes by Martin v. Löwis: -- keywords: +patch _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1663329 _ ___ Python-bugs-list mailing list Unsubscribe:

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

2007-10-15 Thread Christian Heimes
Christian Heimes added the comment: Guido van Rossum wrote: Don't call open() with keyword arg for newline=\r; open() takes positional args too. This is done specifically to simplify life for C code calling it. :-) Perhaps one of the PyFunction_Call(..) variants makes it easier to call it

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

2007-10-15 Thread Christian Heimes
Christian Heimes added the comment: The patch is a combined patch for the imp.find_module() problem and initstdio. Both patches depend on the new PyFile_FromFileEx() function. I hope you don't mind. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1267