[issue40511] IDLE: properly handle '(' and ')' within calls

2020-06-16 Thread Tal Einat


Tal Einat  added the comment:

I agree that this should be improved.

Terry, on the technical side, IDLE already has good tools for parsing the 
current code line/block and figuring out whether the cursor is in a string, a 
comment or parentheses. This should be possible to solve in a robust way 
without writing any new parsing logic.

I'll try to take a look at this soon.

--

___
Python tracker 

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



[issue22167] iglob() has misleading documentation (does indeed store names internally)

2020-06-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am going to add the issue38144 feature first. Then maybe implement a dir_fd 
based optimization.

--

___
Python tracker 

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



[issue40878] Use c99 on the aixtools bot

2020-06-16 Thread Michael Felt

Michael Felt  added the comment:

I’ll switch back to xlc ( even try without the _r ) and look for the macro asap 
(vacation and occasional travel). 

Sent from my iPhone

> On 15 Jun 2020, at 21:20, Stefan Krah  wrote:
> 
> 
> Stefan Krah  added the comment:
> 
> Thanks!
> 
> Ha, it turns out that c99_r has excellent C99 compliance. :)
> 
>> Variable arguments macro RAISE_SYNTAX_ERROR was invoked with an empty 
>> variable argument list.
> 
> Totally legit, we should use xlc (at least the front end) more often.
> 
> 
> So maybe our code base is not C99 compliant enough and we have to switch back 
> for sanity.
> 
> 
> 
> For the _decimal problem at hand, if you give me the compiler identification 
> macro (__xlc__ or something?) I can try the same as for MSVC and use the 
> explicit EXTINLINE definition.
> 
> --
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40984] re.compile's repr truncates patterns at 200 characters

2020-06-16 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> duplicate
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



[issue39949] truncating match in regular expression match objects repr

2020-06-16 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+1 for adding an ellipsis.  It's a conventional way to indicate that the 
displayed data is truncated.

Concur with Eric that missing close quote is too subtle (and odd, and 
unexpected).

--
nosy: +rhettinger

___
Python tracker 

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



[issue40968] urllib is unable to deal with TURN server infront

2020-06-16 Thread Christian Heimes


Christian Heimes  added the comment:

It looks like the server is refusing requests that don't have an ALPN extension 
set in TLS layer. At first I though that the server may only support HTTP/2. 
The curl requests in your examples uses HTTP/2. urllib only supports HTTP/1.1 
and HTTP/1.0.

Then I tried "curl --http1.1 https://jitsi.molgen.mpg.de";. The request also 
succeeds because curl is sending "ALPN, offering http/1.1".

This request works for me:

>>> import ssl
>>> import urllib.request
>>> ctx = ssl.create_default_context()
>>> ctx.set_alpn_protocols(['http/1.1'])
>>> urllib.request.urlopen('https://jitsi.molgen.mpg.de', context=ctx)


urllib could set the ALPN header by default when the user does not supply a 
custom context. It looks like curl always adds an ALPN extension. I don't see 
code in Python requests that sets ALPN extension. On the other hand Tom 
Christie's excellent httpx library does set ALPN extension just like curl.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue40968] urllib is unable to deal with TURN server infront

2020-06-16 Thread Paul Menzel


Paul Menzel  added the comment:

Wow, great job in figuring this out. Passing the context, it works here too.

I just wanted to add, that I looked at this with Wireshark, and to not 
complicate things, first tried plain HTTP.

```
$ curl http://jitsi.molgen.mpg.de

301 Moved Permanently

301 Moved Permanently
nginx/1.14.2


```

With Python, there is also the connection lost error. But Wireshark shows that 
the 301 HTTP packet is send back by the server.

```
$ python3
Python 3.8.3 (default, May 14 2020, 11:03:12) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.request
>>> response = urllib.request.urlopen('http://jitsi.molgen.mpg.de')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 563, in error
result = self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 755, in http_error_302
return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1393, in https_open
return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.8/urllib/request.py", line 1354, in do_open
r = h.getresponse()
  File "/usr/lib/python3.8/http/client.py", line 1332, in getresponse
response.begin()
  File "/usr/lib/python3.8/http/client.py", line 303, in begin
version, status, reason = self._read_status()
  File "/usr/lib/python3.8/http/client.py", line 272, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
```

--

___
Python tracker 

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



[issue40968] urllib is unable to deal with TURN server infront

2020-06-16 Thread Christian Heimes


Christian Heimes  added the comment:

Look closer at the traceback. You'll see that urllib follows redirects 
(http_response -> http_error_302 -> open -> HTTPSConnection). curl doesn't 
follow redirects by default.

--

___
Python tracker 

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



[issue39949] truncating match in regular expression match objects repr

2020-06-16 Thread Eric V. Smith


Change by Eric V. Smith :


--
components: +Regular Expressions -Library (Lib)
nosy: +ezio.melotti, mrabarnett
resolution: not a bug -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue40511] IDLE: properly handle '(' and ')' within calls

2020-06-16 Thread Tal Einat


Tal Einat  added the comment:

> OMG, request too large. I can't upload mp4

You can try to reduce the video's resolution and/or framerate in order to 
reduce its size.

Usually screen captures are taken at high resolution and framerates by default, 
making the resulting video files very large, which is a sensible default but 
not great for attaching to bug reports.

--

___
Python tracker 

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



[issue40511] IDLE: properly handle '(' and ')' within calls

2020-06-16 Thread Tal Einat


Tal Einat  added the comment:

Confirmed on latest master on macOS 10.15.5 with Tcl/Tk 8.6.10.

--

___
Python tracker 

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



[issue40979] typing module docs: keep text, add subsections

2020-06-16 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Would you care to submit a PR?

--
nosy: +rhettinger

___
Python tracker 

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



[issue40744] Explicitly drop support for SQLite version < 3.7.3

2020-06-16 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +20091
pull_request: https://github.com/python/cpython/pull/20909

___
Python tracker 

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



[issue40511] IDLE: properly handle '(' and ')' within calls

2020-06-16 Thread Tal Einat


Change by Tal Einat :


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

___
Python tracker 

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



[issue40511] IDLE: properly handle '(' and ')' within calls

2020-06-16 Thread Tal Einat


Tal Einat  added the comment:

See PR GH-20910 with a fix.

--

___
Python tracker 

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



[issue39949] truncating match in regular expression match objects repr

2020-06-16 Thread Seth Troisi


Seth Troisi  added the comment:

I didn't propose a patch before because I was unsure of decision. Now that 
there is a +1 from Raymond I'll working on a patch and some documentation. 
Expect a patch within the week.

--

___
Python tracker 

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



[issue40984] re.compile's repr truncates patterns at 200 characters

2020-06-16 Thread Quentin Wenger


Quentin Wenger  added the comment:

Pardon me, but I see an important difference with the other bug report: that 
one is about a repr in angle brackets, and as such does not require an exact 
output, so an ellipsis is good enough.

In this bug, the output of repr gives a string than can, at least for small 
enough patterns, be passed to eval() to recontruct an object. So there is no 
good reason that this can be done for patterns up to 200 characters but not 
above; furthermore it is undocumented and goes against the doc on repr.

Compare with a complexly-nested structure of, say, lists, dicts and strings: 
The repr will always be "reconstructible", even if it is well above 200 
characters.

Also, a common way to write repr is to draw the outer "container" as a string, 
and fill it with the (full!) repr of the object's parameters. E.g. the repr of 
a list containing a 1000-character string will simply write square brackets 
around the 1002-character repr of the string. re.compile doesn't conform to 
this "rule".

--
resolution: duplicate -> 
status: closed -> open

___
Python tracker 

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



[issue40878] Use c99 on the aixtools bot

2020-06-16 Thread Michael Felt

Michael Felt  added the comment:

I switched the "aixtools" bot back to "xlc", and also back to my POWER6
server that runs xlc-v11.

iirc it is xlc-v13 (or maybe even v12) that is having trouble with
_decimal (or is it POWER8). From memory, _decimal was compiling properly
with xlc-v11.

Although - my last runs on the POWER6, by default, were using gcc - so
maybe I thought, incorrectly, that xlc was passing.

Time shall tell.

p.s. - if you make a PR that emulates a rollback, if that is what you
were thinking - I can test that separately/manually.

Michael

On 16/06/2020 09:04, Michael Felt wrote:
> Michael Felt  added the comment:
>
> I’ll switch back to xlc ( even try without the _r ) and look for the macro 
> asap (vacation and occasional travel). 
>
> Sent from my iPhone
>
>> On 15 Jun 2020, at 21:20, Stefan Krah  wrote:
>>
>> 
>> Stefan Krah  added the comment:
>>
>> Thanks!
>>
>> Ha, it turns out that c99_r has excellent C99 compliance. :)
>>
>>> Variable arguments macro RAISE_SYNTAX_ERROR was invoked with an empty 
>>> variable argument list.
>> Totally legit, we should use xlc (at least the front end) more often.
>>
>>
>> So maybe our code base is not C99 compliant enough and we have to switch 
>> back for sanity.
>>
>>
>>
>> For the _decimal problem at hand, if you give me the compiler identification 
>> macro (__xlc__ or something?) I can try the same as for MSVC and use the 
>> explicit EXTINLINE definition.
>>
>> --
>>
>> ___
>> Python tracker 
>> 
>> ___
>>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue30533] missing feature in inspect module: getmembers_static

2020-06-16 Thread hongweipeng


Change by hongweipeng :


--
keywords: +patch
nosy: +hongweipeng
nosy_count: 5.0 -> 6.0
pull_requests: +20093
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20911

___
Python tracker 

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



[issue40680] thread_cputime isn't supported by AIX5

2020-06-16 Thread Michael Felt


Michael Felt  added the comment:

There is still a lot of AIX 6.1 out there, and iirc, there may be
"extended" support available.

However, at this point in time the bots run (most of the time) on AIX
7.2, -- occasionally, on AIX 7.1. And when I (personally) test - it is
usually on AIX 6.1 (e.g., to have _uuid support).

In any case, I still package using AIX 6.1 (again, _uuid mod support)
and rely on AIX binary compatibility for installations on AIX 7.1 and
AIX 7.2.

Should you be thinking/considering moving AIX to the "supported" column
- I would "gladly" embrace AIX 7.1 as a requirement.

On 10/06/2020 22:58, STINNER Victor wrote:
> STINNER Victor  added the comment:
>
> According to 
> https://www.ibm.com/support/pages/aix-support-lifecycle-information I suggest 
> to require AIX 7.1 and newer.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Quentin Wenger

Quentin Wenger  added the comment:

Agreed to some extent, but there is the difference that group names are 
embedded in the pattern, which has to be bytes if the target is bytes.

My use case is in an all-bytes, no-string project where I construct a large 
regular expression at startup, with semi-dynamical group names.

So it seems natural to have everything in bytes to concatenate the regular 
expression, incl. the group names.

But then group names that I receive back are strings, so I cannot look them up 
directly into the set of group names that I used to create the expression in 
the first place.

Of course I can live with it by storing them as strings in the first place and 
encode()'ing them during concatenation, but it does not feel "natural".

Furthermore, even if it is "just a name", a non-ascii group name will raise an 
error in bytes, even if encoded...:

```
>>> re.compile("(?P<" + "é" + ">)")
re.compile('(?P<é>)')
>>> re.compile(b"(?P<" + "é".encode() + b">)")
Traceback (most recent call last):
  File "", line 1, in 
re.compile(b"(?P<" + "é".encode() + b">)")
  File "/usr/lib/python3.8/re.py", line 252, in compile
return _compile(pattern, flags)
  File "/usr/lib/python3.8/re.py", line 304, in _compile
p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.8/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.8/sre_parse.py", line 948, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.8/sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
  File "/usr/lib/python3.8/sre_parse.py", line 703, in _parse
raise source.error(msg, len(name) + 1)
re.error: bad character in group name 'é' at position 4
```

So no, it's not really "just a name", considering that in Python "é" should is 
a valid name.

--

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Quentin Wenger


Quentin Wenger  added the comment:

should *be a valid name

--

___
Python tracker 

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



[issue40984] re.compile's repr truncates patterns at 200 characters

2020-06-16 Thread Quentin Wenger


Quentin Wenger  added the comment:

All in all, it is simply a matter of compliance. The doc of repr says that a 
repr is either

- a string that can be eval()'ed back to (an equivalent of) the original object
- or a "more loose" angle-bracket representation.

re.compile with small patterns falls in the first category. The other bug 
report corresponds to the second one, no problem.

However, re.compile with large patterns doesn't fall in either category, nor 
would it if changed to use an ellipsis.

--

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Ma Lin

Ma Lin  added the comment:

> a non-ascii group name will raise an error in bytes, even if encoded

Looks like this is a language limitation:

>>> b'é'
  File "", line 1
SyntaxError: bytes can only contain ASCII literal characters.

No problem if you use escaped character:

>>> re.match(b'(?P<\xe9>)', b'').groupdict()
{'é': b''}

There may be some inconveniences in your program, but IMO there is nothing 
wrong, maybe this issue can be closed.

--

___
Python tracker 

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



[issue40983] urllib.request.url2pathname() unconditionally uses utf-8 encoding and "replace" error handler

2020-06-16 Thread Manuel Jacob

Change by Manuel Jacob :


--
title: Can’t configure encoding used by urllib.request.url2pathname() -> 
urllib.request.url2pathname() unconditionally uses utf-8 encoding and "replace" 
error handler

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Quentin Wenger

Quentin Wenger  added the comment:

Of course an inconvenience in my program is not per se the reason to change the 
language. I just wanted to motivate that the current situation gives unexpected 
results.

"\xe9" doesn't look like proper utf-8 to me:

```
>>> "é".encode("latin-1")
b'\xe9'
>>> "é".encode()
b'\xc3\xa9'
```

Let's try another one: how would you go for Δ ("\u0394") as a group name?


```
>>> "Δ".encode()
b'\xce\x94'
>>> "Δ".encode("latin-1")
Traceback (most recent call last):
  File "", line 1, in 
"Δ".encode("latin-1")
UnicodeEncodeError: 'latin-1' codec can't encode character '\u0394' in position 
0: ordinal not in range(256)
>>> re.match(b'(?P<\xce\x94>)', b'').groupdict()
Traceback (most recent call last):
  File "", line 1, in 
re.match(b'(?P<\xce\x94>)', b'').groupdict()
  File "/usr/lib/python3.8/re.py", line 191, in match
return _compile(pattern, flags).match(string)
  File "/usr/lib/python3.8/re.py", line 304, in _compile
p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.8/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.8/sre_parse.py", line 948, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.8/sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
  File "/usr/lib/python3.8/sre_parse.py", line 703, in _parse
raise source.error(msg, len(name) + 1)
re.error: bad character in group name 'Î\x94' at position 4
>>> re.match(b'(?P<\u0394>)', b'').groupdict()
Traceback (most recent call last):
  File "", line 1, in 
re.match(b'(?P<\u0394>)', b'').groupdict()
  File "/usr/lib/python3.8/re.py", line 191, in match
return _compile(pattern, flags).match(string)
  File "/usr/lib/python3.8/re.py", line 304, in _compile
p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.8/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.8/sre_parse.py", line 948, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.8/sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
  File "/usr/lib/python3.8/sre_parse.py", line 703, in _parse
raise source.error(msg, len(name) + 1)
re.error: bad character in group name '\\u0394' at position 4
```

--

___
Python tracker 

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



[issue37673] Tkinter won't create 5000 check boxes, stops at 1309.

2020-06-16 Thread E. Paine


E. Paine  added the comment:

I tested the demo Python script and also had it stop at 1309. I wrote a small 
tcl script (a simplified version of the Python demo) to test in wish (see 
attached) which stopped at 1058.
It is strange that tkinter stops later than wish, however I would still 
conclude this is a tcl problem not tkinter or Python.

--
nosy: +epaine
Added file: https://bugs.python.org/file49235/tkcheck.tcl

___
Python tracker 

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



[issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available

2020-06-16 Thread E. Paine


E. Paine  added the comment:

I know I'm a bit late, but I believe the site is now being hosted on a Gtihub 
page:
https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/index.html

I suspect this is another personal project just for historical reference and 
will not be updated, however I would (personally) prefer not to be linked to 
the Wayback Machine.

--
nosy: +epaine

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Ma Lin

Ma Lin  added the comment:

`latin1` is the character set that Unicode code point from \u to \u00ff, 
and the characters are directly mapped from/to bytes.

So b'\xe9' is mapped to \u00e9, it is `é`.

Of course, characters with Unicode code point greater than 0xff are impossible 
to appear in `bytes`.

--

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Quentin Wenger

Quentin Wenger  added the comment:

> So b'\xe9' is mapped to \u00e9, it is `é`.

Yes but \xe9 is not strictly valid utf-8, or say not the canonical 
representation of "é". So there is no way to get \xe9 starting from é without 
leaving utf-8. So starting with é as group name, I cannot programmatically 
encode it into a bytes pattern.

> Of course, characters with Unicode code point greater than 0xff are 
> impossible to appear in `bytes`.

But \xce and \x94 are both lower than \xff, yet using \xce\x94 ("Δ".encode()) 
in a group name fails.

According to the doc, the sole constraint on group names is that they have to 
be valid and unique Python identifiers. So this should work:

```
# Δ is a valid identifier
>>> "Δ".isidentifier()
True
>>> Δ = 1
>>> Δ
1
>>> import re
>>> name = "Δ"
>>> re.match(b"(?P<" + name.encode() + b">)", b"")
Traceback (most recent call last):
  File "", line 1, in 
re.match(b"(?P<" + name.encode() + b">)", b"")
  File "/usr/lib/python3.8/re.py", line 191, in match
return _compile(pattern, flags).match(string)
  File "/usr/lib/python3.8/re.py", line 304, in _compile
p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.8/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.8/sre_parse.py", line 948, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib/python3.8/sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
  File "/usr/lib/python3.8/sre_parse.py", line 703, in _parse
raise source.error(msg, len(name) + 1)
re.error: bad character in group name 'Î\x94' at position 4
re.match(b'(?P<\xce\x94>)', b'').groupdict()
```

--

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Ma Lin

Ma Lin  added the comment:

In this case, you can only use 'latin1', which directly map one character 
(\u-\u00FF) to/from one byte.

If use 'utf-8', it may map one character to multiple bytes, such as 'Δ' -> 
b'\xce\x94'

'\x94' is an invalid identifier, it will raise an error:

>>> '\xce'.isidentifier()   # '\xce' is 'Î'
True
>>> '\x94'.isidentifier()
False

You may close this issue (I can't close it), we can continue the discussion.

--

___
Python tracker 

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



[issue40984] re.compile's repr truncates patterns at 200 characters

2020-06-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

Any change to the repr should take place on the other issue. I don't feel very 
strongly that the repr must be eval-able, but in any event it should be raised 
on issue39949 if you feel strongly about it.

I do think it's reasonable to say that if the repr is truncated, it must not be 
eval-able. Maybe the ellipsis should go outside the quotes, or something else 
to make it fail. But this should be discussed on issue39949.

I'm going to close this.

--
nosy: +eric.smith
resolution:  -> duplicate
status: open -> closed
superseder:  -> truncating match in regular expression match objects repr

___
Python tracker 

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



[issue39949] truncating match in regular expression match objects repr

2020-06-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

There was a discussion in issue40984 that the repr must be eval-able. I don't 
feel very strongly about this, mainly because I don't think anyone ever does 
eval(repr(some_regex)). I'd be slightly sympathetic to wanting the eval to fail 
if the repr had to truncate its output, instead of succeeding because the 
string was still a valid, but different, regex.

--

___
Python tracker 

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



[issue40965] Segfault when importing unittest module via C API

2020-06-16 Thread Christian Heimes


Christian Heimes  added the comment:

It would be helpful if you could provide a C stacktrace. I use gdb to create a 
stacktrace. You may have to install additional debug symbols.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Quentin Wenger

Quentin Wenger  added the comment:

But Δ has no latin-1 representation. So Δ currently cannot be used as a group 
name in bytes regex, although it is a valid Python identifier. So that's a bug.

I mean, if you insist of having group names as strings even for bytes regexes, 
then it is not reasonable to prevent them from going _in_.

b"(??<\xce\x94>)" is a valid utf-8-encoded bytestring, why wouldn't you accept 
it as a valid re pattern?

IMHO, either

- group names from byte regexes should be returned as bytes
- or any utf-8-encoded representation of a valid Python identifier should be 
accepted as a group name of a bytes regex pattern.

--

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Quentin Wenger


Quentin Wenger  added the comment:

Sorry, b"(?P<\xce\x94>)"

--

___
Python tracker 

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



[issue39949] truncating match in regular expression match objects repr

2020-06-16 Thread Quentin Wenger


Quentin Wenger  added the comment:

For a bit of background, the other issue is about the repr of compiled 
patterns, not match objects.
Please see my argument there about the conformance to repr's doc - merely 
adding an ellipsis would _not_ solve this case.

I have however nothing against the pattern being truncated/ellipsed when inside 
the repr of a match object.

--
nosy: +matpi

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Quentin Wenger


Quentin Wenger  added the comment:

The issue with the second variant is that utf-8 is an arbitrary (although 
default) choice.

But: re is doing that same arbitrary choice already in decoding the group names 
into a string, which is my original complaint!

--

___
Python tracker 

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



[issue40990] Make http.server support SSL

2020-06-16 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

It's a bit outside of its original scope but with more and more application 
requiring HTTPS it is sometime needed even when doing some simple tests or 
local development.

It's quite easy to have an SSL certificate, either auto-signed or using Let's 
Encrypt but configuring Nginx or HAProxy just to serve a local directory on 
localhost is tedious.

I think just wrapping the socket in SSLSocket and adding two flags on the 
command line would be enough?

--
components: Library (Lib)
messages: 371647
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: Make http.server support SSL
type: behavior
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



[issue39949] truncating match in regular expression match objects repr

2020-06-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

Ah, I see. I missed that this issue was only about match objects. I apologize 
for the confusion.

That being the case, I'll re-open the other issue.

--

___
Python tracker 

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



[issue40984] re.compile's repr truncates patterns at 200 characters

2020-06-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

Re-opening this because issue39949 is about match objects, not compiled re 
objects.

Still, I don't think the repr "rule" about being eval-able is hard and fast. 
Although changing the repr to be in brackets wouldn't be unreasonable just to 
drive the point home.

--
resolution: duplicate -> 
stage: resolved -> 
status: closed -> open
superseder: truncating match in regular expression match objects repr -> 

___
Python tracker 

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



[issue39949] truncating match in regular expression match objects repr

2020-06-16 Thread Quentin Wenger


Quentin Wenger  added the comment:

@eric.smith thanks, no problem.

If I can give any advice on this present issue, I would suggest to have the 
ellipsis _inside_ the quote, to make clear that the pattern is being truncated, 
not the match. So instead of

```
<_sre.SRE_Match object; span=(0, 49), 
match='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS'...>
```

as suggested by @Seth.Troisi, I'd suggest

```
<_sre.SRE_Match object; span=(0, 49), 
match='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS...'>
```

--

___
Python tracker 

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



[issue40680] thread_cputime isn't supported by AIX5

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:

> There is still a lot of AIX 6.1 out there, and iirc, there may be "extended" 
> support available.

This issue is about AIX5 support. I'm fine with providing best effort support 
for AIX 6.1. If supporting AIX 6 becomes too expensive, we can consider to drop 
support for this version.

Anyway, I close this issue: I don't think that it's worth it to attempt to 
support AIX 5 in Python 3.10: AIX 5 is no longer supported by its vendor (IBM). 
Use Python 3.9 which seems to better support AIX 5 (don't need 
thread_cputime()).

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Ma Lin


Ma Lin  added the comment:

It seems you don't know some knowledge of encoding yet.

Naturally, `bytes` cannot contain character which Unicode code point is greater 
than \u00ff. So you can only use "latin1" encoding, which map from character to 
byte (or reverse) directly.

"utf-8", "utf-16" and "utf-32" are all encoding codecs, "utf-8" should not have 
a special status in this scene.

--
nosy:  -ezio.melotti, mrabarnett

___
Python tracker 

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



[issue40984] re.compile's repr truncates patterns at 200 characters

2020-06-16 Thread Quentin Wenger


Quentin Wenger  added the comment:

I welcome any counter-example to the eval()'able property in the stdlib.

I do believe in this rule as hard and fast, because it works for small 
patterns, only bitting you when you grow, probably programmatically (so exactly 
when you actually could need the repr).

Furthermore, 200 seems very low anyway by today standards. I mean, if you want 
a repr in the first place, then chances are that you want it full if 
(reasonably) possible.

If a string repr's itself fully no matter what, why should re.compile 
arbitrarily decide to truncate its argument?

--

___
Python tracker 

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



[issue40989] [C API] Remove _Py_NewReference() and _Py_ForgetReference() from the public C API

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:

See "Removal of _Py_ForgetReference from public header in 3.9 issue" discussion 
on capi-sig:
https://mail.python.org/archives/list/capi-...@python.org/thread/4EOCN7P4HI56GQ74FY3TMIKDBIPGKL2G/

--

___
Python tracker 

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



[issue37369] Issue with pip in venv on Powershell in Windows

2020-06-16 Thread miikama


miikama  added the comment:

Hi,

First time reporting so feel free to direct me to a better place if this is not 
the correct place :)

I am still facing the issue that started this thread with Python 3.8 and 3.9. 

Steps to reproduces
1. Clean install of Python 3.9.0b3 (quick install via .exe 
https://www.python.org/downloads/windows/)

2. create a python virtual environment in powershell

   python -m venv env
or with absolute path: python -m venv C:\Users\\\env


3. activate virtual environment 

  .\env\Scripts\Activate.ps1

4. use pip

(env) PS C:\Users\\ python --version
Python 3.9.0b3
(env) PS C:\Users\\ pip --version
Fatal error in launcher: Unable to create process using 
'"c:\users\\\env\scripts\python.exe"  
"C:\Users\\\env\Scripts\pip.exe" --version'

However, python and pip are installed in the env\Scripts\*

(env) PS C:\Users\\ Get-Command python
python.exe 3.9.113 C:\Users\\\env\Scripts\python.exe

(env) PS C:\Users\\ Get-Command pip
pip.exe 0.0.0.0 C:\Users\\\env\Scripts\pip.exe

But the pip module is not actually found by the python interpreter inside the 
virtual environment.

(env) PS C:\Users\\ python -m pip --version
C:\Users\\\env\Scripts\python.exe: No module named pip





Notes:

1. the global pip installation works well and can be used to install packages

PS C:\Users\\ pip --version
pip 19.2.3 from 
c:\users\\appdata\local\programs\python\python39\lib\site-packages\pip 
(python 3.9)

2. Windows version: Microsoft Windows [Version 10.0.18363.836]

3. Powershell Version: 5.1.18362.752

4. Paths in a python interpreter started in the active env

(env) PS C:\Users\\ python
>>> import sys,os

>>> sys.exec_prefix
'C:\\Users\\env'

>>> sys.base_prefix
'C:\\UsersAppData\\Local\\Programs\\Python\\Python39'

>>> sys.path
['', 
'C:\\UsersAppData\\Local\\Programs\\Python\\Python39\\python39.zip', 
'C:\\UsersAppData\\Local\\Programs\\Python\\Python39\\DLLs', 
'C:\\UsersAppData\\Local\\Programs\\Python\\Python39\\lib', 
'C:\\UsersAppData\\Local\\Programs\\Python\\Python39', 
'C:\\Users\\env']

>>> import pip
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'pip'

quit()



I did not find more recent bugs related to this and wanted to bring the issue 
back to your attention. At least to me, based on the discussion here it seemed 
that the issue should have been fixed. Please let me know if you need any 
further input.

--
nosy: +miikama
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



[issue40989] [C API] Remove _Py_NewReference() and _Py_ForgetReference() from the public C API

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:

> In the CPython code base, _Py_NewReference() is used:
> * to implement the free list optimization

I found a similar code pattern outside CPython code base.

Like Nuitka generic macros for free lists:
https://github.com/Nuitka/Nuitka/blob/8e2357ee8e9a93d835e98d5a88ca0181cc34dabc/nuitka/build/include/nuitka/freelists.h#L22

Another example in the old unmaintained gmpy project (last release in 2013):
https://github.com/LogicalKnight/gmpy/blob/5d758abc9fcb44b08dd000145afe48160bd802f1/src/gmpy2_cache.c#L93-L111

These functions can opt-in for the internal C API to continue to get access to 
_Py_NewReference().

Or maybe free lists should be implemented differently? (is it possible?)


> * in _PyBytes_Resize() and unicode_resize() (resize_compact() to be precise)

Third-party code can use the public PyUnicode_Resize() function and the private 
_PyBytes_Resize() function. Later, if needed, we can consider to expose 
_PyBytes_Resize() in the limited C API.


> * by PyObject_CallFinalizerFromDealloc() to resurrect an object

I found a few projects which basically reimplement the PEP 442 logic in their 
tp_dealloc function. Example with pyuv resurrect_object() function:
https://github.com/saghul/pyuv/blob/9d226dd61162a998745681eb87ef34e1a7d8586a/src/handle.c#L9

For these, using PEP 442 tp_finalizer here would avoid relying on private 
functions like _Py_NewReference(), make the code simpler and more reliable.

--

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Quentin Wenger


Quentin Wenger  added the comment:

> It seems you don't know some knowledge of encoding yet.

I don't have to be ashamed of my knowledge of encoding. Yet you are right that 
I was missing a subtlety, which is that latin-1 is a strict subset of Unicode 
rather than a completely arbitrary encoding. Thank you for that.

So what you are saying is that group names in bytes regexes can only be 
specified directly (without -explicit- encoding), so de facto they are limited 
to the latin-1 subset.

Very well.

But then, once again:

1) why convert them to string when spitting them out? bytes they were when 
going in, bytes they should remain... **By converting them you are choosing an 
arbitrary encoding, even if it is the "natural" one.**
2) this limitation to the latin-1 subset is not compatible with the 
documentation, which says that valid Python identifiers are valid group names. 
If this was really the case, then I would expect to be able to use any string 
for which .isidentifier() is true as a group name, programmatically.

--

___
Python tracker 

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



[issue40991] Can't open more than on .py file with IDLE

2020-06-16 Thread Brendan Steffens


New submission from Brendan Steffens :

I am using Python 3.7.2, macOS Catalina 10.15.5.

When I double click a .py script from the Finder, it opens it, along with IDLE 
shell. When I click a second .py script so I can view both at once, it won't 
open the second one.

--
assignee: terry.reedy
components: IDLE
messages: 371658
nosy: BrendanSteffens, terry.reedy
priority: normal
severity: normal
status: open
title: Can't open more than on .py file with IDLE
type: behavior
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



[issue40989] [C API] Remove _Py_NewReference() and _Py_ForgetReference() from the public C API

2020-06-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20094
pull_request: https://github.com/python/cpython/pull/20915

___
Python tracker 

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



[issue40992] Wrong warning in asyncio debug mode

2020-06-16 Thread Alex Alex


New submission from Alex Alex :

I run code in example and get message like:
Executing () created at /usr/lib/python3.7/asyncio/futures.py:288> 
took 2.000 seconds

It say that coroutine run for 2 second but it was run for 5 second. Also if I 
comment part in qwe function after await I won't get any warning, but should.

--
components: asyncio
files: asyncio-wrong-warn.py
messages: 371659
nosy: Alex Alex, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Wrong warning in asyncio debug mode
versions: Python 3.7
Added file: https://bugs.python.org/file49237/asyncio-wrong-warn.py

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Quentin Wenger

Quentin Wenger  added the comment:

I prove my point that the decoding to string is arbitrary:

```
>>> import re
>>> orig_name = "Ř"
>>> orig_ch = orig_name.encode("cp1250") # Because why not?
>>> name = list(re.match(b"(?P<" + orig_ch + b">)", b"").groupdict().keys())[0]
>>> name == orig_name
False
>>> name
'Ø'
>>> name.encode("latin-1") == orig_ch
True
```

For any dynamically-constructed bytes regex pattern, a string group name as 
output is unusable. Only after latin-1-reencoding can it be safely compared. 
This latin-1 choice is arbitrary.

--

___
Python tracker 

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



[issue37369] Issue with pip in venv on Powershell in Windows

