[issue15301] os.chown: OverflowError: Python int too large to convert to C long

2013-08-07 Thread Larry Hastings
Larry Hastings added the comment: Benjamin, do you want my elaborate fix in for 2.7? It means adding two new converters, one for pid and one for gid, and switching everything that takes pid/gid arguments to use those. -- nosy: +benjamin.peterson __

[issue18226] IDLE Unit test for FormatParagrah.py

2013-08-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Added tests to get 100% coverage (not counting in __name__ block). More test cleanups. Some of the extra newlines come from getting to 'end' instead of 'insert'. Others are avoided by adding newline to end of test strings, which is more realistic anyway. I comm

[issue18583] Idle: enhance FormatParagraph

2013-08-07 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- dependencies: +IDLE Unit test for FormatParagrah.py ___ Python tracker ___ ___ Python-bugs-list mailing

[issue16968] Fix test discovery for test_concurrent_futures.py

2013-08-07 Thread Zachary Ware
Zachary Ware added the comment: That's a much better solution, thank you, Serhiy. Here's a new patch. test.support is no longer changed at all, but regrtest.py still is; the extra reference to the tests still causes issues, so it is removed. -- Added file: http://bugs.python.org/fil

[issue18677] Enhanced context managers with ContextManagerExit and None

2013-08-07 Thread Eric Snow
Eric Snow added the comment: Nick was probably talking about what is further elaborated in PEP 343. I'd recommend taking a particular look at the "Motivation and Summary" section regarding flow control macros. -- nosy: +eric.snow ___ Python tracker

[issue18681] typo in imp.reload

2013-08-07 Thread Weizhao Li
New submission from Weizhao Li: just a typo: 270c270 < raise ImportError(msg.format(parentname), name=parent_name) --- > raise ImportError(msg.format(parent_name), name=parent_name) -- components: Library (Lib) messages: 194641 nosy: felloak priority: normal seve

[issue18273] Simplify calling and discovery of json test package

2013-08-07 Thread Zachary Ware
Zachary Ware added the comment: Here's a new patch; test_json.__main__ now uses an absolute import rather than trying to use a relative one. Also, Makefile.pre.in is fixed (thank you, Ned!). -- Added file: http://bugs.python.org/file31190/test_json_discovery.v2-3.3.diff __

[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2013-08-07 Thread Zachary Ware
Zachary Ware added the comment: Antoine Pitrou wrote: > I've committed a fix to 2.7 (I hope it's really a fix, since I don't know how > to test it). > I'll let Benjamin and Barry decide whether to backport to 2.6 and 3.2. > As for 3.1, it's pretty much dead. That fix does work, but it should pr

[issue18526] Add resource management/guarding to unittest

2013-08-07 Thread Zachary Ware
Zachary Ware added the comment: (Apologies for the delay in replies, my available time evaporated without notice...) Antoine Pitrou wrote: > Does registerResource() mutate some kind of global per-process state? This > doesn't sound like a good idea. It's not the greatest of ideas, no; but I ha

[issue18676] Queue: document that zero is accepted as timeout value

2013-08-07 Thread Zhongyue Luo
Changes by Zhongyue Luo : Added file: http://bugs.python.org/file31189/queue_timeout_docstring.patch ___ Python tracker ___ ___ Python-bugs-li

[issue18676] Queue: document that zero is accepted as timeout value

2013-08-07 Thread Zhongyue Luo
Changes by Zhongyue Luo : Added file: http://bugs.python.org/file31188/queue_timeout_docstring.patch ___ Python tracker ___ ___ Python-bugs-li

[issue18676] Queue: document that zero is accepted as timeout value

2013-08-07 Thread Zhongyue Luo
Changes by Zhongyue Luo : -- keywords: +patch Added file: http://bugs.python.org/file31187/queue_timeout_docstring.patch ___ Python tracker ___ __

[issue18416] Move to absolute file paths for module.__file__

2013-08-07 Thread Madison May
Madison May added the comment: Nick, it was definitely a good thing to mention. I had to learn the "edit, build, test" cycle the hard way my first time. It took me a good 15-20 minutes to figure out why none of my edits seemed to change anything :) Anyhow, here's how I see the issue. It see

[issue18677] Enhanced context managers with ContextManagerExit and None

2013-08-07 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Hi there. "allowing suppression of exceptions from __enter__ hides local control flow by blurring the boundaries between with and if statements. " I'm not sure what this means. To me, it is a serious language design flaw that you can write a context man

[issue18677] Enhanced context managers with ContextManagerExit and None

