[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-04 Thread Serge Matveenko (lig)
New submission from Serge Matveenko (lig): Consider this code in Python 3.5.0: Python 3.5.0 (default, Sep 26 2015, 14:59:25) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from collections import OrderedDict >>> class

[issue17061] tokenize unconditionally emits NL after comment lines & blank lines

2015-10-04 Thread Martin Panter
Martin Panter added the comment: The plain Python shell does respond to lines with only a comment and/or horizontal space with a continuation prompt. It only treats completely blank lines without any horizontal space specially: >>> ... # Indented blank line above; completely blank line

[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-04 Thread Zachary Ware
Zachary Ware added the comment: This is a side-effect of 3.5 having a C implementation of OrderedDict, and will not be fixed. In the standard library, even just having a single trailing underscore is a clear indication of "if you use this, expect it to break without warning at any time."

[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-10-04 Thread Mark Roseman
Mark Roseman added the comment: I see the 3.4.4 is not an immediate concern, so that's good. FYI, I get the (multiple) error messages on console consistently on Mac, but it probably depends how it was launched. Agree the code for future versions should do a better job to detect the theme

[issue12486] tokenize module should have a unicode API

2015-10-04 Thread Martin Panter
Martin Panter added the comment: I agree it would be very useful to be able to tokenize arbitrary text without worrying about encoding tokens. I left some suggestions for the documentation changes. Also some test cases for it would be good. However I wonder if a separate function would be

[issue9969] tokenize: add support for tokenizing 'str' objects

2015-10-04 Thread Martin Panter
Martin Panter added the comment: I left some comments. Also, it would be nice to use the new function in the documentation example, which currently suggests tunnelling through UTF-8 but not adding an encoding comment. And see the patch for Issue 12486, which highlights a couple of other

[issue24848] Warts in UTF-7 error handling

2015-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Test failure is random. With build 3435 tests are successful, with all other are failed. The same with other buildbot: http://buildbot.python.org/all/builders/x86%20Windows7%202.7/ . 3345 and 3347 are green, others are red. --

[issue23919] [Windows] test_os fails several C-level assertions

2015-10-04 Thread STINNER Victor
STINNER Victor added the comment: I would prefer to disable the popups and messages to stderr by default in Python directly. If some users want to see them, we can add a -X option to enable them. Example: -X enable_mscrt_checks. What do you think? Do you recall who complain that Python hides

[issue23919] [Windows] test_os fails several C-level assertions

2015-10-04 Thread STINNER Victor
STINNER Victor added the comment: 23919_1.patch looks good to me. -- ___ Python tracker ___ ___

[issue23919] [Windows] test_os fails several C-level assertions

2015-10-04 Thread Steve Dower
Steve Dower added the comment: I referred to the issues that had -n added in the first place many times while adding the IPH handlers, but I don't have them handy now on my phone. The rationale was that people who cause assertions in their C extensions should see them and not have Python

[issue25301] Optimize UTF-8 decoder with error handlers

2015-10-04 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file40671/bench.py ___ Python tracker ___

[issue25301] Optimize UTF-8 decoder with error handlers

2015-10-04 Thread STINNER Victor
STINNER Victor added the comment: Results of the microbenchmark on the UTF-8 decoder. As expected, performances on valid UTF-8 is unchanged, which was an important goal for me. Decoding with error handlers optimized by the patch are *much* faster. backslashreplace is still slow, because I

[issue25309] askopenfilename crashes on XP with "Show pop-up description for folder and desktop items" on

2015-10-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Your report is good except for defining what you mean by crash and how you ran pickfile.py. (I assume 3.4 with tk 8.6 from your version selection.). (There is also the comment-per-line style. I know that some nasty books and profs inflict this style on new

[issue12939] Add new io.FileIO using the native Windows API

2015-10-04 Thread STINNER Victor
STINNER Victor added the comment: I reopen the issue. The patch is outdated. Richard Oudkerk doens't seem to be active last weeks :-/ -- resolution: out of date -> status: closed -> open ___ Python tracker

[issue25309] askopenfilename crashes on XP with "Show pop-up description for folder and desktop items" on

2015-10-04 Thread alex wieder
alex wieder added the comment: Terry, thanks for your feedback. By crash, I mean python crashing with a Windows c005 error. I can't even capture that exception in a try...except structure. This is on an Intel Core2Duo 2.7GHz with 4 GB of RAM, with Acrobat Reader X installed, which might

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-04 Thread R. David Murray
R. David Murray added the comment: I thought you might be interested to know what the name suggests to a relative newcomer to asyncio. When I saw this issue opened, I though "oh, good, an easy way to submit a coroutine from a thread in my test code, now I don't have to write

[issue25311] Add f-string support to tokenize.py

2015-10-04 Thread Stefan Krah
New submission from Stefan Krah: I think tokenize.py needs to be updated to support f-strings. BTW, the f-string implementation seems to be incredibly robust. Nice work! -- components: Library (Lib) messages: 252274 nosy: eric.smith, skrah priority: normal severity: normal stage:

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-04 Thread Vincent Michel
Vincent Michel added the comment: While I was working on the documentation update, I realized that what we called `run_coroutine_threadsafe` is actually a thread-safe version of `ensure_future`. What about renaming it to `ensure_future_threadsafe`? It might be a bit late since

[issue25308] Multiple names can target the same namespace

2015-10-04 Thread R. David Murray
R. David Murray added the comment: I'd be willing to bet there are people using this as a feature. I don't think we should make any change here. -- nosy: +r.david.murray ___ Python tracker

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-04 Thread Guido van Rossum
Guido van Rossum added the comment: I'm against that idea. I don't really see a great important future for this method either way: It's just a little bit of glue between the threaded and asyncio worlds, and people will learn how to use it by finding an example. The existing ensure_future()

[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-04 Thread Stefan Krah
Stefan Krah added the comment: Wouldn't setting CFLAGS be sufficient? ./configure CFLAGS="-fcheck-pointer-bounds -mmpx" Otherwise we could also add --with-stack-protector and --with-fortify-source and others. I'm not sure if we should add a special --with* option for every gcc flag.

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-04 Thread Yury Selivanov
Yury Selivanov added the comment: > - it is less confusing, because it has the same name and using the same > prototype as `ensure_future` > - it accepts futures and awaitables I like this idea. -- ___ Python tracker

[issue25311] Add f-string support to tokenize.py

2015-10-04 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for noticing tokenize.py. And thanks for the kind note! -- assignee: -> eric.smith ___ Python tracker ___

[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-10-04 Thread Mark Roseman
New submission from Mark Roseman: As a follow-on to #24820, when a particular theme is selected in the configuration files, but that theme is not available, IDLE will print out a bunch of warning messages on console. That can occur for example when using a newer built-in theme in an older

[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-10-04 Thread Mark Roseman
Mark Roseman added the comment: Actually, I think we may be able to get away without the warning message when you select a 'new' theme, and still maintain backwards compatibility. For 'new' themes (i.e. IDLE Dark and any more builtins we add in the future), we write the theme out to the user

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2015-10-04 Thread shanmbic
shanmbic added the comment: I modified the "format_utcoffset" function in "_datetimemodule.c", to accept one more parameter "secondsrequired" . It is a boolean variable (PyObject) , which when set to true, the function will return the offset formatted as "+HH:MM:SS" or "-HH:MM:SS". I also

[issue25312] Cryptic error message if incorrect spec is set on a callable mock

2015-10-04 Thread Tzu-ping Chung
New submission from Tzu-ping Chung: >>> from unittest import mock >>> >>> class Foo: ... def __init__(self, val): ... pass ... def func(self): ... pass ... >>> class FooMock(mock.Mock): ... def _get_child_mock(self, **kwargs): ... return

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-04 Thread Yury Selivanov
Yury Selivanov added the comment: > But honestly I *don't* want to encourage flipping back and forth between > threads and event loops; I see it as a necessary evil. The name we currently > have is fine from the POV of someone coding in the threaded world who wants > to hand off something to

[issue25309] askopenfilename crashes on XP with "Show pop-up description for folder and desktop items" on

2015-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please test Tcl version of your example. wish pickfile.tcl -- nosy: +serhiy.storchaka Added file: http://bugs.python.org/file40673/pickfile.tcl ___ Python tracker

[issue25008] Deprecate smtpd (based on deprecated asyncore/asynchat): write a new smtp server with asyncio

2015-10-04 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm liking RDM's port of smtpd.py. I've done some clean ups, bug fixes, and added some debugging. See this branch over on gitlab: https://gitlab.com/python-smtpd-hackers/aiosmtpd/tree/issue25508 Try `python3 server.py` then run client.py in another

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-04 Thread Guido van Rossum
Guido van Rossum added the comment: @rdm: thanks, you nailed it. :-) @yury: but where would you have gotten the awaitable in the first place? It's easy to see how to get a coroutine -- just define it (with either @coroutine or async def) and call it -- and I think that's the only use case

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-04 Thread Yury Selivanov
Yury Selivanov added the comment: > @yury: but where would you have gotten the awaitable in the first place? It's > easy to see how to get a coroutine -- just define it (with either @coroutine > or async def) and call it -- and I think that's the only use case that > matters here. Just a few

[issue25309] askopenfilename crashes on XP with "Show pop-up description for folder and desktop items" on

2015-10-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: The Windows error, as opposed to Python traceback, is a crash. My machine is probably too fast even if it did have XP. Serhiy: 'wish' is not a normal Windows command.

[issue24820] IDLE themes for light on dark

2015-10-04 Thread Mark Roseman
Mark Roseman added the comment: FYI, the change multiple backgrounds thing is in my working version for the new dialog. Added new issue #25313 to remind us that the warning message is something we'd love to get rid of in the future and as quickly as possible make it unnecessary if we add more

[issue25309] askopenfilename crashes on XP with "Show pop-up description for folder and desktop items" on

2015-10-04 Thread alex wieder
alex wieder added the comment: wish pickfile.tcl? Sorry. Too cryptic for me. I ran the following code from the python interpreter: import tkinter as tk tk.TclVersion tk.TkVersion Both return 8.6. -- ___ Python tracker

[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-10-04 Thread Mark Roseman
Mark Roseman added the comment: Patch write-new-defaults.patch attached so that we write 'newer' default themes to config-highlight.cfg if selected, and ignore them if we already have a default by that name. -- keywords: +patch Added file:

[issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

2015-10-04 Thread Julien Baley
New submission from Julien Baley: The documentation of the action `store_const` states that it defaults to None. In turn, the documentation of `store_true` and `store_false` states that "[t]hese are special cases of 'store_const'", suggesting that they would also default to None. Thankfully,

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-04 Thread Guido van Rossum
Guido van Rossum added the comment: Well, I still worry that this is just going to encourage more people to try and call awaitables from threaded code, and through some circuitous path of misunderstandings (probably involving StackOverflow :-) end up using this function. (Pretty much the

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2015-10-04 Thread Martin Panter
Martin Panter added the comment: I added some comments on Rietveld. I guess the documentation should get notices and What’s New entries saying it is new in 3.6. Test cases would be good, including negative ones to check error handling is sensible if the Z is missing. Also shanmbic, perhaps

[issue25311] Add f-string support to tokenize.py

2015-10-04 Thread Martin Panter
Martin Panter added the comment: I was just about to make the same bug report :) I guess it would be fine to tokenize F-strings as the same string objects as others, it probably just needs adding an F to the right regular expression. $ ./python -btWall -m tokenize "string" 1,0-1,8:

[issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

2015-10-04 Thread R. David Murray
R. David Murray added the comment: There is another issue to fix the documentation for store_const, which does not in fact default to anything. The 'default" in this case is the default for the value stored when the option is specified. So if store_true also implies 'default=False', that

[issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

2015-10-04 Thread Julien Baley
Changes by Julien Baley : Removed file: http://bugs.python.org/file40676/store_true_false_doc.patch ___ Python tracker ___

[issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

2015-10-04 Thread Julien Baley
Julien Baley added the comment: That's true, store_const has no default and will throw an exception if const is not provided. Updated the patch consequently. -- Added file: http://bugs.python.org/file40677/store_const_true_false_doc.patch ___ Python

[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-10-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: There over-arching issue is that IDLE was not built to allow addition of new builtin themes. IDLE New is currently identical to IDLE Classic, so maybe that was intended to allow a revision of IDLE Classic (and I have an idea for that), but IDLE Dark is too

[issue8550] Expose SSL contexts

2015-10-04 Thread Berker Peksag
Changes by Berker Peksag : Removed file: http://bugs.python.org/file40678/entry.tbp ___ Python tracker ___

[issue8550] Expose SSL contexts

2015-10-04 Thread Lance Warrior
Changes by Lance Warrior : Added file: http://bugs.python.org/file40678/entry.tbp ___ Python tracker ___

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2015-10-04 Thread Martin Panter
Changes by Martin Panter : -- components: +Extension Modules -ctypes ___ Python tracker ___

[issue15280] Don't use builtins as variable names in urllib.request

2015-10-04 Thread Martin Panter
Martin Panter added the comment: The name changes to the function parameters should be avoided without a good reason. I would recommend rejecting all of the changes in this patch. They are basically changing one person’s coding style to another person’s style. I happen to prefer list() and

[issue9969] tokenize: add support for tokenizing 'str' objects

2015-10-04 Thread Martin Panter
Martin Panter added the comment: Actually maybe Issue 12486 is good enough to fix this too. With the patch proposed there, tokenize_basestring("source") would just be equivalent to tokenize(StringIO("source").readline) -- ___ Python tracker

[issue15280] Don't use builtins as variable names in urllib.request

2015-10-04 Thread R. David Murray
R. David Murray added the comment: I agree. The one change that has a non-style motivation (type) is one that should not be made for backward compatibility reasons. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed