[issue29673] Some gdb macros are broken in 3.6

2018-04-06 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6106

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33187] Document ElementInclude (XInclude) support in ElementTree

2018-04-06 Thread Ned Deily

Change by Ned Deily :


--
keywords: +easy
stage:  -> needs patch
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33227] Cmd do_something only accepts one argument

2018-04-06 Thread Oz Tiram

Oz Tiram  added the comment:

I am disappointed you want to deprecate CMD. I knew about cmd2 and some other 
alternatives, but I think their execive use of decorators isn't so comfortable. 
That is why I wrote my own module.

I'm also willing to adopt the module and add even more features.

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33238] AssertionError on await of Future returned by asyncio.wrap_future

2018-04-06 Thread Jason Haydaman

Jason Haydaman  added the comment:

May also be worth pointing out that even in the case of only calling set_result 
once, _done_callbacks still has _chain_future in it:


import asyncio
import concurrent.futures


f = concurrent.futures.Future()
async_f = asyncio.wrap_future(f)

f.set_result(1)
loop = asyncio.get_event_loop()
print(loop.run_until_complete(async_f))
print(f._done_callbacks)


>>> 1
>>> [._call_set_state at 0x7f1687f3c620>]


Should that be cleared by that point?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33227] Cmd do_something only accepts one argument

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:

The more I think about it, the more I feel it would be a disservice to our 
users to add piecemeal enhancements like this to the standard library cmd 
module at this point, when cmd is essentially unmaintained and there is already 
a superior alternative.  I have opened Issue33233 suggesting we at least add a 
See Also doc link to cmd2 and to consider potentially deprecating cmd in the 
standard library.  Again, thanks for the suggestion, Oz, but I would like to 
close this issue.

--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29673] Some gdb macros are broken in 3.6

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:


New changeset 3a9ccee0e5dbf7d67f5ab79f6095755969db117c by Ned Deily (Marcel 
Plch) in branch 'master':
bpo-29673: fix gdb scripts pystack and pystackv (GH-6126)
https://github.com/python/cpython/commit/3a9ccee0e5dbf7d67f5ab79f6095755969db117c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29673] Some gdb macros are broken in 3.6

2018-04-06 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6105

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-04-06 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29673] Some gdb macros are broken in 3.6

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:


New changeset 3468a05f6a7d730a656d254730a3f5b6b7e85983 by Ned Deily (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-29673: fix gdb scripts pystack and pystackv (GH-6126) (GH-6400)
https://github.com/python/cpython/commit/3468a05f6a7d730a656d254730a3f5b6b7e85983


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29673] Some gdb macros are broken in 3.6

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:

Thanks, Marcel, for the fix and thanks, Skip, for the review.  Merged for 
release in 3.6.6 and 3.7.0.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-04-06 Thread Brett Cannon

Change by Brett Cannon :


--
pull_requests: +6108

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Guido van Rossum

Guido van Rossum  added the comment:

But cmd is used by pdb. Do you recommend we deprecate that too? (There are 
countless 3rd party alternatives, but I sure prefer to have it in the stdlib, 
so I can start debugging without first having to install a dependency.)

--
nosy: +gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:


New changeset ef5ce884a41c8553a7eff66ebace908c1dcc1f89 by Ned Deily (Jay 
Crotts) in branch 'master':
bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179)
https://github.com/python/cpython/commit/ef5ce884a41c8553a7eff66ebace908c1dcc1f89


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-04-06 Thread Brett Cannon

Brett Cannon  added the comment:

All done in 3.7 and master.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-04-06 Thread Brett Cannon

Brett Cannon  added the comment:


New changeset a09bb87c1eebb07b01b8105cf536704893aec565 by Brett Cannon in 
branch '3.7':
[3.7] bpo-33169: Remove values of `None` from sys.path_importer_cache when 
invalidating caches (GH-6402) (GH-6403)
https://github.com/python/cpython/commit/a09bb87c1eebb07b01b8105cf536704893aec565


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-06 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

