[issue36201] AssertCountEqual does not work for nested dictionaries.

2020-10-17 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> rejected
stage:  -> 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



[issue33129] Add kwarg-only option to dataclass

2020-10-17 Thread Ryan Hiebert


Change by Ryan Hiebert :


--
nosy: +ryanhiebert

___
Python tracker 

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



[issue41983] Missing Documentation AF_PACKET

2020-10-17 Thread Martin Panter


Martin Panter  added the comment:

According to the documentation at 
 and Issue 
25041 it is only available on Linux. What documentation are you looking at?

--
nosy: +martin.panter

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-17 Thread Tim Peters


Tim Peters  added the comment:

Yup, they act essentially the same, but yours jumps into the quicksand earlier 
;-)

I'm fond of this one:

"""
HUGE = 10**7
BIG = 10**6

bigxs = 'x' * BIG

haystack = 'x' * HUGE
needle = bigxs + 'y' + bigxs
"""

"The problem" then is in middle of the needle, not at either end, so really 
simple tricks all fail. For example, set(haystack) is a subset of set(needle), 
so our "Bloom filter" is useless, and needle[-1] == needle[-2], so our "skip" 
count is the useless 0.  Pure brute force is quadratic-time, and we're even 
slower because we're paying over & over to try heuristic speedups that happen 
never to pay off.

Two-way splits the needle as

u = bigxs
v = 'y' + bigxs

and again never gets out of the "try to match the right part" phase. Each time 
around it fails to match 'y' on the first try, and shifts right by 1.  Boring, 
but linear time overall.

--

___
Python tracker 

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



[issue42062] Usage of HTTPResponse.url

2020-10-17 Thread Martin Panter


Martin Panter  added the comment:

There is a comment in the HTTPResponse class regarding these methods:

# For compatibility with old-style urllib responses.

They were there for the "urlopen" API in "urllib.request", not for the 
"http.client" module on its own. I expect the "url" attribute is set by the 
"urlopen" code.

However more recently (Issue 12707) the "url" attribute and "geturl" method 
were documented in the HTTPResponse documentation, which is awkward.

--
nosy: +martin.panter

___
Python tracker 

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



[issue40509] In argparse, allow REMAINDER(...) arguments in a mutually exclusive group

2020-10-17 Thread paul j3


paul j3  added the comment:

A more recent issue shows that the use of a '*' positional in a 
multually_exclusive_group is poorly understood and documented.  

https://bugs.python.org/issue41854

That's part of why I am not enthusiastic about extending this to include 
REMAINDER.  

And on rereading Shani's posts, I realize I don't understand what this has to 
do with subcommands.  Is this the 'add_subparsers' mechanism, or just the idea 
of using a trailing part of sys.argv as input to another parser or script?

I think discussion of this topic can only proceed with some concrete examples, 
and may be even a proposed code change (not necessarily a formal patch or pull 
request).

--

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-17 Thread Guido van Rossum

Guido van Rossum  added the comment:

Right, so IIUC the *quadratic* portion of Dennis’ original reproducer, aBaBBB 
with pattern BBB, except with more cowbell :-) acts the same.

--

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-17 Thread Tim Peters


Tim Peters  added the comment:

I don't think we have any idea how the OP stumbled into this. Looks like it 
"just happened".

The case you construted is quadratic-time, but not quite as bad:

BaB
BB

Fails at once, because 'a' doesn't match the trailing needle 'B'. The Bloom 
filter is useless because the next haystack 'B' _is_ in the needle.  So shift 
right 1:

BaB
xBB

Last character matches, so goes on to compare 4 Bs and an aB mismatch. 6 in 
all. Bloom filter useless again, and another shift by 1:

BaB
xxBB

Now there's 1 less compare, because only 3 Bs match.

And so on.  After the next shift, only 2 Bs match, and after the shift 
following that, only 1 B.  Getting to:

BaB
xBB

Now after matching the trailing Bs, aB mismatches at once.  And we're done, 
because another shift by 1 moves the end of the needle beyond the end of the 
haystack (although I bet the Bloom filter reads up the trailing NUL byte from 
the haystack and actually makes a "giant" shift).

You're right that two-way yawns at this ;-)  'B' * (K*2) is split into

u = "" # empty string!
v = 'B' * (K*2)