2020-06-16 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread STINNER Victor


New submission from STINNER Victor :

Currently, Travis CI runs C coverage and Python coverage jobs on all pull 
requests. This is a waste of resources: we should only run these jobs on 
branches like master.

Attached PR skips these jobs on pull requests.

Not only it's a waste of resources, but it seems like it's not longer possible 
to merge a PR as soon as Travis CI required jobs pass: a PR can only be merged 
when *all* Travis CI jobs complete. Problem: while a full test suite run takes 
around 20 min, coverage jobs take longer than 40 minutes.

By the way, the C coverage job fails with timeout, but that's a different issue.

--
components: Build
messages: 371661
nosy: vstinner
priority: normal
severity: normal
status: open
title: Don't run Python and C coverage jobs of Travis CI on pull requests
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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread STINNER Victor

STINNER Victor  added the comment:

Concrete issue: on my PR 20915, Travis CI mandatory jobs completed successfully 
but I wasn't able to merge the PR since GitHub says "travis-ci/pr Pending — The 
Travis CI build is in progress".

I cancelled the last running coverage job... but I was still unable to merge 
the PR, since Travis CI didn't report the status to GitHub.

I had to reschedule all Travis CI jobs...

--

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:

See also "Travis CI doesn't report its status or doesn't run on Python pull 
requests":
https://github.com/python/core-workflow/issues/371

--

___
Python tracker 

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



[issue40237] Test code coverage (C) job of Travis CI fails on test_distutils which creates _configtest.gcno file

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-40993: "Don't run Python and C coverage jobs of Travis CI on pull 
requests".

--

___
Python tracker 

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



[issue40971] Documentation still mentions 'u' string formatting option

2020-06-16 Thread Shubham Upreti


Shubham Upreti  added the comment:

Should i take this issue?

--
nosy: +shubh07

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-40237: "Test code coverage (C) job of Travis CI fails on 
test_distutils which creates _configtest.gcno file".

--

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:

Documentation about skipping jobs on pull requests:
https://docs.travis-ci.com/user/pull-requests/#how-pull-requests-are-built

I don't think that the following method works for the issue:

"To only build on push events not on pull requests, disable Build on Pull 
Requests in your repository settings."

That would disable all jobs, not only coverage jobs.

--

___
Python tracker 

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



[issue40991] Can't open more than on .py file with IDLE

2020-06-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Almost certainly Catalina - tcl/tk issue.  Fix difficult and unknown.  Won't 
make 3.7.  In the meanwhile, use IDLE's file=> open menu.  See original issue 
38946 for more.

--
components: +macOS -IDLE
nosy: +ned.deily, ronaldoussoren
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> IDLE on macOS 10.15 Catalina does not open double-clicked files 
if app already launched

___
Python tracker 

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



[issue40991] Can't open more than on .py file with IDLE

2020-06-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee: terry.reedy -> 

___
Python tracker 

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



[issue37673] Tkinter won't create 5000 check boxes, stops at 1309.

2020-06-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> third party
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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fc710ee266e9461fdba9933ec6004318db588820 by Victor Stinner in 
branch 'master':
bpo-40993: Don't run Travis CI coverage on PRs (GH-20916)
https://github.com/python/cpython/commit/fc710ee266e9461fdba9933ec6004318db588820


--
message_count: 5.0 -> 6.0
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +20096
pull_request: https://github.com/python/cpython/pull/20917

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +20096
pull_request: https://github.com/python/cpython/pull/20917

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20097
pull_request: https://github.com/python/cpython/pull/20918

___
Python tracker 

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



[issue37673] Tkinter won't create 5000 check boxes, stops at 1309.

2020-06-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Lou, when you respond by email, please snip the already posted email you are 
responding to.  The redundant noise makes *your* message harder to read.  
(Leaving an especially relevant line or two is OK.)

E.Paine.  Thank you for the confirmation.  Learning tcl/tk well enough to write 
test cases like this is something I have avoided, and Serhiy mostly works on 
other modules.  I hope you continue.

--

___
Python tracker 

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



[issue40989] [C API] Remove _Py_NewReference() and _Py_ForgetReference() from the public C API

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fcc60e40bbfe8a229b8b83f1d1ee77fd4bf870d1 by Victor Stinner in 
branch 'master':
bpo-40989: Make _PyTraceMalloc_NewReference() internal (GH-20915)
https://github.com/python/cpython/commit/fcc60e40bbfe8a229b8b83f1d1ee77fd4bf870d1


--

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Ma Lin


Ma Lin  added the comment:

> this limitation to the latin-1 subset is not compatible with the 
> documentation, which says that valid Python identifiers are valid group names.

Not all latin-1 characters are valid identifier, for example:

>>> '\x94'.encode('latin1')
b'\x94'
>>> '\x94'.isidentifier()
False

There is a workaround, you can convert `bytes` to `str` with "latin-1" decoder 
before processing, IIRC there will be no extra overhead (memory/speed) during 
processing, then the name and content are the same type. :)

--

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread miss-islington


miss-islington  added the comment:


New changeset 3cf809475a93228a3cb310b4d10d38f3b9d44c1f by Miss Islington (bot) 
in branch '3.9':
bpo-40993: Don't run Travis CI coverage on PRs (GH-20916)
https://github.com/python/cpython/commit/3cf809475a93228a3cb310b4d10d38f3b9d44c1f


--

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread miss-islington


miss-islington  added the comment:


New changeset 071bed842eeff9673bc5c4f64e3916a151132d2a by Miss Islington (bot) 
in branch '3.8':
bpo-40993: Don't run Travis CI coverage on PRs (GH-20916)
https://github.com/python/cpython/commit/071bed842eeff9673bc5c4f64e3916a151132d2a


--

___
Python tracker 

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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-16 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 51c5896b6205911d29ac07f167ec7f3cf1cb600d by Pablo Galindo in 
branch 'master':
bpo-40958: Avoid buffer overflow in the parser when indexing the current line 
(GH-20875)
https://github.com/python/cpython/commit/51c5896b6205911d29ac07f167ec7f3cf1cb600d


--

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Ma Lin

Ma Lin  added the comment:

Please look at these:

>>> orig_name = "Ř"
>>> orig_ch = orig_name.encode("cp1250") # Because why not?
>>> orig_ch
b'\xd8'
>>> name = list(re.match(b"(?P<" + orig_ch + b">)", 
b"").groupdict().keys())[0]
>>> name
'Ø'  # '\xd8'
>>> name == orig_name
False
>>> name.encode("latin-1")
b'\xd8'
>>> name.encode("latin-1") == orig_ch
True

"Ř" (\u0158) --cp1250--> b'\xd8'
"Ø" (\u00d8) --latin-1--> b'\xd8'

--

___
Python tracker 

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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-16 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread hai shi


hai shi  added the comment:

> Attached PR skips these jobs on pull requests.
I am not familiar with travis ci. coverage jobs can tell us how many features 
need add unit tests. Can we use other CI services to do this job? MAYBE in 
checks gate or something other services like buildbot.python.org?

--

___
Python tracker 

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



[issue37857] Setting logger.level directly has no effect due to caching in 3.7+

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:

Vinay:
> That code in the wild that sets the level attribute directly is wrong and 
> should be changed, right? The documentation has always been clear that 
> setLevel() should be used. If we now take steps to support setting the level 
> via attribute, isn't that encouraging bypassing the documented APIs? I'm not 
> sure such misuse is widespread.

I understood that Zane Bitter opened this issue *because* people misuses the 
logging API.


Vinay:
> (...) Sure, mistakes will happen, and that's the price paid when one doesn't 
> follow documentation. It feels wrong to do this as a band-aid to help out 
> people who didn't do the right thing.

setLevel() enforces consistency: it calls _checkLevel() to convert string to 
integer. Also, Logger.setLevel() also invalidates caches.

Having a way to update the level without invalidating caches sounds like a bug 
to me.

--

Zane proposed to deprecate setting the level attribute in PR 15286. I dislike 
this idea. It's kind of weird to be able to *read* a public attribute but not 
to *set* it. Either the attribute should be removed by adding a getLevel() 
method (and deprecate the attribute and then remove it), or it should be 
possible to get and set it.

I'm in favor of not deprecating "logger.level = level". Just wrap it into a 
property silently.

--

I rewrote the microbenchmark using pyperf:
---
import pyperf

class Logger(object):
def __init__(self):
self._levelprop = self.level = 0

@property
def levelprop(self):
return self.level


logger = Logger()
ns = {'logger': logger}
runner = pyperf.Runner()
runner.timeit('read attribute', 'logger.level', globals=ns)
runner.timeit('read property', 'logger.levelprop', globals=ns)
---

Result:

* read attribute: Mean +- std dev: 38.9 ns +- 0.8 ns
* read property: Mean +- std dev: 104 ns +- 3 ns

Reading a property is 2.7x slower than reading an attribute. Well, that's not 
surprising to have an overhead. But the absolute numbers remain reasonable. 
We're talking about 100 ns, not 100 ms.

IMHO the overhead is reasonable in 3rd party code. Inside the logging module, 
only the private _level attribute should be used and so there is no overhead.

--
nosy: +vstinner

___
Python tracker 

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



[issue40893] None

2020-06-16 Thread Nam Tran


Change by Nam Tran :


--
components: +Library (Lib) -Tkinter
title: tkinter integrate TkDND support -> None
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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-06-16 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +20099
pull_request: https://github.com/python/cpython/pull/20920

___
Python tracker 

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



[issue40987] Add tests to test_interpreters to import C extension modules converted to PEP 489 multiphase initialization

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:

According to Dong-hee, importing dbm in a subinterpreter leaks references:
https://github.com/python/cpython/pull/20920#issuecomment-644856401

--

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread STINNER Victor


STINNER Victor  added the comment:

> coverage jobs can tell us how many features need add unit tests.

Coverage jobs are still run with my changes. 
https://codecov.io/gh/python/cpython is still updated.

My change only stops running coverage jobs on pull requests.

--

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Quentin Wenger

Quentin Wenger  added the comment:

> > this limitation to the latin-1 subset is not compatible with the 
> > documentation, which says that valid Python identifiers are valid group 
> > names.
> 
> Not all latin-1 characters are valid identifier, for example:
> 
> >>> '\x94'.encode('latin1')
> b'\x94'
> >>> '\x94'.isidentifier()
> False

True but that's not the point. Δ is a valid Python identifier but not a valid 
group name in bytes regexes, because it is not in the latin-1 plane. The 
documentation does not mention this.


> There is a workaround, you can convert `bytes` to `str` with "latin-1" 
> decoder before processing, IIRC there will be no extra overhead 
> (memory/speed) during processing, then the name and content are the same 
> type. :)

I am not searching a workaround for my current code.

And the simplest workaround is to latin-1-convert back to bytes, because re 
should not latin-1-convert to string in the first place.

Are you saying that the proper way to use bytes regexes is to use string 
regexes instead?


> Please look at these:
> 
> >>> orig_name = "Ř"
> >>> orig_ch = orig_name.encode("cp1250") # Because why not?
> >>> orig_ch
> b'\xd8'
> >>> name = list(re.match(b"(?P<" + orig_ch + b">)", 
> b"").groupdict().keys())[0]
> >>> name
> 'Ø'  # '\xd8'
> >>> name == orig_name
> False
> >>> name.encode("latin-1")
> b'\xd8'
> >>> name.encode("latin-1") == orig_ch
> True
> 
> "Ř" (\u0158) --cp1250--> b'\xd8'
> "Ø" (\u00d8) --latin-1--> b'\xd8'

That's no surprize, I carefully crafted this example. :-)

Rather, that is exactly my point: several different strings (which can all be 
valid Python identifiers) can have the same single-byte representation, simply 
by the mean of different encodings (duh).

So why convert group names to strings when outputting them from matches, when 
you don't know where the bytes come from, or even whether they ever were 
strings? That should be left to the programmer.

--

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread hai shi


hai shi  added the comment:

> Coverage jobs are still run with my changes.
> https://codecov.io/gh/python/cpython is still updated.

Copy that, thanks.

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-06-16 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset c4862e333ab405dd5789b4061222db1982147de4 by Dong-hee Na in branch 
'master':
bpo-1635741: Port _gdbm module to multiphase initialization (GH-20920)
https://github.com/python/cpython/commit/c4862e333ab405dd5789b4061222db1982147de4


--

___
Python tracker 

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



[issue40987] Add tests to test_interpreters to import C extension modules converted to PEP 489 multiphase initialization

2020-06-16 Thread Dong-hee Na


Dong-hee Na  added the comment:

> According to Dong-hee, importing dbm in a subinterpreter leaks references:

GH-20920 fixed the leak :)

--

___
Python tracker 

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



[issue40893] tkinter: integrate TkDND support

2020-06-16 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +Tkinter
title: None -> tkinter: integrate TkDND support
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



[issue40594] urljoin since 3.5 incorrectly filters out double slashes

2020-06-16 Thread Open Close


Open Close  added the comment:

To Senthil Kumaran:

https://bugs.python.org/issue40594#msg371092
> As far as I know, the browsers remove them, combine them as a single URL. 
> (Tested on Chrome with some URLs to confirm on June 2020)

How did you test them?

--
nosy: +op368

___
Python tracker 

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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 7795ae8f05a5b1134a576a372f64699176cac5fb by Miss Islington (bot) 
in branch '3.9':
bpo-40958: Avoid buffer overflow in the parser when indexing the current line 
(GH-20875) (GH-20919)
https://github.com/python/cpython/commit/7795ae8f05a5b1134a576a372f64699176cac5fb


--

___
Python tracker 

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



[issue22167] iglob() has misleading documentation (does indeed store names internally)

2020-06-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Sounds good.

FWIW, and totally off-topic, I find it annoying that pathlib's .glob() method 
supports ** in patterns, but its cousing .match() does not:

>>> p = pathlib.Path("Lib/test/support/os_helper.py")
>>> p.match("Lib/**/*.py")
False
>>>

--

___
Python tracker 

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



[issue1222585] C++ compilation support for distutils

2020-06-16 Thread Ryan Schmidt


Ryan Schmidt  added the comment:

What needs to happen to get this 15 year old bug fixed? It prevents C++ Python 
modules from being compiled in situations where the user needs to supply 
CXXFLAGS.

--
nosy: +ryandesign

___
Python tracker 

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



[issue1222585] C++ compilation support for distutils

2020-06-16 Thread Christian Heimes


Christian Heimes  added the comment:

Please report the issue with setuptools. distutils is no longer under 
development. We recommend that all users use setuptools.

--

___
Python tracker 

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



[issue40994] Very confusing documenation for abc.Collections

2020-06-16 Thread Sydney Pemberton


New submission from Sydney Pemberton :

I was writing a Jupyter notebook at the time, which I think perfectly 
illustrated the blind alley this documentation bug led me down before beating 
me up and stealing my lunch money.

I have come to this point in the documentation at least half a dozen times 
while learning Python and always left confused and with the sense that Python 
is more complicated than I had thought. 

Notebook attached. 

This documentation style violates two principles:
 - The implied structure of headings and content below it.
 - Many natural languages do not contain context-sensitive grammar and so using 
the "respectively" idiom can be very confusing for people who speak English as 
a second language.

--
assignee: docs@python
components: Documentation
files: Confusing docs.ipynb
messages: 371690
nosy: Sydney Pemberton, docs@python
priority: normal
severity: normal
status: open
title: Very confusing documenation for abc.Collections
versions: Python 3.8
Added file: https://bugs.python.org/file49238/Confusing docs.ipynb

___
Python tracker 

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



[issue40993] Don't run Python and C coverage jobs of Travis CI on pull requests

2020-06-16 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +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



[issue40594] urljoin since 3.5 incorrectly filters out double slashes

2020-06-16 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

> How did you test them?

https://about.google//products/
https://www.google.com///search?q=something

Were redirecting, and collapsing multiple slashes to single.

Now, when I try this on:

> https://en.wikipedia.org/w//index.php?search=foobar+something

was not.

Sorry. It is false to say that it was a default client behavior of chrome.

--

___
Python tracker 

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



[issue40980] group names of bytes regexes are strings

2020-06-16 Thread Quentin Wenger

Quentin Wenger  added the comment:

And there's no need for a cryptic encoding like cp1250 for this problem to 
arise. Here is a simple example with Python's default encoding utf-8:

```
>>> a = "ú"
>>> b = list(re.match(b"(?P<" + a.encode() + b">)", b"").groupdict())[0]
>>> a.isidentifier()
True
>>> b.isidentifier()
True
>>> b
'ú'
>>> a.encode() == b.encode("latin1")
True
```

For reference, here is the very source of the issue: 
https://github.com/python/cpython/blob/master/Lib/sre_parse.py#L228

--

___
Python tracker 

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



[issue13554] Tkinter doesn't use higher resolution app icon

2020-06-16 Thread E. Paine


E. Paine  added the comment:

This is a tk issue, as it can be reproduced using 'wish' (tcl 8.6.10):

wm title . "APP title"
wm iconname . APP
image create photo .iconL -file icon256.png
image create photo .iconS -file icon48.png
wm iconphoto . -default .iconL .iconS

Thank you th9 for reporting this, but it should be closed as "third party".

--
nosy: +epaine

___
Python tracker 

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



[issue40979] typing module docs: keep text, add subsections

2020-06-16 Thread ramalho


ramalho  added the comment:

Thanks, I am happy to submit a PR. Before I do, I'd like to discuss the 
subsection titles, starting from the arrangement in typing.__all__:


# Special typing constructs (source comment is: "Super-special typing 
primitives")
Any Callable ClassVar Final ForwardRef Generic Literal Optional Protocol Tuple 
Type TypeVar Union 

In this section I propose we add:

- NamedTuple and TypedDict: source comments say "Not really a type" (for both), 
and I believe it's confusing to list them along the other collections. Tuple is 
already in the "Special constructs" category, so NamedTuple should follow in 
there. TypedDict is very different from the other collections, it's purely a 
type hinting construct with no runtime counterpart so it's pretty special IMHO.

- AnyStr: should be listed right after TypeVar, NoReturn, NewType

- Text, TYPE_CHECKING: I am not sure about those, but if they are removed from 
the "One-off things" all that remains are functions and decorators, which looks 
good.


# ABCs (from collections.abc) [Keep this title]
AbstractSet ByteString Container ContextManager Hashable ItemsView Iterable 
Iterator KeysView Mapping MappingView MutableMapping MutableSequence MutableSet 
Sequence Sized ValuesView Awaitable AsyncIterator AsyncIterable Coroutine 
Collection AsyncGenerator AsyncContextManager

# Concrete collection types [keep this title]
ChainMap Counter Deque Dict DefaultDict List OrderedDict Set FrozenSet 

- Generator should go with "ABCs"
- NamedTuple TypedDict should go with "Special typing constructs"

 
# Protocols (source comment is "Structural checks, a.k.a. protocols.")
Reversible SupportsAbs SupportsBytes SupportsComplex SupportsFloat 
SupportsIndex SupportsInt SupportsRound


# Functions and decorators (source comment is "One-off things.")
cast final get_args get_origin get_type_hints no_type_check 
no_type_check_decorator  overload runtime_checkable 

- AnyStr NewType NoReturn: these should go with "Special typing constructs"

- Text TYPE_CHECKING: either go with "Special typing constructs" or a constants 
section, which could include AnyStr as well

There are also the IO and re types which could have their own subsections.

Looking forward for feeback on this. Thanks!

--

___
Python tracker 

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



  1   2   >