> I was hoping to see if this was seen as a reasonable patch that might be 
> accepted.

I didn't look carefully but superficially it looks reasonable, so it is worth 
trying.

> Also, while I think it would be nice, I take it a patch for this would be 
> unlikely to be backported, right?

I think this is unlikely because it affects some public APIs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33185] Python 3.7.0b3 fails in pydoc where b2 did not.

2018-04-06 Thread Ned Deily

Change by Ned Deily :


--
priority: critical -> release blocker
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17861] put opcode information in one place

2018-04-06 Thread Ned Deily

Change by Ned Deily :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:


New changeset 98e8ac8d82202aae32961f10b1014641ae1fffbf by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
[3.7] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch 
(GH-5179) (GH-6404)
https://github.com/python/cpython/commit/98e8ac8d82202aae32961f10b1014641ae1fffbf


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Guido van Rossum

Guido van Rossum  added the comment:

Well, is cmd2 stabilizing, or is it still changing at a rate too fast for 
inclusion in the stdlib? Does it perhaps have a mix of desirable and wacky 
features? Or could we just copy much of it into the stdlib as 'cmd'?

I'm a bit concerned about the idea that we should not upgrade stdlib modules 
because a better 3rd party alternative exists -- and I'm kind of assuming that 
those 3rd party module authors are also somewhat disappointed that their 
modules are not used to improve the stdlib. (PyPI not withstanding.)

Often (like in this case) there's just no chance of getting rid of the stdlib 
module, so we're just stuck with a duplication of functionality.

Note that every case is a bit different. But I'm not ready to give up on the 
idea that Python comes with batteries included. We should not let those 
batteries corrode and leak.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:

> But I'm not ready to give up on the idea that Python comes with batteries 
> included. We should not let those batteries corrode and leak.

I totally agree with you.  And it would be great if cmd2 could be incorporated 
into the std lib as an updated cmd.  cmd seems to be largely abandoned in the 
std lib: looking at the commit history for it shows few changes in the past 
decade or so and I'm not aware that any current core developer feels ownership 
of it: I might be wrong.  But it certainly is true that cmd2 has seen much more 
activity recently than cmd has.  So I would think that the ideal solution would 
be for the cmd2 project to take ownership of cmd in the std library.  OTOH, it 
seems like we haven't always had good long-term results in the past when trying 
to bring existing third-party packages into the std lib.  But it could be worth 
trying again, if someone were willing to shepherd it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:

I've asked on python-dev for comments:

https://mail.python.org/pipermail/python-dev/2018-April/152653.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-04-06 Thread Brett Cannon

Change by Brett Cannon :


--
keywords: +patch
pull_requests: +6107
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:

@barry, I was thinking more of 3.8 but, sure, if there seems to be a consensus 
prior to 3.7.0b4 that deprecation is the right thing, we could do it in 3.7.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-04-06 Thread Brett Cannon

Brett Cannon  added the comment:


New changeset 9e2be60634914f23db2ae5624e4acc9335bf5fea by Brett Cannon in 
branch 'master':
bpo-33169: Remove values of `None` from sys.path_importer_cache when 
invalidating caches (GH-6402)
https://github.com/python/cpython/commit/9e2be60634914f23db2ae5624e4acc9335bf5fea


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

(Previously posted on Python-Dev.)

I think the documentation note is a good idea.

But I disagree with deprecating "cmd" unless it is actively falling
apart and no longer working, not just languishing with no feature
improvements. Just in the last week, I've been reminded twice that many
people using Python do so where they cannot just arbitrarily pip install
, and if a library isn't in the std lib, they can't use it
without a lot of pain:

https://mail.python.org/pipermail/tutor/2018-April/112817.html

https://mail.python.org/pipermail/tutor/2018-April/112818.html

--
nosy: +steven.daprano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

FWIW, I've been teaching cmd to my clients for years and it has worked fine for 
them.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:


New changeset 77f0a41d72886513f5e9277e5587455745c29ac1 by Ned Deily (Miss 
Islington (bot)) in branch '2.7':
[2.7] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch 
(GH-5179) (GH-6405)
https://github.com/python/cpython/commit/77f0a41d72886513f5e9277e5587455745c29ac1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:


New changeset 70c44465475c41ab3aa832858b250ede6f170aac by Ned Deily (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch 
(GH-5179) (GH-6406)
https://github.com/python/cpython/commit/70c44465475c41ab3aa832858b250ede6f170aac


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:

Thank you for producing the PR, Jay!

--
components:  -Extension Modules
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type: enhancement -> 
versions: +Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33227] Cmd do_something only accepts one argument

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:

Oz, I don't particularly like the idea of deprecating cmd but, realistically, 
Python development is almost entirely an unpaid, volunteer activity and we do 
not have enough resources to do everything we'd like to do.  So sometimes we 
need to make a tradeoff and this seems like it might be a good opportunity to 
make one that will benefit most people.  It's not my decision to make in 
isolation so I've sent a mail to the python-dev list asking other core 
developers and interested parties to comment on Issue33233.  So, let's keep 
this open until we resolve that issue and feel free to comment there.  Thanks 
again for your interest!

https://mail.python.org/pipermail/python-dev/2018-April/152653.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13940] imaplib: Mailbox names are not quoted

2018-04-06 Thread Mark Lawrence

Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

@ned.deily - are you proposing to officially deprecate it for 3.7?  If we're 
going to do it, let's do it now so we can remove it for 3.9.  It seems like a 
reasonable strategy to push folks toward cmd2 and clean up our stdlib.

--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:

(See Issue33185 for regression.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Guido van Rossum

Guido van Rossum  added the comment:

I'm fine with linking to cmd2, we do that for some other modules too.
(Though I think it's somewhat arbitrary. E.g. do we link to requests
anywhere? Or to all the "better pdb" modules?)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29673] Some gdb macros are broken in 3.6

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:


New changeset 3c193cf8afce525b1283986f113de0e16f23e115 by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
[3.7] bpo-29673: fix gdb scripts pystack and pystackv (GH-6126) (GH-6399)
https://github.com/python/cpython/commit/3c193cf8afce525b1283986f113de0e16f23e115


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:

> cmd is used by pdb

Well, that's a pretty good reason for not removing cmd!  I really wasn't 
advocating its removal, just gently pushing users to use cmd2.  So perhaps we 
should only add a "See Also" like we do for urllib.request and close any new 
feature request issues?

>  See also: The Requests package is recommended for a higher-level
>  HTTP client interface.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:

> FWIW, I've been teaching cmd to my clients for years and it has worked fine 
> for them.

I'm not saying that cmd is bad; it's just that there have been suggested 
improvements over the years and many of those are already implemented in cmd2, 
which is supposed to be generally upward compatible from cmd.  (I don't know 
how accurate that is in practice.)  The main reason for bringing this up is 
that it seems to me that, rather than trying to duplicate effort by 
re-implementing new features for cmd that are already in cmd2, we should point 
at cmd2 for new users who want those features.  So, as Guido pointed out, with 
a customer of cmd in the std library (e.g. pdb), we shouldn't remove it.  But 
we can still set expectations that there aren't going to be new features in 
cmd.  Does that sound reasonable to everyone?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2018-04-06 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6110

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2018-04-06 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6109

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2018-04-06 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6111

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Ned Deily

Ned Deily  added the comment:

> (Though I think it's somewhat arbitrary.

Yes, it is.

> E.g. do we link to requests anywhere?

Yes:
https://docs.python.org/3/library/urllib.request.html

> Or to all the "better pdb" modules?)

Not that I'm aware of.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Catherine Devlin

Catherine Devlin  added the comment:

Hi, everybody!  I really appreciate the kind words about cmd2.