2013-08-07 Thread Nick Coghlan
Nick Coghlan added the comment: I pitched the idea of making it possible to skip the with statement body quite some time ago, and Guido convinced me it was a bad idea for much the same reason he chose PEP 343 over his original PEP 340 design: allowing suppression of exceptions from __enter__ hide

[issue18671] enhance formatting in logging package

2013-08-07 Thread Vinay Sajip
Vinay Sajip added the comment: Sorry, not for 2.7 - it's not a bug. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue18671] enhance formatting in logging package

2013-08-07 Thread M. Dietrich
M. Dietrich added the comment: thanks, it will be really helpful for me to have this fixed. as i consider this a "bug" it would be possible to "fix" this for 2.7 and yes you are right, i talked about 2.7 as we are still using this version in production. -- status: pending -> open ___

[issue18676] Queue: document that zero is accepted as timeout value

2013-08-07 Thread R. David Murray
R. David Murray added the comment: Exactly. 0 means "Don't wait, just raise an error immediately if the queue is empty/full". -- ___ Python tracker ___

[issue18679] include a codec to handle escaping only control characters but not any others

2013-08-07 Thread R. David Murray
R. David Murray added the comment: In what way does repr(x)[1:-1] not serve your use case? -- nosy: +r.david.murray ___ Python tracker ___ ___

[issue18676] Queue: document that zero is accepted as timeout value

2013-08-07 Thread Richard Oudkerk
Richard Oudkerk added the comment: > IMHO it just doesn't make sense passing 0.0 as a timeout value. I have written lots of code that looks like timeout = max(deadline - time.time(), 0) some_function(..., timeout=timeout) This makes perfect sense. Working code should not be broken --

[issue18680] JSONDecoder should document that it raises a ValueError for malformed data

2013-08-07 Thread Corey Farwell
Corey Farwell added the comment: Ideally, this would also be decoumented in json.loads/json.load -- ___ Python tracker ___ ___ Python-

[issue18680] JSONDecoder should document that it raises a ValueError for malformed data

2013-08-07 Thread Corey Farwell
New submission from Corey Farwell: Before someone comes in and tries to correct me, I know Python documentation is different than Javadocs. It is common to test if the JSON is malformed using a try...catch. What if I want to catch something more specific than Exception? The only way a user wou

[issue8713] multiprocessing needs option to eschew fork() under Linux

2013-08-07 Thread Richard Oudkerk
Richard Oudkerk added the comment: I have done quite a bit of refactoring and added some extra tests. When I try using the forkserver start method on the OSX Tiger buildbot (the only OSX one available) I get errors. I have disabled the tests for OSX, but it seemed to be working before. Maybe

[issue8713] multiprocessing needs option to eschew fork() under Linux

2013-08-07 Thread Richard Oudkerk
Changes by Richard Oudkerk : Added file: http://bugs.python.org/file31186/b3620777f54c.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue18676] Queue: document that zero is accepted as timeout value

2013-08-07 Thread Zhongyue Luo
Zhongyue Luo added the comment: David, How about like below? elif timeout < sys.float_info.epsilon: raise ValueError("'timeout' must be a positive number") The docstring has been there for quite a while and IMHO it just doesn't make sense passing 0.0 as a timeout value. -- __

[issue18679] include a codec to handle escaping only control characters but not any others

2013-08-07 Thread Derek Wilson
New submission from Derek Wilson: Escaping strings for serialization or display is a common problem. Currently, in python3, in order to escape a sting, you need to do this: 'my\tstring'.encode('unicode_escape').decode('ascii') This would give you a string that was represented like this: 'my\\

[issue13153] IDLE crashes when pasting non-BMP unicode char on Py3

2013-08-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file31185/tkinter_string_conv.patch ___ Python tracker ___ ___ Python-bugs-li

[issue13153] IDLE crashes when pasting non-BMP unicode char on Py3

2013-08-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file31184/tkinter_string_conv.patch ___ Python tracker ___ ___ Python-bugs-

[issue18674] Store weak references in modules_by_index

2013-08-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: (and of course, with module states not being PyObjects, we have the same lifetimes issues as with Py_buffers not being PyObjects) -- ___ Python tracker ___

[issue13153] IDLE crashes when pasting non-BMP unicode char on Py3

2013-08-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Seems as Tk stores pasted "\U000104a2" as surrogate pair "\ud801\udca2". Then it encoded in UTF-8 as "\xed\xa0\x81\xed\xb2\xa2" end passed to Python. Python converts char* to Unicode object with PyUnicode_FromString() which forbids invalid UTF-8 including en

[issue18677] Enhanced context managers with ContextManagerExit and None

2013-08-07 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Simply put, there is no way in the language to nest two context managers, even though we have full access to their implementation model, i.e. can call __enter__ and __exit__ manually. This reflects badly (pun intended) on Python's reflection and intro