so only the "match the right half" part of the searching algorithm comes into 
play.

BaB
BB

first mismatches at the 6th character (1-based counting - at index 5), so it 
shifts right by 6:

BaB
xxBB

And it's done, because the needle has moved beyond the end of the haystack.

The brainpower that went into making this "look trivial" is quite impressive :-)

--

___
Python tracker 

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



[issue42050] ensurepip fails if cwd contains illformed setup.cf

2020-10-17 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00, dstufft, ncoghlan, pradyunsg

___
Python tracker 

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



[issue42057] pytest case which catch exceptions become segfault

2020-10-17 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

This may be irrelevant at this point, but trying to understand the original 
reproducer, I wanted to add my 1c worth.

It seems Dennis' reproducer.py is roughly this:

(I'm renaming BIG//3 to K to simplify the math.)

aBaBBB (haystack, length K*6)
BBB(needle, length K*3)

The needle matches exactly once, at the end.  (Dennis uses BIG==10**6, which 
leaves a remainder of 1 after dividing by 3, but that turns out to be 
irrelevant -- it works with BIG==99 as well.)

The reproducer falls prey to the fact that it shifts the needle by 1 each time 
(for the reason Tim already explained).  At each position probed, the sequence 
of comparisons is (regardless of the bloom filter or skip size, and stopping at 
the first mismatch):

- last byte of needle
- first, second, third, etc. byte of needle

As long as the needle's first character corresponds to an 'a' (i.e., K times) 
this is just two comparisons until failure, but once it hits the first run of 
'B's it does K+1 comparisons, then shifts by 1, does another K+1 comparisons, 
and so on, for a total of K times. That's K**2 + K, the source of the slowdown. 
Then come K more quick misses, followed by the final success.

(Do we know how the OP found this reproducer? The specific length of their 
needle seems irrelevant, and I don't dare look in their data file.)

Anyway, thinking about this, for the current (unpatched) code, here's a 
somewhat simpler reproducer along the same lines:

BaB (haystack, length K*3)
BB  (needle, length K*2)

This immediately starts doing K sets of K+1 comparisons, i.e. K**2 + K again, 
followed by failure.


I am confident this has no relevance to the Two-Way algorithm.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue18857] urlencode of a None value uses the string 'None'

2020-10-17 Thread James Addison


James Addison  added the comment:

Thanks Senthil; please take your time.  This isn't urgent, and would likely 
benefit from further standardization of the URL query string and/or 
form-encoded data formats (outside the Python project) to achieve consensus.

A fully-considered answer at a later date would probably sit more comfortably 
with me than one that has any sense of time pressure.

--

___
Python tracker 

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



[issue36201] AssertCountEqual does not work for nested dictionaries.

2020-10-17 Thread Irit Katriel


Irit Katriel  added the comment:

Should this be closed as won't fix?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue18857] urlencode of a None value uses the string 'None'

2020-10-17 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Hi James, I will give another look at it tonight or latest by Sunday PST ,
since I was involved in this and PRs. If we can make a decision within this
context, great, otherwise we can open it up to python-dev

On Sat, Oct 17, 2020 at 3:30 PM James Addison 
wrote:

>
> James Addison  added the comment:
>
> No problem, and thanks for the heads-up Tal!  I'll raise this as a topic
> on python-dev if it still seems worth pursuing, after collecting some more
> thoughts about it.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue18857] urlencode of a None value uses the string 'None'

2020-10-17 Thread James Addison


James Addison  added the comment:

No problem, and thanks for the heads-up Tal!  I'll raise this as a topic on 
python-dev if it still seems worth pursuing, after collecting some more 
thoughts about it.

--

___
Python tracker 

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



[issue37555] _CallList.__contains__ doesn't always respect ANY.

2020-10-17 Thread Elizabeth Uselton


Elizabeth Uselton  added the comment:

I believe it should work in both 3.8 and 3.9, the difference is that someone 
(Serhiy if I'm remembering correctly?) did the work in 3.9 of standardizing 
which side of the = the needle was on. So, this change works on 3.9 without the 
_AnyComparer class I added, but I believe unless _AnyComparer has been removed, 
this change would work in 3.8. Xtreak, it seems like most of your concerns 
about backporting it are about how complicated this part of the code is, and 
wanting it to get more testing via the mock backport? Is there any way I can 
help mitigate those concerns, or keep up with how much use it's gotten from the 
mock backport so we can determine when (if ever) it would be a good time to 
backport this?

--

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-17 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

> But there _also_ seem to be real (but much smaller) benefits
> for the "search backward" cases, which I don't recall seeing
> when I tried it.  Do you have a guess as to why?

I did change `skip = mlast - 1;` to `skip = mlast;` as you had pointed out.
So it could be that, or just a compiler/benchmark ghost.

--

___
Python tracker 

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



[issue40507] FileNotFound error raised by os.exec* doesn't contain filename

2020-10-17 Thread Tal Einat


Change by Tal Einat :


--
type:  -> enhancement
versions: +Python 3.10 -Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue40507] FileNotFound error raised by os.exec* doesn't contain filename

2020-10-17 Thread Tal Einat


Tal Einat  added the comment:

I agree that having the error message include the executable name could be 
useful.

--
nosy: +taleinat

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-17 Thread Tim Peters


Tim Peters  added the comment:

When I ran stringbench yesterday (or the day before - don't remember), almost 
all the benefit seemed to come from the "late match, 100 characters" tests.  
Seems similar for your run.  Here are your results for just that batch, 
interleaving the two runs to make it easy to see:  first line from the "before" 
run, second line from the "after" (PR) run, then a blank line.  Lather, rinse, 
repeat.

These are dramatic speedups for the "search forward" cases.  But there _also_ 
seem to be real (but much smaller) benefits for the "search backward" cases, 
which I don't recall seeing when I tried it.  Do you have a guess as to why?

== late match, 100 characters
bytes   unicode
(in ms) (in ms) ratio%=bytes/unicode*100
2.733.8870.4s="ABC"*33; ((s+"D")*500+s+"E").find(s+"E") (*100)
0.170.15116.3   s="ABC"*33; ((s+"D")*500+s+"E").find(s+"E") (*100)

2.013.5456.8s="ABC"*33; ((s+"D")*500+"E"+s).find("E"+s) (*100)
0.890.87101.8   s="ABC"*33; ((s+"D")*500+"E"+s).find("E"+s) (*100)

1.662.3670.2s="ABC"*33; (s+"E") in ((s+"D")*300+s+"E") (*100)
0.150.13111.5   s="ABC"*33; (s+"E") in ((s+"D")*300+s+"E") (*100)

2.743.8970.5s="ABC"*33; ((s+"D")*500+s+"E").index(s+"E") (*100)
0.170.15112.4   s="ABC"*33; ((s+"D")*500+s+"E").index(s+"E") (*100)

3.934.0098.4s="ABC"*33; ((s+"D")*500+s+"E").partition(s+"E") (*100)
0.300.27108.0   s="ABC"*33; ((s+"D")*500+s+"E").partition(s+"E") (*100)

3.994.5986.8s="ABC"*33; ("E"+s+("D"+s)*500).rfind("E"+s) (*100)
3.132.51124.5   s="ABC"*33; ("E"+s+("D"+s)*500).rfind("E"+s) (*100)

1.642.2373.3s="ABC"*33; (s+"E"+("D"+s)*500).rfind(s+"E") (*100)
1.541.8284.5s="ABC"*33; (s+"E"+("D"+s)*500).rfind(s+"E") (*100)

3.974.5986.4s="ABC"*33; ("E"+s+("D"+s)*500).rindex("E"+s) (*100)
3.182.53125.8   s="ABC"*33; ("E"+s+("D"+s)*500).rindex("E"+s) (*100)

4.694.67100.3   s="ABC"*33; ("E"+s+("D"+s)*500).rpartition("E"+s) (*100)
3.372.66126.9   s="ABC"*33; ("E"+s+("D"+s)*500).rpartition("E"+s) (*100)

4.092.82145.0   s="ABC"*33; ("E"+s+("D"+s)*500).rsplit("E"+s, 1) (*100)
3.392.62129.5   s="ABC"*33; ("E"+s+("D"+s)*500).rsplit("E"+s, 1) (*100)

3.503.5199.7s="ABC"*33; ((s+"D")*500+s+"E").split(s+"E", 1) (*100)
0.300.28106.0   s="ABC"*33; ((s+"D")*500+s+"E").split(s+"E", 1) (*100)

Just for contrast, doesn't make much difference for the "late match, two 
characters" tests:

== late match, two characters
0.440.5876.2("AB"*300+"C").find("BC") (*1000)
0.570.48120.2   ("AB"*300+"C").find("BC") (*1000)

0.590.7380.5("AB"*300+"CA").find("CA") (*1000)
0.560.7277.5("AB"*300+"CA").find("CA") (*1000)

0.550.49112.5   "BC" in ("AB"*300+"C") (*1000)
0.660.37177.7   "BC" in ("AB"*300+"C") (*1000)

0.450.5876.5("AB"*300+"C").index("BC") (*1000)
0.570.49116.5   ("AB"*300+"C").index("BC") (*1000)

0.610.6298.6("AB"*300+"C").partition("BC") (*1000)
0.720.52137.2   ("AB"*300+"C").partition("BC") (*1000)

0.620.6496.4("C"+"AB"*300).rfind("CA") (*1000)
0.490.49101.6   ("C"+"AB"*300).rfind("CA") (*1000)

0.570.6587.5("BC"+"AB"*300).rfind("BC") (*1000)
0.510.5789.3("BC"+"AB"*300).rfind("BC") (*1000)

0.620.6496.5("C"+"AB"*300).rindex("CA") (*1000)
0.500.49101.2   ("C"+"AB"*300).rindex("CA") (*1000)

0.680.6999.0("C"+"AB"*300).rpartition("CA") (*1000)
0.610.54113.5   ("C"+"AB"*300).rpartition("CA") (*1000)

0.820.60137.8   ("C"+"AB"*300).rsplit("CA", 1) (*1000)
0.630.57112.0   ("C"+"AB"*300).rsplit("CA", 1) (*1000)

0.630.61103.0   ("AB"*300+"C").split("BC", 1) (*1000)
0.740.54138.2   ("AB"*300+"C").split("BC", 1) (*1000)

--

___
Python tracker 

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



[issue40509] In argparse, allow REMAINDER(...) arguments in a mutually exclusive group

2020-10-17 Thread Tal Einat


Tal Einat  added the comment:

I suggest bringing this up for discussion on Python-Ideas.

--
nosy: +taleinat

___
Python tracker 

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



[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2020-10-17 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

No, unless we can add `self` as a private context to a sqlite3 database handle, 
we can't use that shortcut. However, using a custom context struct works, and 
it's a minor code change.

Proof-of-concept implementation diffstat:
 2 files changed, 54 insertions(+), 10 deletions(-)

--

___
Python tracker 

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



[issue42065] Fix incorrectly formatted _codecs.charmap_decode error message

2020-10-17 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the PR, Max!

--
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



[issue42065] Fix incorrectly formatted _codecs.charmap_decode error message

2020-10-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21706
pull_request: https://github.com/python/cpython/pull/22744

___
Python tracker 

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



[issue42065] Fix incorrectly formatted _codecs.charmap_decode error message

2020-10-17 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +21705
pull_request: https://github.com/python/cpython/pull/22743

___
Python tracker 

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



[issue42065] Fix incorrectly formatted _codecs.charmap_decode error message

2020-10-17 Thread Tal Einat


Tal Einat  added the comment:


New changeset 3635388f52b42e5280229104747962117104c453 by Max Bernstein in 
branch 'master':
bpo-42065: Fix incorrectly formatted _codecs.charmap_decode error message 
(GH-19940)
https://github.com/python/cpython/commit/3635388f52b42e5280229104747962117104c453


--

___
Python tracker 

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



[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2020-10-17 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Instead of using a custom context struct for sqlite3_create_funcion_v2(), we 
may just use sqlite3_context_db_handle() to get `self`, and then fetch the 
state using PyType_GetModuleState(Py_TYPE(self)).

--

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-17 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I added the cutoff for strings >= 10 characters, and I converted the PR from a 
draft to "Ready to Review."

When running stringbench.py before and after the PR, I get these results:

Summary:
Unicode Before: 81.82   Bytes Before: 92.62 
Unicode After:  64.70   Bytes after: 62.41

Full results here:
https://pastebin.com/raw/DChzMjhH

And on the random zipf benchmarks: 

Summary:
14 cases slower (median 1.16x slower, at most 1.52x slower)
601 cases faster (median 2.15x faster, at most 21.94x faster)

Full results here:
https://pastebin.com/raw/ez6529Bp

--

___
Python tracker 

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



[issue42065] Fix incorrectly formatted _codecs.charmap_decode error message

2020-10-17 Thread Tal Einat


Change by Tal Einat :


--
components: +Library (Lib), Unicode
nosy: +ezio.melotti, vstinner -tekknolagi
type:  -> behavior
versions: +Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue42065] Fix incorrectly formatted _codecs.charmap_decode error message

2020-10-17 Thread Maxwell Bernstein


Change by Maxwell Bernstein :


--
keywords: +patch
nosy: +tekknolagi
nosy_count: 1.0 -> 2.0
pull_requests: +21704
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19940

___
Python tracker 

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



[issue42065] Fix incorrectly formatted _codecs.charmap_decode error message

2020-10-17 Thread Tal Einat


New submission from Tal Einat :

The error message for _codecs.charmap_decode uses a non-existent formatting 
placeholder "%lx", when a mapped value is a number outside the range of valid 
Unicode code points.

This was reported by Max Bernstein (@tekknolagi) on GitHub PR GH-19940.

--
messages: 378827
nosy: taleinat
priority: normal
severity: normal
status: open
title: Fix incorrectly formatted _codecs.charmap_decode error message

___
Python tracker 

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



[issue18857] urlencode of a None value uses the string 'None'

2020-10-17 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the PRs, James!

I've closed the PRs for now, to avoid having people spend time reviewing them 
while this issue is closed as "wontfix". That said, if further discussion 
changes that decision, the PRs could be reopened.

--
nosy: +taleinat

___
Python tracker 

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



[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2020-10-17 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

Porting sqlite3 to multi-phase initialisation is non-trivial and must be broken 
into smaller bpo's, often with multiple PR's per bpo. As far as I can see, this 
is the task list:

1) Heap types (PEP 384): bpo-41861
2) Argument Clinic: bpo-40956
3) Establish global module state
4) Pass `self` iso. callback object to trace, auth, and progress handlers 
(required for item 7)
5) Use sqlite3_create_collation_v2 iso. sqlite3_create_collation (see next list 
item)
6) For sqlite3_create_* functions, establish a context struct that contains the 
target user callback and the state. Modify callers to allocate memory, and the 
destructor to deallocate
7) Module state (PEP 573)
8) Multi-phase initialisation (PEP 489)

The list may be incomplete.

Separate bpo's for 1) and 2) are opened. Pr. 2020-10-17, 1) is almost done, and 
2), part 1 of 5 is awaiting review. It may be convenient to open up sub-bpo's 
for some of the other tasks as well. For instance, using 
sqlite3_create_collation_v2() iso. sqlite3_create_collation(). (FYI, this 
imposes no new SQLite version requirements.)

I'd wait until AC is implemented with moving forward with the rest of the PR's, 
in order to avoid merge mess. The exception might be item 4, preparing the 
trace/progress/auth callbacks, which is easy to isolate from the rest.

I've prepared branches for most of these things locally, some split in multiple 
PR's to ease reviewing.

I've tagged Victor Stinner and Dong-hee Na (hope that's ok), since they've been 
helpful with reviewing and providing helpful hints thus far. Any input from 
Berker Peksag would be highly appreciated; after all, he is the maintainer of 
this module :)

Ref. bpo-1635741 (the grand multi-phase issue)

--
components: Library (Lib)
messages: 378825
nosy: berker.peksag, corona10, erlendaasland, vstinner
priority: normal
severity: normal
status: open
title: Convert sqlite3 to multi-phase initialisation (PEP 489)
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue40529] Auto Completions with case insensitive

2020-10-17 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the suggestion and for the high quality PR, Madhusudhan!

I'm not sure about this feature. It seems harmless enough, with the default 
being the existing case-sensitive completion. But it seems like a rather 
esoteric thing to want, so I'm not sure it's worth adding to the stdlib and 
maintaining indefinitely.

Would you mind bringing this up for discussion on Python-Ideas, so that we can 
get a feel for how many others would find this useful?

--
nosy: +taleinat

___
Python tracker 

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



[issue42063] More options to http.server & SimpleHTTPRequestHandler

2020-10-17 Thread Jake


New submission from Jake :

I would find it useful to have more options to http.server 
SimpleHTTPRequestHandler:

1) The option to get the current directory in not only HTML, but represented in 
JSON for example. This could be an added --json flag in the main method of 
http.server, and an added corresponding method in SimpleHTTPRequestHandler much 
like list_directory but for JSON. 


2) Options to add more headers. For example I would find it useful to be able 
to add the header 'Access-Control-Allow-Origin'. This could be achieved by 
send_head in SimpleHTTPRequestHandler taking more arguments for specifying any 
additional headers to be added. 

This way a custom class can inherit SimpleHTTPRequestHandler, and in its own 
send_head method call e.g. 
super().send_head(extra_headers={'Access-Control-Allow-Origin','*'}).

--
components: Library (Lib)
messages: 378823
nosy: jacobsorme
priority: normal
severity: normal
status: open
title: More options to http.server & SimpleHTTPRequestHandler
type: enhancement

___
Python tracker 

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



[issue40775] Fix missing dot in sqlite3 Node type name

2020-10-17 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

Fixed in GH-22417 / bpo-41861

--
resolution:  -> out of date
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



[issue32820] Add and document __format__ method for IPv[46]Address

2020-10-17 Thread Eric Osborne


Eric Osborne  added the comment:

Did I really ship an enhancement without documenting it?  I am a terrible
person.  I will pick up the issue and take care of it.

eric

On Sat, Oct 17, 2020 at 9:07 AM Eric V. Smith 
wrote:

>
> Eric V. Smith  added the comment:
>
> I've created issue 42061 for the documentation. Hopefully marking that
> issue as easy and newcomer friendly will attract some attention.
>
> Thanks ewosborne and Serhiy for adding this feature, and everyone for
> their input.
>
> --
> resolution:  -> fixed
> stage: patch review -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue42059] TypedDict(...) as function does not respect "total" when setting __required_keys__ and __optional_keys__

2020-10-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

Whoops, sorry, didn't see that you already have a PR. I'll review it next week 
during the core sprint.

--

___
Python tracker 

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



[issue42042] sphinx3 renders diffrently docs.python.org for 3.10

2020-10-17 Thread Dong-hee Na


Dong-hee Na  added the comment:

Okay this is the theme bug.
https://github.com/python/python-docs-theme/pull/57

--

___
Python tracker 

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



[issue42059] TypedDict(...) as function does not respect "total" when setting __required_keys__ and __optional_keys__

2020-10-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

Can you submit a PR to fix this? It looks like you already have a good 
understanding of the root cause of the problem, so it should be easy to fix. 
(Be sure to add a unit test.)

It can be backported to earlier Python versions that have typing.TypedDict 
(3.8+).

--

___
Python tracker 

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



[issue42042] sphinx3 renders diffrently docs.python.org for 3.10

2020-10-17 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +mdk

___
Python tracker 

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



[issue38320] Clarify unittest expectedFailure behaviour in the documentation

2020-10-17 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +patch
nosy: +iritkatriel
nosy_count: 2.0 -> 3.0
pull_requests: +21703
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22740

___
Python tracker 

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



[issue42042] sphinx3 renders diffrently docs.python.org for 3.10

2020-10-17 Thread Dong-hee Na


Change by Dong-hee Na :


--
title: docs.python.org for 3.10 missing the new refererence record. -> sphinx3 
renders diffrently docs.python.org for 3.10

___
Python tracker 

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



[issue42042] docs.python.org for 3.10 missing the new refererence record.

2020-10-17 Thread Dong-hee Na


Dong-hee Na  added the comment:

One more regression is that
code background highlight is not applied after sphinx version3

See
https://docs.python.org/3.10/c-api/dict.html#c.PyDict_Next
https://docs.python.org/3.9/c-api/dict.html#c.PyDict_Next

--
stage: patch review -> 

___
Python tracker 

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



[issue42042] docs.python.org for 3.10 missing the new refererence record.

2020-10-17 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +Mariatta

___
Python tracker 

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



[issue42042] docs.python.org for 3.10 missing the new refererence record.

2020-10-17 Thread Dong-hee Na


Change by Dong-hee Na :