For several years now, Todd Leonhardt has been cmd2's primary maintainer, so I 
may be speaking out of turn.  But, before I wanted to let it get within 
screaming distance of the standard library, I would want to refactor it like 
mad; maybe even remove some features that were created more in a spirit of 
gee-whiz-I-can-do-this than real need.  Todd and I have worked a little on such 
a refactor, but even once we make time to actually complete it, that would make 
cmd2 by definition too unstable until the refactored version itself had earned 
some grey hair.

Also, cmd2 depends on pyparsing, which is itself unlikely to be in the standard 
library.

I think a "see also" list attached to standard library module docs would be 
great, and if this helps nucleate a decision about whether/how to do that for a 
bunch of modules, that would be great.

--
nosy: +catherinedevlin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

>  cmd seems to be largely abandoned in the std lib: 

I'm not sure why the absence of bugs indicates abandonment.  We almost never 
touch defaultdict, in part because the code is straight-forward, tested, and 
not buggy.  If a bug were reported for cmd, I would be happy to work on it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-06 Thread Todd Leonhardt

Todd Leonhardt  added the comment:

The cmd2 project is in the process of rapidly stabilizing, but it isn't quite 
there yet.

The other cmd2 core maintainers and I do have a bunch of refactoring planned 
over the next 6 to 8 months or so.  Right now @kotfu (Jared Crapo) is working 
on replacing pyparsing with shlex.  Since shlex is built into Python, that 
removes one 3rd party dependency.   In early September we plan on abandoning 
support for Python 2.7 for future releases which will enable us to remove 
dependencies on most of the other 3rd party libraries we currently depend upon 
and to dramatically clean the code up in numerous other ways.  The one third 
party dependency which will be left is pyperclip, but honestly that isn't very 
well maintained and I've been thinking about removing the functionality we use 
it for (clipboard copy/paste).

Another core cmd2 maintainer, @kmvanbrunt (Kevin Van Brunt) has been toying 
with the idea of forking it and creating a lighter and simpler version with a 
reduced feature set.  If it is something the core developers view as desirable, 
I think it would perhaps be a viable path forward to have the cmd2 maintainers 
take over maintenance of cmd and to move towards that becoming the lightweight 
reduced feature set version and cmd2 living on as the heavier weight more full 
featured extension of cmd (but many of the current features of cmd2 could be 
merged into cmd).

--
nosy: +tleonhardt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33231] Potential memory leak in normalizestring()

2018-04-06 Thread INADA Naoki

INADA Naoki  added the comment:

> Only reason I can see to avoid this would be if the codec names could contain 
> arbitrary Unicode encoded as UTF-8 (and therefore strlen wouldn't tell you 
> the final length in Unicode ordinals), but I'm pretty sure that's not the 
> case (if it is, we're not normalizing properly, since we only lower case 
> ASCII). If Unicode codec names need to be handled, there are other options, 
> though the easy savings go away.

Maybe, we can add "encoding name must be ascii" restriction in future version 
(3.8+).
But for now, I want to avoid any potential backward incompatibility.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33231] Potential memory leak in normalizestring()

2018-04-06 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6102

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33231] Potential memory leak in normalizestring()

2018-04-06 Thread miss-islington

miss-islington  added the comment:


New changeset 64421d9237e33725e3c2916cdf2b6d6da1751c2a by Miss Islington (bot) 
in branch '3.7':
bpo-33231: Fix potential leak in normalizestring() (GH-6386)
https://github.com/python/cpython/commit/64421d9237e33725e3c2916cdf2b6d6da1751c2a


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33236] MagicMock().__iter__.return_value is different from MagicMock().__iter__()

2018-04-06 Thread Robert

New submission from Robert :

According to the documentation .return_value should be identical to the object 
returned when calling the mock ("assert m() is m.return_value")

This is the case except on objects returned by __iter__ on MagicMocks. The 
following script demonstrates the problem:

from unittest.mock import MagicMock
m = MagicMock()
assert x.__iter__() is x.__iter__.return_value# <- fails


