[issue5390] Item 'Python x.x.x' in Add/Remove Programs list still lacks an icon

2009-02-27 Thread Martin v. Löwis
Martin v. Löwis added the comment: What version specifically did you notice this in? -- versions: -3rd party, Python 2.4, Python 2.5 ___ Python tracker ___ _

[issue5390] Item 'Python x.x.x' in Add/Remove Programs list still lacks an icon

2009-02-27 Thread Retro
New submission from Retro : I am reporting a bug which was not fixed in the closed issue #4389. Martin v. Löwis, the fix you've made didn't fix the issue. Please open your Add/Remove Programs list (hopefully your running Windows and have Python installed there) and check whether your Python inter

[issue5370] unpickling vs. __getattr__

2009-02-27 Thread Gabriel Genellina
Gabriel Genellina added the comment: The __getattr__ method, as written, assumes that an attribute 'args' already exists. That's unsafe - a more robust approach would be: def __getattr__(self, name): if 'attrs' in self.__dict__ and name in self.attrs: return self.attrs[

[issue4715] optimize bytecode for conditional branches

2009-02-27 Thread Jeffrey Yasskin
Changes by Jeffrey Yasskin : Removed file: http://bugs.python.org/file13182/trunk-opt-cond-jump.patch ___ Python tracker ___ ___ Python-bugs-li

[issue4715] optimize bytecode for conditional branches

2009-02-27 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Collin made some comments at http://codereview.appspot.com/20094. Here's a new patch that fixes them. I plan to commit it over the weekend and then start on issue 2459. Added file: http://bugs.python.org/file13208/trunk-opt-cond-jump.patch ___

[issue1975] signals not always delivered to main thread, since other threads have the signal unmasked

2009-02-27 Thread Ross Hayden
Changes by Ross Hayden : -- nosy: +ross ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/m

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-27 Thread Daniel Diniz
Daniel Diniz added the comment: FWIW, following simplejson's SVN history[1] makes understanding the (bits of the) patch (that I had time to look at) much easier to me. I recall other JSON packages having lots of cornercase tests, not sure if they'd be relevant here. But sprinkling a few more te

[issue5251] contextlib.nested inconsistent with, well, nested with statements due exceptions raised in __enter__

2009-02-27 Thread Nick Coghlan
Nick Coghlan added the comment: I'll be working on a PEP for 2.7/3.1 to try to get the semantics of with statement changed as suggested. http://mail.python.org/pipermail/python-dev/2009-February/086470.html ___ Python tracker

[issue5381] json need object_pairs_hook

2009-02-27 Thread Armin Ronacher
Armin Ronacher added the comment: Motivation: Yes. JSON says it's unordered. However Hashes in Ruby are ordered since 1.9 and they were since the very beginning in JavaScript and PHP. -- nosy: +aronacher ___ Python tracker

[issue5336] collections.namedtuple generates code causing PyChecker warnings