[issue11619] On Windows, don't encode filenames in the import machinery

2013-08-07 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue18677] Enhanced context managers with ContextManagerExit and None

2013-08-07 Thread R. David Murray
R. David Murray added the comment: Raising it on python-ideas sounds like a good idea, then. I must admit that I don't understand what you mean by "combining existing context managers into a nested one" that isn't addressed by ExitStack. -- ___ Pyth

[issue18677] Enhanced context managers with ContextManagerExit and None

2013-08-07 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: IMHO, exitstack is not a very nice construct. It's implementation is far longer than contextlib.nested. And the chief problem still remains, which has not been addressed until this patch (as far as I know): In Python, it is impossible to combine exist

[issue18678] Wrong struct members name for spwd module

2013-08-07 Thread R. David Murray
R. David Murray added the comment: Ideally, for backward compatibility reasons we really ought to support access by the old (incorrect) name even in 3.4 (with a deprecation warning, even more ideally). I'm not sure if that's practical? -- nosy: +r.david.murray ___

[issue18678] Wrong struct members name for spwd module

2013-08-07 Thread Vajrasky Kok
New submission from Vajrasky Kok: Both python2 and python3 have this behaviour. >>> import os; os.getuid() 0 >>> 'I am root' 'I am root' >>> import spwd >>> spwd.getspnam('bin') spwd.struct_spwd(sp_nam='bin', sp_pwd='*', sp_lstchg=15558, sp_min=0, sp_max=9, sp_warn=7, sp_inact=-1, sp_expire

[issue18677] Enhanced context managers with ContextManagerExit and None

2013-08-07 Thread R. David Murray
R. David Murray added the comment: Your use cases are either already addressed by contextlib.ExitStack, or should be addressed in the context of its existence. It is the replacement for contextlib.nested. -- nosy: +ncoghlan, r.david.murray ___ Pyth

[issue11619] On Windows, don't encode filenames in the import machinery

2013-08-07 Thread Steven Velez
Steven Velez added the comment: This may be a small use case, but a use case none-the less. In my situation, I am distributing a frozen python package and it runs under the users home directory. If the user's name has international characters, this will fail. I expect we will have similar p

[issue18677] Enhanced context managers with ContextManagerExit and None

2013-08-07 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson: A proposed patch adds two features to context managers: 1)It has always irked me that it was impossible to assemble nested context managers in the python language. See issue #5251. The main problem, that exceptions in __enter__ cannot be properly hand

[issue18671] enhance formatting in logging package

2013-08-07 Thread Vinay Sajip
Vinay Sajip added the comment: >From the line number you mentioned, it looks like you're talking about Python >2.7. However, Python 2.7 is closed to new features: generally speaking, only >bug fixes are supposed to be committed to this branch. I can consider expanding the "Logged from ..." err

[issue18676] Queue: document that zero is accepted as timeout value

2013-08-07 Thread R. David Murray
R. David Murray added the comment: This is more of a documentation issue than a code issue. To be mathematically precise, the text and error message should read "a non-negative value". Alternatively the text and error could be changed to report that timeout may not be negative, which would p

[issue15651] PEP 3121, 384 refactoring applied to elementtree module

2013-08-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > That's true, but I thought one of the goals of PEP 3121 is to > separate > states between sub-interpreters. So that one can't corrupt another. > I'm not > sure how much it matters in practice in this case of the pyexpat > capsule; > need to look into it more.

[issue18676] Queue: zero should not be accepted as timeout value

2013-08-07 Thread Zhongyue Luo
New submission from Zhongyue Luo: The docstring of methods put() and get() in Queue.py states get(): If 'timeout' is a positive number, it blocks at most 'timeout' seconds and raises the Full exception if no free slot was available within that time. put(): If 'timeout' is a positive number, it

[issue15651] PEP 3121, 384 refactoring applied to elementtree module

2013-08-07 Thread Eli Bendersky
Eli Bendersky added the comment: On Wed, Aug 7, 2013 at 6:28 AM, Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > > > First, I think it omits expat_capi from the state. Is that > > intentional? > > What would it do in the state? There's nothing to release. > That's true, but I thou

[issue18668] Properly document setting m_size in PyModuleDef