In fact __iter__() returns the object "iter([])" (which matches the 
documentation) while __iter__.return_value return a MagicMock object (which 
does not match the documentation).

When replacing "__iter__" with any other special function MagicMock works as 
expected.

--
components: Library (Lib)
messages: 315016
nosy: mrh1997
priority: normal
severity: normal
status: open
title: MagicMock().__iter__.return_value is different from 
MagicMock().__iter__()
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33231] Potential memory leak in normalizestring()

2018-04-06 Thread INADA Naoki

Change by INADA Naoki :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5305] imaplib should support international mailbox names

2018-04-06 Thread Alexander Harkness

Alexander Harkness  added the comment:

ssu

--
nosy: +bearbin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13940] imaplib: Mailbox names are not quoted

2018-04-06 Thread Alexander Harkness

Change by Alexander Harkness :


--
nosy: +bearbin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33235] Better help text for dict.setdefault

2018-04-06 Thread Paddy McCarthy

New submission from Paddy McCarthy :

Hi, I was answering some question and used dict.setdefault as part of the 
solution and posted the help() on it as part of my answer.

The help was this:

In [15]: help(mapper.setdefault)
Help on built-in function setdefault:

setdefault(...) method of builtins.dict instance
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D

This seems the wrong way around. Is it not better expressed as

D.setdefault(k[,d]) -> set D[k]=d if k not in D and then D.get(k,d)

--
assignee: docs@python
components: Documentation
messages: 315015
nosy: Paddy McCarthy, docs@python
priority: normal
severity: normal
status: open
title: Better help text for dict.setdefault
type: enhancement
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13940] imaplib: Mailbox names are not quoted

2018-04-06 Thread Alexander Harkness

Change by Alexander Harkness :


--
pull_requests: +6103
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33231] Potential memory leak in normalizestring()

2018-04-06 Thread INADA Naoki

INADA Naoki  added the comment:


New changeset 0c1c4563a65ac451021d927058e4f25013934eb2 by INADA Naoki in branch 
'master':
bpo-33231: Fix potential leak in normalizestring() (GH-6386)
https://github.com/python/cpython/commit/0c1c4563a65ac451021d927058e4f25013934eb2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33231] Potential memory leak in normalizestring()

2018-04-06 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6101

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33231] Potential memory leak in normalizestring()

2018-04-06 Thread miss-islington

miss-islington  added the comment:


New changeset 2350a4765265158072bf7ad9f04402406d3d1ada by Miss Islington (bot) 
in branch '3.6':
bpo-33231: Fix potential leak in normalizestring() (GH-6386)
https://github.com/python/cpython/commit/2350a4765265158072bf7ad9f04402406d3d1ada


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33231] Potential memory leak in normalizestring()

2018-04-06 Thread INADA Naoki

Change by INADA Naoki :


--
resolution:  -> fixed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33237] Improve AttributeError message for partially initialized module

2018-04-06 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +6104
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33210] pkgutil.walk_packages gives incomplete results

2018-04-06 Thread Nick Coghlan

Nick Coghlan  added the comment:

I think this is actually two distinct problems, one documentation one (which 
should be addressed in the online docs for all currently maintained versions), 
and one actual functional issue.

The documentation issue is the one you've reported: in order for the recursive 
descent to work in walk_packages given the current algorithm, then the 
combination of the given prefix, and the current global import configuration 
must allow that package to actually be imported. While there is a note about 
that limitation, it's currently thoroughly unclear.

The functional issue is two-fold:

1. pkgutil.iter_modules() doesn't identify PEP 420 namespace packages correctly 
(it ignores them as not being potential packages)

2. The recursive import to check pkg.__path__ uses a name based global 
__import__ rather than the more state independent 
https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly
 technique

It's that second problem that introduces the "prefix must be set to get useful 
output" behaviour that you're currently seeing.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33237] Improve AttributeError message for partially initialized module