2009-02-27 Thread Nick Coghlan
Nick Coghlan added the comment: Completely unrelated to the topic at hand, but that command line can be written more concisely as: E:\Python26\python.exe -m pychecker.checker test.py (pychecker was actually the number 1 use case when it came to justifying the expansion of -m to modules inside

[issue4565] Rewrite the IO stack in C

2009-02-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, so the ABC stuff is done now. Remaining: - fix the test failures with the Python implementation - the _ssl bug ___ Python tracker ___ ___

[issue5380] pty.read raises IOError when slave pty device is closed

2009-02-27 Thread Guido van Rossum
Guido van Rossum added the comment: > Well, as I suggested, in FileIO.read(): when receiving errno=5 on a > read() call and if S_IFIFO() returns true, clear errno and return an > empty string. > The question is whether a genuine EIO error ("low level IO error") can > occur on a FIFO. Intuitively

[issue5389] Uninitialized variable may be used in PyUnicode_DecodeUTF7Stateful()

2009-02-27 Thread Guido van Rossum
New submission from Guido van Rossum : [Found by a Googler who prefers to remain anonymous] This might be easier to trigger on a 64-bit: PyObject *PyUnicode_DecodeUTF7Stateful(...) { ... Py_ssize_t startinpos; ... while (s < e) { ... utf7Error: outpos = p-PyUni

[issue5380] pty.read raises IOError when slave pty device is closed

2009-02-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, as I suggested, in FileIO.read(): when receiving errno=5 on a read() call and if S_IFIFO() returns true, clear errno and return an empty string. The question is whether a genuine EIO error ("low level IO error") can occur on a FIFO. Intuitively, I'd say "n

[issue5380] pty.read raises IOError when slave pty device is closed

2009-02-27 Thread Guido van Rossum
Guido van Rossum added the comment: That may be how it works, but how do you expect to deal with it? ___ Python tracker ___ ___ Python-bugs-lis

[issue1975] signals not always delivered to main thread, since other threads have the signal unmasked

2009-02-27 Thread Guido van Rossum
Guido van Rossum added the comment: Agreed. Multiple threads trying to read interactive input from a keyboard sounds like a bad idea anyway. ___ Python tracker ___ __

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Reviewers: , Description: Updated patch from Bob Ippolito, for updating the Python trunk json package to the latest simplejson. Please review this at http://codereview.appspot.com/20095 Affected files: Lib/json/__init__.py Lib/json/decoder.py Lib/jso

[issue2054] add ftp-tls support to ftplib - RFC 4217

2009-02-27 Thread Jeff Oyama
Jeff Oyama added the comment: Ok after examining it more closely, it appears to be a false alarm, my apologies ___ Python tracker ___ ___ Pytho

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think reformatting line length should not hold-up this patch. That is a nice-to-have, not a must-have. -- nosy: +rhettinger ___ Python tracker ___

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-27 Thread Bob Ippolito
Bob Ippolito added the comment: Honestly I'm not sure when I'm going to find the time and motivation to reformat the C source and tests to fit < 80 char lines. I don't think this should hold up the patch, someone who is more obsessive compulsive than myself can fix that once it hits trunk :)

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the update. I'll try to take the time for a review in less than one month. In the meantime, though, I want to point out that the 80-character rule should also apply to C files. You have quite a bit of huge C code lines, especially in parsing code. __

[issue5381] json need object_pairs_hook

2009-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks. I'll write-up a patch against http://code.google.com/p/simplejson/ and assign it back to you for review. -- assignee: bob.ippolito -> rhettinger ___ Python tracker

[issue5380] pty.read raises IOError when slave pty device is closed

2009-02-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Guido: I don't know if it can be considered as a "bug" rather than a misguided "feature". However, at least 3 of us (the OP, Hirokazu and I) reproduce it (as for me, it's on a quite recent x86-64 Mandriva Linux setup), so I imagine it's not totally exotic behavi

[issue5381] json need object_pairs_hook

2009-02-27 Thread Bob Ippolito
Bob Ippolito added the comment: Fair enough, but the patch isn't usable because the decoder was rewritten in a later version of simplejson. There's another issue with patch to backport those back into Python http://bugs.python.org/issue4136 or you could just use the simplejson source here htt

[issue5377] Strange behavior when performing int on a Decimal made from -sys.maxint-1

2009-02-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: Unless there is a discrepancy between doc and behavior, this strikes me as an unspecified implementation detail. If so, it should be either closed or changed to a specific feature request. -- nosy: +tjreedy ___ Pyth

[issue1975] signals not always delivered to main thread, since other threads have the signal unmasked

2009-02-27 Thread Adam Olsen
Changes by Adam Olsen : -- versions: +Python 2.6, Python 2.7, Python 3.0, Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailin

[issue1975] signals not always delivered to main thread, since other threads have the signal unmasked

2009-02-27 Thread Adam Olsen
Adam Olsen added the comment: The readline API just sucks. It's not at all designed to be used simultaneously from multiple threads, so we shouldn't even try. Ban using it in non-main threads, restore the blocking of signals, and go on with our merry lives. -- nosy: +Rhamphoryncus __

[issue5373] TypeError when '\x00' in docstring

2009-02-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: The bug is the discrepancy between doc "[3] A string literal appearing as the first statement in the function body is transformed into the function’s __doc__ attribute and therefore the function’s docstring. [4] A string literal appearing as the first statemen

[issue5364] documentation in epub format

2009-02-27 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue5364] documentation in epub format

2009-02-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: A few days ago, Tim O'Reilly wrote a column in Forbes http://www.forbes.com/2009/02/22/kindle-oreilly-ebooks-technology-breakthroughs_oreilly.html promoting epub and noting that his computer book company is starting to use it. I got the same impression: xhtml

[issue5381] json need object_pairs_hook

2009-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, here's the intended code for the filter in the last post: books = json.loads(infile, object_hook=OrderedDict) for book in books: del book['isbn'] json.dumps(books, outfile) ___ Python tracker

[issue5381] json need object_pairs_hook

2009-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Same reason as for config files and yaml files. Sometimes those files represent human edited input and if a machine re-edits, filters, or copies, it is nice to keep the original order (though it may make no semantic difference to the computer). For exampl

[issue5380] pty.read raises IOError when slave pty device is closed

2009-02-27 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone : -- nosy: +exarkun ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue5388] Green-box doc glitch: winhelp version only