--
keywords: +patch
pull_requests: +21702
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22739

___
Python tracker 

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



[issue42042] docs.python.org for 3.10 missing the new refererence record.

2020-10-17 Thread Dong-hee Na


Dong-hee Na  added the comment:

sphinx2
(Pdb) par[0].attributes
{'ids': ['c._PyObject_New'], 'classes': [], 'names': ['c._PyObject_New'], 
'dupnames': [], 'backrefs': [], 'first': False}

sphinx3
(Pdb) par[0].attributes
{'ids': ['c._PyObject_New'], 'classes': [], 'names': [], 'dupnames': [], 
'backrefs': [], 'is_multiline': True}

We are using the names attribute for annotation.

--

___
Python tracker 

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



[issue42062] Usage of HTTPResponse.url

2020-10-17 Thread Felipe Rodrigues


Change by Felipe Rodrigues :


--
keywords: +patch
pull_requests: +21701
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22738

___
Python tracker 

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



[issue42042] docs.python.org for 3.10 missing the new refererence record.

2020-10-17 Thread Dong-hee Na


Dong-hee Na  added the comment:

This is the regression bug caused by sphinx==3.2.1
If we roll back the sphinx version(2.4.4), it is okay.
I am investigating what causes this issue.

--

___
Python tracker 

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



[issue42062] Usage of HTTPResponse.url

2020-10-17 Thread Felipe Rodrigues


New submission from Felipe Rodrigues :

Hello all,

While testing some static analysis tools on HTTP/client.py, Pylint pointed
me to HTTPResponse.geturl() method with a "no-member" error for the `url`
attribute. I tried invoking the `geturl` method and reading the
`HTTPResponse.url` attribute using a sample code from the official docs:

```
import http.client
conn = http.client.HTTPSConnection("www.python.org")
conn.request("GET", "/")
r1 = conn.getresponse()
print(r1.status, r1.reason)

r1.geturl()
r1.url
```
```
import http.client
conn = http.client.HTTPSConnection("www.python.org")
conn.request("GET", "/")
r1 = conn.getresponse()
data1 = r1.read()

conn.request("GET", "/")
r1 = conn.getresponse()
while chunk := r1.read(200):
print(repr(chunk))
r1.geturl()
r1.url
```

Both of those examples will raise an `AttributeError: 'HTTPResponse' object has 
no attribute 'url'`.

I tried searching through this module's history from when this line originally 
appeared,
https://github.com/python/cpython/commit/6c5e28c383bf587f80d01e52f887801be200200d
 but
I wasn't able to find this attribute being set internally by the class, even
though there is an `url` attribute at __init__.

So, I wonder if this attribute was intended to be set externally as in `r1.url 
= 'something'`
or if it is just a bug

--
components: Library (Lib)
messages: 378814
nosy: fbidu
priority: normal
severity: normal
status: open
title: Usage of HTTPResponse.url

___
Python tracker 

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



[issue32820] Add and document __format__ method for IPv[46]Address

2020-10-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

I've created issue 42061 for the documentation. Hopefully marking that issue as 
easy and newcomer friendly will attract some attention.

Thanks ewosborne and Serhiy for adding this feature, and everyone for their 
input.

--
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



[issue42061] Document __format__ method for IPv[46]Address

2020-10-17 Thread Eric V. Smith


New submission from Eric V. Smith :

This feature was added in issue 32820, but was never documented.

--
assignee: docs@python
components: Documentation
keywords: easy, newcomer friendly
messages: 378812
nosy: docs@python, eric.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: Document __format__ method for IPv[46]Address
type: enhancement
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue32820] Add and document __format__ method for IPv[46]Address

2020-10-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

At this point, it's a documentation-only issue. This new feature isn't 
documented.

It might be less confusing to close this issue and open a new one. I'll do that 
shortly.

--
versions: +Python 3.10

___
Python tracker 

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



[issue42060] Usage of assert in http/client.py

2020-10-17 Thread Felipe Rodrigues


Change by Felipe Rodrigues :


--
keywords: +patch
pull_requests: +21700
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22737

___
Python tracker 

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



[issue42060] Usage of assert in http/client.py

2020-10-17 Thread Felipe Rodrigues


New submission from Felipe Rodrigues :

Hi all!