2018-04-06 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Cyclic import usually leads to an AttributeError "module 'spam' has no 
attribute 'ham'" which usually is confusing because in normal case 'spam.ham' 
exists, and the user can have no ideas why it is disappeared.

The proposed PR allows to specialize the AttributeError message for partially 
initialized module. Any suggestions about the error message?

--
components: Interpreter Core
messages: 315019
nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve AttributeError message for partially initialized module
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33210] pkgutil.walk_packages "prefix" option docs are misleading

2018-04-06 Thread Nick Coghlan

Nick Coghlan  added the comment:

https://bugs.python.org/issue29258 is an existing issue for the PEP 420 
limitation (it also notes why fixing that implicitly is a potential problem)

I've retitled this issue to be specifically about the misleading docs for the 
"prefix" option (and updated the metadata accordingly).

"Recursive descent in pkgutil.walk_packages depends on sys.path" would be a 
reasonable title for an issue to actually fix the operation to use a better 
algorithm based on newer importlib APIs, but I haven't filed that myself.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
title: pkgutil.walk_packages gives incomplete results -> pkgutil.walk_packages 
"prefix" option docs are misleading
versions: +Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32933] mock_open does not support iteration around text files.

2018-04-06 Thread Éric Araujo

Éric Araujo  added the comment:

Is this related to #33236 ?

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32933] mock_open does not support iteration around text files.

2018-04-06 Thread Anthony Flury

Anthony Flury  added the comment:

No - it isn't related.

In the case of mock_open; it isn't intended to be a simple MagicMock - it is 
meant to be a mocked version of open, and so to be useful as a testing tool, it 
should emulate a file as much as possible.  

When a mock_open is created, you can provide an argument 'read_data' which is 
meant to be the data from your mocked file, so it is key that the dunder iter 
method actually returns an iterator. The mock_open implementation already 
provides special versions of read, readline and readlines methods which use the 
'read_data' initial value as the content.
Currently though the dunder iter method isn't set at all - so the returned 
value would currently be an empty iterator (which makes mock_open unable to be 
used to test idiomatic python : 

def display(file_name):
with open('a.txt', 'r') as fp:
for line in fp:
print(line)  

As a trivial example the above code when mock_open is used will be equivalent 
of opening an empty file,  but this code : 

def display(file_name):
with open('a.txt', 'r') as fp:
while True:
line = readline(fp)
if line == '':
break
print(line)

Will work correctly with the data provided to mock_open.

Regardless of how and when #33236 is solved - a fix would still be needed for 
mock_open to make it provide an iterator for the mocked file.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33214] join method for list and tuple

2018-04-06 Thread Éric Araujo

Change by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33235] Better help text for dict.setdefault

2018-04-06 Thread Éric Araujo

Éric Araujo  added the comment:

Note that if we switch the order like you propose, we don’t need to use 
dict.get:


  set D[k]=d if k not in D then return D[k]


I suspect the current doc was written the way it is because it matches the 
actual implementation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33235] Better help text for dict.setdefault

2018-04-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Changing docstring can break existing code, therefore it should go only in 
future new Python version unless it contains a bug. The current docstring in 
3.6 doesn't look incorrect to me. The docstring in 3.7 is different.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33237] Improve AttributeError message for partially initialized module

2018-04-06 Thread Nick Coghlan

Nick Coghlan  added the comment:

While I like the idea of this change, the "partially initialized" addition is 
fairly subtle, and relatively easy to miss.

Perhaps append "(most likely due to a circular import)" to the partially 
initialized case?:

AttributeError: partially initialized "module 'spam' has no attribute 'ham' 
(most likely due to a circular import).

Crucially, for folks encountering the error for the first time, that also 
introduces them to the main phrase they may want to search for: "circular 
import".

The "most likely" weasel wording stems from the fact that the problem won't 
always be with the circular import - they may have just straight up referenced 
the wrong module or the wrong attribute name, so the apparently circular import 
is an error.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33189] pygettext doesn't work with f-strings

2018-04-06 Thread Éric Araujo