2009-02-27 Thread Terry J. Reedy
New submission from Terry J. Reedy : Example: LangRef / LexAnalysis / Identifiers Green-shaded grammar section has 3 lines, 2 very long: identifier ::= id_start id_continue* id_start::= ___ __

[issue5382] Allow Python keywords as keyword arguments for functions.

2009-02-27 Thread Matthew Barnett
Matthew Barnett added the comment: The normal use of a keyword argument is to refer to a formal argument, which is an identifier. Being able to wrap it up into a dict is a later addition, and it's necessary to turn the identifier into a string because it's not possible to use a bare word (as Per

[issue5380] pty.read raises IOError when slave pty device is closed

2009-02-27 Thread Guido van Rossum
Guido van Rossum added the comment: IIUC the problem is that a read() syscall on the pty after the other end has been closed raises an error instead of reading 0 bytes? Isn't that a bug in the pty implementation? For lots of devices (e.g. sockets, pipes) a short non-empty read just means that y

[issue5381] json need object_pairs_hook

2009-02-27 Thread Bob Ippolito
Bob Ippolito added the comment: Why? According to RFC (emphasis mine): An object is an *unordered* collection of zero or more name/value pairs, where a name is a string and a value is a string, number, boolean, null, object, or array. -- resolution: -> invalid _

[issue5382] Allow Python keywords as keyword arguments for functions.

2009-02-27 Thread David Kerkeslager
David Kerkeslager added the comment: Thank you all for reading and responding to my submission. I post the following without expectation of results, only to expand my reasoning: The following aren't applicable to the situation I described: def f(): class return def f(class): cla

[issue5358] Unicode control characters are not allowed as identifiers

2009-02-27 Thread Martin v. Löwis
Martin v. Löwis added the comment: See PEP 3131 for a specification what is an identifier in Python. Closing this as "won't fix". -- resolution: -> wont fix status: open -> closed ___ Python tracker _

[issue5383] Allow intermixing of keyword arguments and vargarg arguments

2009-02-27 Thread Ezio Melotti
Ezio Melotti added the comment: > xhtmlNode('div','Hello, world',id='sidebar') > ... but this would not have symmetry with the generated xhtml and > therefore complicates the code. The solution, in my opinion, is to > allow varargs to be intermixed with keyword args. The above real-world >

[issue5383] Allow intermixing of keyword arguments and vargarg arguments

2009-02-27 Thread David W. Lambert
David W. Lambert added the comment: I think you need this order preserving paradigm using python as is: def xhtmlNode(tag,*args): ... xhtmlNode('div', {'id':'sidebar'}, 'Hello world') Less work in xhtmlNode might offset the extra work in writing the function call. Oh well, I didn't rea

[issue804543] invalid use of setlocale

2009-02-27 Thread Georg Brandl
Georg Brandl added the comment: Fixed in r70029, merged to 3.0 in r70030. -- nosy: +georg.brandl resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue1580] Use shorter float repr when possible