2013-08-07 Thread Nick Coghlan
Nick Coghlan added the comment: I thought setting m_size to zero was for "No per module state, but reinitialization is fine"? Does that not work? (I haven't actually tried it) -- ___ Python tracker

[issue15651] PEP 3121, 384 refactoring applied to elementtree module

2013-08-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > First, I think it omits expat_capi from the state. Is that > intentional? What would it do in the state? There's nothing to release. > Second, I'm not sure if this approach is fully aligned with PEP 3121. > A global, shared state is still used. Instead of act

[issue15651] PEP 3121, 384 refactoring applied to elementtree module

2013-08-07 Thread Eli Bendersky
Eli Bendersky added the comment: Antoine, some questions about the patch: First, I think it omits expat_capi from the state. Is that intentional? Second, I'm not sure if this approach is fully aligned with PEP 3121. A global, shared state is still used. Instead of actually having a different m

[issue18668] Properly document setting m_size in PyModuleDef

2013-08-07 Thread Eli Bendersky
Changes by Eli Bendersky : -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue18668] Properly document setting m_size in PyModuleDef

2013-08-07 Thread Eli Bendersky
Eli Bendersky added the comment: Thanks for the review! -- resolution: fixed -> stage: committed/rejected -> needs patch status: closed -> open ___ Python tracker ___ __

[issue18668] Properly document setting m_size in PyModuleDef

2013-08-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 698fd628b001 by Eli Bendersky in branch '3.3': Issue #18668: Properly document setting m_size in PyModuleDef http://hg.python.org/cpython/rev/698fd628b001 New changeset 9877c25d9556 by Eli Bendersky in branch 'default': Closing #18668: Properly docu

[issue18671] enhance formatting in logging package

2013-08-07 Thread M. Dietrich
M. Dietrich added the comment: for a logging library the important thing would be to not loose the information that was meant to log. as i said i do alot of long-running huge-data-processing scripts in py using the library. if the logging breaks but doesnt log what was intended to log i judge

[issue13153] IDLE crashes when pasting non-BMP unicode char on Py3

2013-08-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: u'\U000104a2' == u'\ud801\udca2' on narrow build. u'\ud801'.encode('utf-8', 'surrogatepass') == b'\xed\xa0\x81' u'\udca2'.encode('utf-8', 'surrogatepass') == b'\xed\xb2\xa2' Hope it will help. -- ___ Python tracke

[issue15787] PEP 3121, 384 Refactoring

2013-08-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: With respect to PEP 384 refactoring, I would like to see Tools/scripts/abitype.py used for most of the conversions. The PEP itself can probably be amended to advertise this tool more prominently. -- ___ Pytho

[issue15787] PEP 3121, 384 Refactoring

2013-08-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: """ Regarding the suggestion of separating PEP3121 and PEP384. It might be true that datetime and other modules do not benefit directly from PEP 384, however it is still a fact that the stdlib modules should be seen as a set of reference modules, that ar

[issue18675] Daemon Threads can seg fault

2013-08-07 Thread Thomas Guettler
New submission from Thomas Guettler: This is a documentation bug: Since #1856 is not solved for Python2, it needs to be documented. Daemon Threads on Python2 can seg fault. Work arounds: http://stackoverflow.com/questions/18098475/detect-interpreter-shut-down-in-daemon-thread -- ass

[issue15787] PEP 3121, 384 Refactoring

2013-08-07 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue1856] shutdown (exit) can hang or segfault with daemon threads running

2013-08-07 Thread Thomas Guettler
Thomas Guettler added the comment: There are some examples to work around this for Python2: http://stackoverflow.com/questions/18098475/detect-interpreter-shut-down-in-daemon-thread -- nosy: +guettli ___ Python tracker

[issue15787] PEP 3121, 384 Refactoring

2013-08-07 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +PEP 384 inconsistent with implementation ___ Python tracker ___ ___ Python-bugs-li

[issue15787] PEP 3121, 384 Refactoring

2013-08-07 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +PEP 384 Refactoring applied to _csv module title: PEP 3121 Refactoring -> PEP 3121, 384 Refactoring ___ Python tracker ___ ___

[issue15787] PEP 3121 Refactoring

2013-08-07 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +PEP 3121, 384 refactoring applied to curses_panel module ___ Python tracker ___ __

[issue15787] PEP 3121 Refactoring

2013-08-07 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +PEP 3121 Refactoring applied to _csv module ___ Python tracker ___ ___ Python-bugs

[issue18674] Store weak references in modules_by_index

2013-08-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > It seems to me that the more appropriate change here would be to > redefine PyState_FindModule as return a *new* ref rather than a > borrowed ref and have it do the Py_INCREF before returning. > > Code using it would then need to add an appropriate Py_DECREF.

[issue1596321] KeyError at exit after 'import threading' in other thread

2013-08-07 Thread Thomas Guettler
Thomas Guettler added the comment: Only few people seem to use daemon threads. We do and see this problem often with Python 2.7. How difficult is it to get this fixed for 2.7? Is there a way to work around this problem? -- nosy: +guettli ___ Python