Change by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33235] Better help text for dict.setdefault

2018-04-06 Thread Éric Araujo

Éric Araujo  added the comment:

The two lines are equivalent!

`d.setdefault(key, default)` does return the same thing as `d.get(key, 
default)`, and then sets `d[key] = default` if the get method went into the 
“key was not found, let’s return default” branch.

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33227] Cmd do_something only accepts one argument

2018-04-06 Thread Éric Araujo

Éric Araujo  added the comment:

I think using shlex unconditionally to parse lines sent to cmd.Cmd may not be 
ideal.

Cmd is very generic and there are many ways to parse lines into arguments:
- no parsing (think Python shells or remote command execution)
- shlex (makes sense for unix users, maybe not others)
- parse_ints as in your example (lexing + conversion)
- optparse (I read about a tool where the interactive command format was the 
same as the command-line arguments format, which makes is super easy to support 
all commands in a config file or “session replay” file!)
- many more.

Could the shlex parsing be in a subclass?  Or is it small enough to be in the 
docs?  If it’s not small, maybe the base Cmd class needs to be reworked to make 
it easier to hook into line parsing?

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33230] _decimal build failure (unsupported platform for that module) - evolution possible?

2018-04-06 Thread Hubert Holin

Hubert Holin  added the comment:

This is correct: I had an older version of mpdecimal in /usr/local. However, 
when removed mpdecimal is (manually) removed from /usr/local (the libs and the 
header), making a "make clean", a config and make, the _decimal build still 
fails, but this time for a different reason:

/Developer/Python/3.6/Python/Python-3.6.5/Modules/_decimal/_decimal.c:34:10: 
fatal error: 'mpdecimal.h' file not found
#include "mpdecimal.h"

Still, we are getting closer: should I install a newer version of mpdecimal and 
try again?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33230] _decimal build failure (unsupported platform for that module) - evolution possible?

2018-04-06 Thread Stefan Krah

Stefan Krah  added the comment:

It looks to me as if you are compiling --with-system-libmpdec.

You don't need that, libmpdec is included in the Python tarball.

-with-system-libmpdec was added mainly for Linux distros.  If there's a 
widespread interest to support it on OS X, I'd need a patch.



A hack that should work is "export PYTHON_DECIMAL_WITH_MACHINE=universal" 
during the Python build, then the external libmpdec *might* work.

This flag was mainly added for testing. Note that "universal" does not always 
build fat binaries -- it uses whatever Python is configured with.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33230] _decimal build failure (unsupported platform for that module) - evolution possible?

2018-04-06 Thread Stefan Krah

Stefan Krah  added the comment:

Another source of error is of course if the external libmpdec was not compiled 
as "universal" but Python is.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33238] AssertionError on await of Future returned by asyncio.wrap_future

2018-04-06 Thread Jason Haydaman

New submission from Jason Haydaman :

When the concurrent Future wrapped by asyncio.wrap_future has set_result or 
set_exception called multiple times, I get the following traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/asyncio/events.py", line 145, in _run
self._callback(*self._args)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 399, in _set_state
_copy_future_state(other, future)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 369, in 
_copy_future_state
assert not dest.done()
AssertionError


Minimal reproducible example:

import asyncio
import concurrent.futures

f = concurrent.futures.Future()
async_f = asyncio.wrap_future(f)
f.set_result(1)
f.set_result(1)

loop = asyncio.get_event_loop()
loop.run_until_complete(async_f)


The documentation says that set_result and set_exception are only meant for 
Executors, so, arguably using them outside of that context would fall into 
undocumented behavior rather than a bug. But it still seems like it should be 
the second set_result that raises something like InvalidStateError. 
Alternatively, this can be avoided if _copy_future_state checks for done in 
addition to cancellation. What should happen here?

--
components: Library (Lib), asyncio
messages: 315030
nosy: Jason Haydaman, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: AssertionError on await of Future returned by asyncio.wrap_future
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com