[issue5234] Enhance 3.1 IDLE to exec IDLESTARTUP/PYTHONSTARTUP on restart

2009-03-08 Thread Martin v. Löwis
Martin v. Löwis added the comment: How does that differ from issue5233? If this is a straight-forward port, no additional issue is needed. Even if there are differences, please attach the patch to the other issue. -- message_count: 1.0 -> 2.0 nosy: +loewis nosy_count: 2.0 -> 3.0 __

[issue4847] csv fails when file is opened in binary mode

2009-03-08 Thread John Machin
John Machin added the comment: ... and it looks like Option 2 might already *almost* be in place. Continuing with the previous example (book1.csv has embedded lone LFs): C:\devel\csv>\python30\python -c "import csv; print(repr(list(csv.reader(open('book1.csv','rt', encoding='ascii')" [['Fie

[issue5454] pydoc -k fails (py3k patch)

2009-03-08 Thread Martin v. Löwis
Changes by Martin v. Löwis : Removed file: http://bugs.python.org/file13278/pydoc-keyword-search-patch-py3k.diff ___ Python tracker ___ ___ Py

[issue5454] pydoc -k fails (py3k patch)

2009-03-08 Thread Martin v. Löwis
Martin v. Löwis added the comment: You can have multiple attachments to a single issue. I have attached this file to the other issue. -- message_count: 1.0 -> 2.0 nosy: +loewis nosy_count: 1.0 -> 2.0 resolution: -> duplicate status: open -> closed _

[issue5453] pydoc -k fails (release30-maint patch)

2009-03-08 Thread Martin v. Löwis
Changes by Martin v. Löwis : Added file: http://bugs.python.org/file13278/pydoc-keyword-search-patch-py3k.diff ___ Python tracker ___ ___ Pyth

[issue4847] csv fails when file is opened in binary mode

2009-03-08 Thread John Machin
John Machin added the comment: Before patching, could we discuss the requirements? There are two different concepts: (1) "text" file (assume that CR and/or LF are line terminators, and provide methods for accessing a line at a time) versus "binary" file (no such assumptions, no such access) (2)

[issue5441] Convenience API for timeit.main

2009-03-08 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger nosy_count: 2.0 -> 3.0 ___ Python tracker ___ ___ Python-b

[issue4847] csv fails when file is opened in binary mode

2009-03-08 Thread Jervis Whitley
Jervis Whitley added the comment: Hi all, This patch takes the approach of assuming utf-8 format encoding for files opened with 'rb' directive. That is: 1. Check if each line is Unicode Or Bytes Type. 2. If Bytes, get char array reference to internal buffer. 3. use PyUnicode_FromString to cr

[issue5455] csv module no longer works as expected when file opened in binary mode

2009-03-08 Thread John Machin
John Machin added the comment: This is in effect a duplicate of issue 4847. Summary: The docs are CORRECT. The 3.X implementation is WRONG. The 2.X implementation is CORRECT. See examples in my comment on issue 4847. -- message_count: 3.0 -> 4.0 nosy: +sjmachin nosy_count: 2.0 -> 3.0

[issue5223] infinite recursion in PyErr_WriteUnraisable

2009-03-08 Thread lplatypus
lplatypus added the comment: Hi amaury, I am copying you into this issue because I think it was introduced in your revision 65320 when you added a call to PyErr_WriteUnraisable from PyErr_GivenExceptionMatches in Python/errors.c. Any thoughts on on this issue or how to fix it would be very welco

[issue5455] csv module no longer works as expected when file opened in binary mode

2009-03-08 Thread Jervis Whitley
Jervis Whitley added the comment: Hi Skip, Currently, once we are sure the lineobj is a unicode obj we then get it's internal buffer using: line = PyUnicode_AsUnicode(lineobj); for the purpose of iterating through the line. is there an opportunity to use: line = PyBytes_AsString(lineobj);

[issue5456] io.StringIO's universal newlines support is broken in 3.0.1

2009-03-08 Thread Erick Tryzelaar
New submission from Erick Tryzelaar : Python version 3.0.1's io.StringIO has a bug when trying to use universal newlines on the mac. It's fixed in 3.1a1 though. Here's the exception: >>> io.StringIO('hello there\r\nlela\r\n', newline=None).readlines() Traceback (most recent call last): File

[issue5455] csv module no longer works as expected when file opened in binary mode

2009-03-08 Thread Jervis Whitley
Jervis Whitley added the comment: in _csv.c, the check is done here: lineobj = PyIter_Next(self->input_iter); if (lineobj == NULL) { /* End of input OR exception */ if (!PyErr_Occurred() && self->field_len != 0) PyErr_Format(error_obj, "newline inside string"

[issue5455] csv module no longer works as expected when file opened in binary mode

2009-03-08 Thread Jervis Whitley
Changes by Jervis Whitley : -- nosy: +jdwhitley nosy_count: 1.0 -> 2.0 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue5455] csv module no longer works as expected when file opened in binary mode

2009-03-08 Thread Skip Montanaro
New submission from Skip Montanaro : I just discovered that the csv module's reader class in 3.x doesn't work as expected when used as documented. The requirement has always been that the CSV file is opened in binary mode so that embedded newlines in fields are screwed up. Alas, in 3.x files op

[issue5454] pydoc -k fails (py3k patch)

2009-03-08 Thread dariusp
New submission from dariusp : Apologies for the duplicate issue, but I wanted to supply two patches (one for release30-maint and one for py3k) and appears that each issue can only have one file. pydoc -k fails for both release30-maint and py3k. In release30-maint the python io module (or more

[issue5452] Documentation for io.StringIO has wrong info for arguments

2009-03-08 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixed in r70255. -- message_count: 1.0 -> 2.0 resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue5453] pydoc -k fails (release30-maint patch)

2009-03-08 Thread dariusp
New submission from dariusp : pydoc -k fails for both release30-maint and py3k. In release30-maint the python io module (or more accurately the underlying codecs module used by the io module) raises a LookupError if the encoding is invalid. There is a test module with a deliberate encoding miss

[issue5452] Documentation for io.StringIO has wrong info for arguments

2009-03-08 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: georg.brandl -> benjamin.peterson nosy: +benjamin.peterson nosy_count: 2.0 -> 3.0 ___ Python tracker ___ __

[issue5451] patch to make io.StringIO consistent with open with respect to newlines

2009-03-08 Thread Erick Tryzelaar
Erick Tryzelaar added the comment: Moving this to a documentation bug here: http://bugs.python.org/issue5452 -- message_count: 3.0 -> 4.0 ___ Python tracker ___ _

[issue5452] Documentation for io.StringIO has wrong info for arguments

2009-03-08 Thread Erick Tryzelaar
New submission from Erick Tryzelaar : (this is redirecting from http://bugs.python.org/issue5451). The documentation for io.StringIO is incorrect on the arguments. First off, it doesn't actually accept the "encoding" and "errors" arguments. Second, it's not stated that the default "newline" ar

[issue5451] patch to make io.StringIO consistent with open with respect to newlines

2009-03-08 Thread Erick Tryzelaar
Erick Tryzelaar added the comment: Thanks Benjamin. Could the documentation for StringIO be updated then? The docs for io.StringIO [1] says that io.TextIOWrapper implements the constructor, but TextIOWrapper defaults newline to None [2], and there's nothing that states that io.StringIO change

[issue5451] patch to make io.StringIO consistent with open with respect to newlines

2009-03-08 Thread Benjamin Peterson
Benjamin Peterson added the comment: This is the intended behavior. It is consist with 2.x's StringIO.StringIO behavior. -- message_count: 1.0 -> 2.0 nosy: +benjamin.peterson nosy_count: 1.0 -> 2.0 resolution: -> rejected status: open -> closed ___

[issue5450] test_tcl testLoadTk fails if DISPLAY defined but connect fails, instead of being skipped

2009-03-08 Thread R. David Murray
R. David Murray added the comment: That first sentence should have read "If the DISPLAY environment variable is set but the display cannot be opened". -- message_count: 1.0 -> 2.0 ___ Python tracker ___

[issue5451] patch to make io.StringIO consistent with open with respect to newlines

2009-03-08 Thread Erick Tryzelaar
New submission from Erick Tryzelaar : I noticed that io.StringIO is inconsistent with open on how newlines are handled. The default approach open uses is universal newlines: >>> with open('foo', 'w') as f: ... f.write('hello hi\r\nla la\r\n') ... 17 >>> open('foo').readlines() ['hello hi\n',

[issue1818] Add named tuple reader to CSV module

2009-03-08 Thread Jervis Whitley
Jervis Whitley added the comment: Updated version of docs for 2.7 and 3k. -- message_count: 29.0 -> 30.0 Added file: http://bugs.python.org/file13274/ntreader6_py3.diff ___ Python tracker __

[issue1818] Add named tuple reader to CSV module

2009-03-08 Thread Jervis Whitley
Changes by Jervis Whitley : Added file: http://bugs.python.org/file13275/ntreader6_py27.diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue1818] Add named tuple reader to CSV module

2009-03-08 Thread Jervis Whitley
Changes by Jervis Whitley : Removed file: http://bugs.python.org/file13268/ntreader5_py3_1.diff ___ Python tracker ___ ___ Python-bugs-list mai

[issue5450] test_tcl testLoadTk fails if DISPLAY defined but connect fails, instead of being skipped

2009-03-08 Thread R. David Murray
New submission from R. David Murray : If the DISPLAY environment variable is set, the test_tcl test 'testLoadTk' gives a traceback. In the same circumstance, test_tk and test_ttkguionly display the error and are skipped. Although this is a nit rather than a problem, for consistencies sake I thi

[issue5387] mmap.move crashes by integer overflow

2009-03-08 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: I tried r69943 on coLinux, and I got compile error "max is not defined". Here is updated patch. -- keywords: +patch message_count: 1.0 -> 2.0 Added file: http://bugs.python.org/file13272/fix_mmap_move.patch ___ Py

[issue5449] bug fix to prevent io.BytesIO from accepting arbitrary keyword arguments

2009-03-08 Thread Erick Tryzelaar
New submission from Erick Tryzelaar : I noticed that it was possible to specify arbitrary arguments to io.BytesIO: >>> io.BytesIO(b'foo', foo=1) <_io.BytesIO object at 0x430150> But io.StringIO doesn't: >>> io.StringIO('foo', foo=1) Traceback (most recent call last): File "", line 1, in Ty

[issue3002] shutil.copyfile blocks indefinitely on named pipes

2009-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: I forgot the case where the /destination/ file is a named pipe. Here is a new patch. -- message_count: 8.0 -> 9.0 Added file: http://bugs.python.org/file13270/issue3002-2.patch ___ Python tracker

[issue3002] shutil.copyfile blocks indefinitely on named pipes

2009-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch, introducing a new exception named SpecialFileError which is raised when trying to copy a named pipe. Other kinds of special file aren't checked for, but they could it we thought it's sensible to do so. -- keywords: +patch message_count:

[issue1818] Add named tuple reader to CSV module

2009-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I got misled by the documentation ("The contents of *fieldnames* are passed directly to be used as the namedtuple fieldnames"), and your implementation is a bit difficult to follow. -- message_count: 28.0 -> 29.0 ___

[issue1818] Add named tuple reader to CSV module

2009-03-08 Thread Jervis Whitley
Jervis Whitley added the comment: Antoine> I don't understand why NamedTupleReader requires the Antoine> fieldnames array Antoine> rather than the namedtuple class itself. If you could pass it Antoine> the namedtuple class, users could choose whatever namedtuple Antoine> subclass with whatever

[issue1818] Add named tuple reader to CSV module

2009-03-08 Thread Jervis Whitley
Jervis Whitley added the comment: Jervis> in csv.rst removed reference to reader.next() as a public method. Skip> Because? I've not seen any discussion in this issue or in any Skip> other forums Skip> (most certainly not on the c...@python.org mailing list) which would Skip> suggest Skip> that

[issue5442] [3.1alpha1] test_importlib fails on Mac OSX 10.5.6

2009-03-08 Thread Brett Cannon
Brett Cannon added the comment: Ah, OK, that explains it then. I guess I need to come up with a test to verify whether commonly case-sensitive filesystems are truly case-sensitive before running the tests. Thanks for the quick response, Ismail. -- message_count: 3.0 -> 4.0 priority: no

[issue5442] [3.1alpha1] test_importlib fails on Mac OSX 10.5.6

2009-03-08 Thread Ismail Donmez
Ismail Donmez added the comment: Yes its case sensitive. -- message_count: 2.0 -> 3.0 ___ Python tracker ___ ___ Python-bugs-list mail

[issue5442] [3.1alpha1] test_importlib fails on Mac OSX 10.5.6

2009-03-08 Thread Brett Cannon
Brett Cannon added the comment: Is your version of OS X installed on a case-sensitive filesystem? These tests all pass for me on my Macbook on 10.5.6. -- assignee: -> brett.cannon message_count: 1.0 -> 2.0 ___ Python tracker

[issue5448] Add precision property to decimal.Decimal

2009-03-08 Thread Daniel Lescohier
New submission from Daniel Lescohier : I would like to get the decimal precision of decimal.Decimal objects (for my application, in order to validate whether a Decimal value will fit in the defined decimal precision of a database field). The way I found to get it was with: precision = len(val

[issue5447] future unicode literals and r'\u'

2009-03-08 Thread Benjamin Peterson
Benjamin Peterson added the comment: This happens with unicode literals even without "from __future__ import unicode_literals" because raw strings still have \u escapes interpreted. This isn't true in 3.0, so it would be nice to disable it with unicode_literals. -- message_count: 1.0 ->

[issue5447] future unicode literals and r'\u'

2009-03-08 Thread Poor Yorick
New submission from Poor Yorick : from __future__ import unicode_literals print(r'\u.bug') SyntaxError: (unicode error) truncated \u -- components: Interpreter Core message_count: 1.0 messages: 83326 nosy: pooryorick nosy_count: 1.0 severity: normal status: open title: future unicod

[issue5446] doc building progress on Windows doesn't show any color

2009-03-08 Thread Benjamin Peterson
Benjamin Peterson added the comment: This should go on the Sphinx tracker. http://bitbucket.org/birkenfeld/sphinx -- message_count: 1.0 -> 2.0 nosy: +benjamin.peterson nosy_count: 2.0 -> 3.0 resolution: -> invalid status: open -> closed ___ Python t

[issue5446] doc building progress on Windows doesn't show any color

2009-03-08 Thread Gabriel Genellina
New submission from Gabriel Genellina : The documentation building progress on Windows doesn't show any colorized output, unlike the linux environment. This patch to console.py provides minimal color support on Windows. -- assignee: georg.brandl components: Documentation files: console.

[issue5446] doc building progress on Windows doesn't show any color

2009-03-08 Thread Gabriel Genellina
Changes by Gabriel Genellina : -- versions: +Python 2.7, Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue5444] .chm build process on Windows doesn't use the right filename

2009-03-08 Thread Tim Golden
Tim Golden added the comment: Effectively a duplicate of http://bugs.python.org/issue2421 (which has been sitting around unapplied for a few months) I certainly don't mind which one goes in, but I think one should be closed in favour of the other. (And that one should be applied!) -- m

[issue5445] codecs.StreamWriter.writelines problem when passed generator

2009-03-08 Thread Daniel Lescohier
New submission from Daniel Lescohier : This is the implementation of codecs.Streamwriter.writelines for all Python versions that I've checked: def writelines(self, list): """ Writes the concatenated list of strings to the stream using .write(). """ self.

[issue1818] Add named tuple reader to CSV module

2009-03-08 Thread Skip Montanaro
Skip Montanaro added the comment: I retract my previous comment. I don't use the DictReader the way it operates (fieldnames==None => first row is a header) and forgot about that behavior. -- message_count: 25.0 -> 26.0 ___ Python tracker

[issue1818] Add named tuple reader to CSV module

2009-03-08 Thread Skip Montanaro
Changes by Skip Montanaro : -- message_count: 26.0 -> 25.0 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue5444] .chm build process on Windows doesn't use the right filename

2009-03-08 Thread Gabriel Genellina
New submission from Gabriel Genellina : doc/make.bat on Windows doesn't correctly build the right .chm filename. This patch does the same as the unix Makefile: run patchlevel.py and set the output as the DISTVERSION environment variable, so it can be used in the final file name. -- a

[issue1818] Add named tuple reader to CSV module

2009-03-08 Thread Skip Montanaro
Skip Montanaro added the comment: I find this aspect of the proposal disturbing: If *fieldnames* is None the values in the first row of the *csvfile* will be used as the fieldnames I don't think this should be implicit. It makes the NamedTupleReader semantically different fr

[issue1818] Add named tuple reader to CSV module

2009-03-08 Thread Skip Montanaro
Skip Montanaro added the comment: I don't know how NamedTuple objects work, but in many situations you want the content of the CSV file to drive the output. I would think you would use a technique similar to my DictReader example to tell the NamedTupleReader the fieldnames. For that you need a

[issue1324261] __name__ available during class dictionary build

2009-03-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This can be done with a metaclass: the metaclass receives the name of the created class, and it's easy to update the class definition there. -- message_count: 1.0 -> 2.0 nosy: +amaury.forgeotdarc nosy_count: 1.0 -> 2.0 resolution: -> works for m

[issue1412632] Proper locking with asynchronous callbacks.

2009-03-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: A (better IMO) fix was applied with r68460. -- message_count: 1.0 -> 2.0 nosy: +amaury.forgeotdarc nosy_count: 1.0 -> 2.0 resolution: -> fixed status: open -> closed ___ Python tracker

[issue1390086] ScrolledText hungs up in some conditions

2009-03-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Reproduces with 2.4.2, but seems fixed with 2.5. -- message_count: 2.0 -> 3.0 nosy: +amaury.forgeotdarc nosy_count: 3.0 -> 4.0 resolution: -> out of date status: open -> closed ___ Python tracker

[issue5443] trivial typo in itertools documentation

2009-03-08 Thread Lorenz Quack
New submission from Lorenz Quack : In the docs: "http://docs.python.org/library/itertools.html#module-itertools"; In the table: "Iterators terminating on the shortest input sequence:" In row: "imap()" and "starmap()" In the column: "Results" It says "fun()" instead of "func()" -- assign

[issue1422398] Unicode IOError: execfile(u'\u043a\u043a\u043a/x.py')

2009-03-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: It works with python 3.0. Of course you have to replace execfile with >>> s = '\u043a\u043a\u043a.py' >>> exec(compile(open(s).read(), s, 'exec')) -- message_count: 1.0 -> 2.0 nosy: +amaury.forgeotdarc nosy_count: 1.0 -> 2.0 resolution: -> out o

[issue3002] shutil.copyfile blocks indefinitely on named pipes

2009-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure the race condition possibility is important. Is shutil.copytree() protected against such race conditions in the first place? (I'd argue this bug is less about potential DOS attacks than the simple unfriendliness of indefinitely blocking) -

[issue5425] 2to3 wrong for types.StringTypes

2009-03-08 Thread Hagen Fürstenau
Hagen Fürstenau added the comment: The automatic conversion can't be perfect in all cases, but I think my second suggestion is more in line with the other transformations done by 2to3 (string literals, "str", "basestring" etc.). I propose applying the second patch, but don't care enough to argu

[issue1818] Add named tuple reader to CSV module

2009-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't understand why NamedTupleReader requires the fieldnames array rather than the namedtuple class itself. If you could pass it the namedtuple class, users could choose whatever namedtuple subclass with whatever additional methods or behaviour suits them. It

[issue5441] Convenience API for timeit.main

2009-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: It would be even better if you could pass a locals or globals dictionnary instead of the "setup" arg. And even even better if it could implicitly get the locals/globals from the calling frame :-) -- message_count: 1.0 -> 2.0 nosy: +pitrou nosy_count: 1.

[issue5442] [3.1alpha1] test_importlib fails on Mac OSX 10.5.6

2009-03-08 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- components: +Library (Lib), Tests priority: -> normal ___ Python tracker ___ ___ Python-bugs-list maili

[issue5442] [3.1alpha1] test_importlib fails on Mac OSX 10.5.6

2009-03-08 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +brett.cannon nosy_count: 1.0 -> 2.0 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue5442] [3.1alpha1] test_importlib fails on Mac OSX 10.5.6

2009-03-08 Thread Ismail Donmez
New submission from Ismail Donmez : Two failures in test_importlib: == FAIL: test_case_insensitivity (importlib.test.extension.test_case_sensitivity.ExtensionModuleCaseSensi tivityTest) -

[issue1701192] symbol conflict for 'readahead'

2009-03-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: If your build process really needs fcntl.h in Python.h, I suggest to customize it again and add: #ifdef Py_BUILD_CORE #define readahead do_readahead #endif -- nosy: +amaury.forgeotdarc resolution: -> invalid status: open -> closed

[issue5440] string.strip behaves strangly

2009-03-08 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- dependencies: +string.strip behaves strangly resolution: -> duplicate status: open -> closed ___ Python tracker ___ __

[issue5439] string.strip behaves strangly

2009-03-08 Thread Martin v. Löwis
Martin v. Löwis added the comment: It's a feature you don't understand. .strip() doesn't expect the substring to be stripped, but a list of characters. Since the strip characters contain /, all leading a,/,b characters get stripped (in any order: py> "aaab/csdfhkab///c".strip("a/b") 'csdfhk