I was testing some static analysis tool and decided to use the HTTP module as 
testing ground. While running `bandit` at the client module, it detected 3 
instances of using `assert` inside the code. Twice in the HTTPResponse class 
and once in the HTTPConnection class.

Now, I know that this will only cause any trouble when running python with the 
optimize settings turned on and if someone is that concerned about 
optimization, they probably won't be using the stdlib's HTTP implementation, 
but I think it would be fitting to fix this corner case.

I've written a PR that fixes this but I'm not sure if the raised exceptions and 
messages are ok

--
components: Library (Lib)
messages: 378810
nosy: fbidu
priority: normal
severity: normal
status: open
title: Usage of assert in http/client.py
versions: Python 3.10

___
Python tracker 

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



[issue32820] Add and document __format__ method for IPv[46]Address

2020-10-17 Thread Irit Katriel


Irit Katriel  added the comment:

In that case, should this issue be closed?

--

___
Python tracker 

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



[issue42049] Add image/webp to list of media types in mimetypes.py

2020-10-17 Thread waicalibre


waicalibre  added the comment:

Yep, looks like this issue is an exact duplicate. Sorry about that.
It looks like WebP is still not registered with IANA so it can't be added to 
the list according to this comment: 
https://github.com/python/cpython/blob/master/Lib/mimetypes.py#L407. It could 
still be added though to the common-but-not-official list of media types here: 
https://github.com/python/cpython/blob/master/Lib/mimetypes.py#L550.

Could that happen here or would that have to happen with a new issue and pull 
request, or in the issue that this issue is a duplicate of? Not really sure of 
the protocol here.

--

___
Python tracker 

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



[issue38820] Make Python compatible with OpenSSL 3.0.0

2020-10-17 Thread Christian Heimes


Christian Heimes  added the comment:

No, this is still work in progress.

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

___
Python tracker 

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



[issue42059] TypedDict(...) as function does not respect "total" when setting __required_keys__ and __optional_keys__

2020-10-17 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue42056] Configure on Apple ARM: "Unexpected output of 'arch' on OSX"

2020-10-17 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I have a PR that implements support for Apple Silicon:

https://github.com/python/cpython/pull/21564


Sadly this is not yet complete. I hope to make progress again during the core 
sprint next week.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue42059] TypedDict(...) as function does not respect "total" when setting __required_keys__ and __optional_keys__

2020-10-17 Thread Alex Grönholm

Change by Alex Grönholm :


--
keywords: +patch
pull_requests: +21699
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22736

___
Python tracker 

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



[issue42059] TypedDict(...) as function does not respect "total" when setting __required_keys__ and __optional_keys__

2020-10-17 Thread Alex Grönholm

New submission from Alex Grönholm :

>>> DummyDict = TypedDict('DummyDict', {'x': int, 'y': str}, total=False)
>>> DummyDict.__required_keys__
frozenset({'x', 'y'})

This happens because the TypedDict function does not pass the "total" metaclass 
argument to _TypedDictMeta() (instead passing "__total__" in the attribute 
namespace) and the new code that sets __required_keys__ and __optional_keys__ 
only checks the metaclass argument.

--
components: Library (Lib)
messages: 378805
nosy: alex.gronholm
priority: normal
severity: normal
status: open
title: TypedDict(...) as function does not respect "total" when setting 
__required_keys__ and __optional_keys__
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue32820] Add and document __format__ method for IPv[46]Address

2020-10-17 Thread Eric Osborne


Eric Osborne  added the comment:

Yes, I agree. Regardless of backport policy, this is a handy little
convenience featurette, not sliced bread v2, so it's not worth backporting
even if it was permissible.

eric

On Fri, Oct 16, 2020 at 7:13 PM Eric V. Smith 
wrote:

>
> Eric V. Smith  added the comment:
>
> Re: backporting
>
> A quick test shows this feature is not in 3.8. We can't add new features
> to 3.8, so I'd say "no, it doesn't need to be backported".
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue41854] argparse.add_mutually_exclusive_group fails for optional positional arguments

2020-10-17 Thread Reuben Thomas


Reuben Thomas  added the comment:

Thanks for the hint; could this be documented, please?

--

___
Python tracker 

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



[issue36179] _hashopenssl has reference leaks in OOM case

2020-10-17 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
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