2009-02-27 Thread Skip Montanaro
Changes by Skip Montanaro : -- nosy: -skip.montanaro ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue804543] invalid use of setlocale

2009-02-27 Thread Georg Brandl
Changes by Georg Brandl : -- resolution: accepted -> status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue5387] mmap.move crashes by integer overflow

2009-02-27 Thread Hirokazu Yamamoto
New submission from Hirokazu Yamamoto : mmap.move crashes by integer overflow. See http://www.nabble.com/Segv-in-mmap.move()-td18617044.html import mmap data = mmap.mmap(-1, 1) data.move(1,1,-1) # crash Maybe mmap.move should use Py_ssize_t and raise IndexError(OverflowError?) for negative valu

[issue5386] mmap can crash with write_byte

2009-02-27 Thread Hirokazu Yamamoto
New submission from Hirokazu Yamamoto : mmap.write_byte doesn't check buffer size, so it can cause crash like bellow. import mmap m = mmap.mmap(-1, 1) for i in xrange(1): # enough? print i m.write_byte('1') # crash The patch is in r69945. -- components: Extension Modules me

[issue5385] mmap can crash after resize failure (windows)

2009-02-27 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : -- type: -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue5385] mmap can crash after resize failure (windows)

2009-02-27 Thread Hirokazu Yamamoto
New submission from Hirokazu Yamamoto : On windows, after mmap.resize fails, self->map_handle becomes NULL, but it should become INVALID_HANDLE_VALUE otherwise CHECK_VALID is passed through, it can cause crash like bellow. import mmap m = mmap.mmap(-1, 5) try: m.resize(-1) except WindowsErro

[issue5382] Allow Python keywords as keyword arguments for functions.

2009-02-27 Thread Georg Brandl
Georg Brandl added the comment: This is not going to happen: First, function call syntax is nicely parallel to parameter definition syntax, and it is obviously not possible to define parameters named like keywords. Second, making exceptions like this leads to more exceptions and finally incons

[issue804543] invalid use of setlocale

2009-02-27 Thread Akira Kitada
Akira Kitada added the comment: If I'm not mistaken, this bug seems to be fre-introduced in "release30-maint/Modules/python.c". It could be fixed in just as it was before. -- components: +Interpreter Core -None nosy: +akitada type: -> behavior versions: +Python 2.6, Python 2.7, Python

[issue5384] mmap and exception type

2009-02-27 Thread Hirokazu Yamamoto
New submission from Hirokazu Yamamoto : It seems mmap module is using inappropriate exception types. For example, if (! (PyString_Check(v)) ) { PyErr_SetString(PyExc_IndexError, "mmap slice assignment must be a string"); ret

[issue5382] Allow Python keywords as keyword arguments for functions.

2009-02-27 Thread David W. Lambert
David W. Lambert added the comment: You can sneak them in thusly: def f(**kwargs): print(kwargs) f(**{'class':'sidebar'}) ___ Python tracker ___ ___

[issue5360] RO (shorthand for READONLY) gone, not in documentation

2009-02-27 Thread Georg Brandl
Georg Brandl added the comment: Removed RO in r70027. Fixed HEAD_INIT stuff in r70028. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue5382] Allow Python keywords as keyword arguments for functions.

2009-02-27 Thread Matthew Barnett
Matthew Barnett added the comment: The usual trick is to append "_": xhtmlNode('div',class_='sidebar') Could you modify the function to remove the trailing "_"? -- nosy: +mrabarnett ___ Python tracker ___

[issue5382] Allow Python keywords as keyword arguments for functions.

2009-02-27 Thread David W. Lambert
David W. Lambert added the comment: Use cases are easy to find. So easily found that there's probably a sound reason for reserved words. The proposal couples lexical analysis to the parser. # syntax error or name error? def f(): class return def f(class): class return ---

[issue5364] documentation in epub format

2009-02-27 Thread Georg Brandl
Georg Brandl added the comment: Well, the request is valid, so I'll leave this open here. Since the format seems to me to be nothing but XHTML with a bit of extra markup around it, it would be quite easy to write a builder for Sphinx (by copying from the HTML help one) to do it. Would you like

[issue5365] add conversion table to time module docs

2009-02-27 Thread Georg Brandl
Georg Brandl added the comment: Thanks, added the table in r70026. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue5358] Unicode control characters are not allowed as identifiers

2009-02-27 Thread Matthew Barnett
Matthew Barnett added the comment: The definition of a word in the new re module (actually targetted at Python 2.7) is currently a sequence of L&, N&, M& and Pc. I suppose ideally we want the definitions of a word and an identifier to be basically the same, except that an identifier can't start

[issue5344] typo in what's new in 2.6

2009-02-27 Thread Georg Brandl
Georg Brandl added the comment: Thanks, fixed in r70025. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Py

[issue5383] Allow intermixing of keyword arguments and vargarg arguments

2009-02-27 Thread David Kerkeslager
Changes by David Kerkeslager : -- components: +Interpreter Core ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5357] Last paragraph of urllib.request.urlopen documentation is garbled

2009-02-27 Thread Georg Brandl
Georg Brandl added the comment: That paragraph was a slight bit incomprehensible :) Fixed in r70024. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ _

[issue5383] Allow intermixing of keyword arguments and vargarg arguments

2009-02-27 Thread David Kerkeslager
Changes by David Kerkeslager : -- type: -> feature request versions: +Python 3.0, Python 3.1 ___ Python tracker ___ ___ Python-bugs-li

[issue5383] Allow intermixing of keyword arguments and vargarg arguments

2009-02-27 Thread David Kerkeslager
New submission from David Kerkeslager : This problem arose in this thread: http://www.python-forum.org/pythonforum/viewtopic.php?f=2&t=11606 Basically, we have the following function which will generate an XHTML node: def xhtmlNode(tag, *content, **attr):... If we call: xhtmlNode('div',id='s

[issue5363] Documentation of filecmp.compfiles missing word & possible explanation

2009-02-27 Thread Georg Brandl
Georg Brandl added the comment: That was really a suboptimal documentation :) I reworded it and added an example in r70023. (I suspect it's still not as clear as if the actual five lines of implementation were given ;) -- assignee: tarek -> georg.brandl nosy: +georg.brandl resolution:

[issue5382] Allow Python keywords as keyword arguments for functions.

2009-02-27 Thread David Kerkeslager
New submission from David Kerkeslager : This problem arose in this thread: http://www.python-forum.org/pythonforum/viewtopic.php?f=2&t=11606 Basically, we have the following function which will generate an XHTML node: def xhtmlNode(tag, **attr):... If we call: xhtmlNode('div',class='sidebar'

[issue5361] Obsolete mispelled in string formatting docs

2009-02-27 Thread Georg Brandl
Georg Brandl added the comment: Thanks, fixed in r70022. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Py

[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions

2009-02-27 Thread Steve Owens
Steve Owens added the comment: I am not familiar with the process here, but I would like to continue to add additional support to the _cursesmodule.c file. However, I am loathe to put too much functionality into any one patch. Is there any way I can find out when this patch will be applied

[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions

2009-02-27 Thread Steve Owens
Changes by Steve Owens : Removed file: http://bugs.python.org/file13174/color_set_patch.diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions

2009-02-27 Thread Steve Owens
Changes by Steve Owens : Removed file: http://bugs.python.org/file13196/curses.rst ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions

2009-02-27 Thread Steve Owens
Changes by Steve Owens : Added file: http://bugs.python.org/file13207/whatsnew_2_7_rst.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions

2009-02-27 Thread Steve Owens
Changes by Steve Owens : Added file: http://bugs.python.org/file13206/howto_curses_rst.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions

2009-02-27 Thread Steve Owens
Changes by Steve Owens : Removed file: http://bugs.python.org/file13205/howto_curses_rst.diff ___ Python tracker ___ ___ Python-bugs-list maili

[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions

2009-02-27 Thread Steve Owens
Steve Owens added the comment: I am attaching the Docs/howto/curses.rst file as howto_curses_rst.diff Added file: http://bugs.python.org/file13205/howto_curses_rst.diff ___ Python tracker __

[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions

2009-02-27 Thread Steve Owens
Steve Owens added the comment: I am attaching the diff file for the Docs/library/curses.rst as lib_curses_rst.diff Added file: http://bugs.python.org/file13204/lib_curses_rst.diff ___ Python tracker __

[issue1580] Use shorter float repr when possible

2009-02-27 Thread Mark Dickinson
Mark Dickinson added the comment: I'd be interested in working with Preston on adapting David Gay's code. (I'm interested in looking at this anyway, but I'd much prefer to do it in collaboration with someone else.) It would be nice to get something working before the 3.1 betas, but that seems

[issue5052] Mark distutils to stay compatible with 2.3

2009-02-27 Thread Tarek Ziadé
Tarek Ziadé added the comment: And we're back in PEP 291 ! see r70019, r70017 and r70021 -- status: open -> closed ___ Python tracker ___ ___

[issue5377] Strange behavior when performing int on a Decimal made from -sys.maxint-1

2009-02-27 Thread Mark Dickinson
Mark Dickinson added the comment: For anyone who does care about this, it should be noted that the Fraction type has similar issues. The following comes from Python 2.7 on a 64-bit machine: >>> int(Fraction(2**63-1)) 9223372036854775807L >>> int(2**63-1) 9223372036854775807 __

[issue5377] Strange behavior when performing int on a Decimal made from -sys.maxint-1

2009-02-27 Thread Mark Dickinson
Mark Dickinson added the comment: Why do you care whether the result is an int or a long in this case? Does it affect any code that you know of in a meaningful way? > And why the difference in this behavior between 2.5.1 and 2.5.2. There were some fairly major changes (many bugfixes, new func

[issue5380] pty.read raises IOError when slave pty device is closed

2009-02-27 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue5380] pty.read raises IOError when slave pty device is closed

2009-02-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Interesting. The reason the io module calls read() more than once is that BufferedReader is a generic wrapper which can be used on different kinds of file-like objects, including sockets. I'm not sure how to satisfy that use-case without compromising normal err

[issue5380] pty.read raises IOError when slave pty device is closed

2009-02-27 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue5380] pty.read raises IOError when slave pty device is closed

2009-02-27 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: This OSError(5) happens when we tries to read from pty after data runs out. So simple_test_2.py fails with same error even if we don't use io module. Modules/posixmodule.c (posix_read) simply calls read(2) once, but io module while avail < n: ch

[issue5380] pty.read raises IOError when slave pty device is closed

2009-02-27 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: I think this is not array modules' bug. Attached test program outputs different results on trunk/py3k. debian:~/python-dev/trunk# ./python /mnt/windows/simple_test.py os.pipe: success pty.openpty: success debian:~/python-dev/py3k# ./python /mnt/windows/simp

[issue5381] json need object_pairs_hook

2009-02-27 Thread Raymond Hettinger
New submission from Raymond Hettinger : If PEP372 goes through, Python is going to gain an ordered dict soon. The json module's encoder works well with it: >>> items = [('one', 1), ('two', 2), ('three',3), ('four',4), ('five',5)] >>> json.dumps(OrderedDict(items)) '{"one": 1, "two": 2, "three":

[issue5380] array.fromfile() on master pty raises IOError when slave pty device is closed

2009-02-27 Thread Zac Medico
New submission from Zac Medico : With python-3.0, array.fromfile() raises an IOError when reading from a master pty device after the slave device has been closed. This causes remaining data that had been written to the slave device to be lost. I have observed this problem with python-3.0.1 on lin