[issue44295] self.assertDictContainsSubset warning is unhelpful

2021-06-07 Thread Anthony Sottile


Change by Anthony Sottile :


--
components: +Library (Lib)
type:  -> behavior

___
Python tracker 

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



[issue44226] Threads shutting down in Py 2.7 but not in Py 3.69 while making SSH connection using Paramiko module

2021-06-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

No, I'm sorry that I don't. The example is too large for me (or probably any of 
our volunteers) to look through and reason about. I think asking on a forum 
like Stack Overflow is your best bet, but even there they will ask for a 
simpler example. Or maybe try the python-list mailing list 
https://mail.python.org/mailman/listinfo/python-list.

If you could get this down to a 10 to 20 line example, maybe we could determine 
here if it's a python bug, or a deliberate change.

--

___
Python tracker 

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



[issue44334] urllib.parse.parse_qsl cannot parse large data

2021-06-07 Thread Mustafa El Agamey


Change by Mustafa El Agamey :


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

___
Python tracker 

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



[issue44226] Threads shutting down in Py 2.7 but not in Py 3.69 while making SSH connection using Paramiko module

2021-06-07 Thread Muralidhar BN


Muralidhar BN  added the comment:

Dear Eric Smith,
Do we have any analysis for this issue for information shared ? 
Appreciate your quick reply.
PS: Making a simple socket connection instead of paramiko or pyssh ssh 
connection gives similar error

Thank you

--

___
Python tracker 

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



[issue44283] Add jump table for certain safe match-case statements

2021-06-07 Thread Anders Munch


Anders Munch  added the comment:

Are you sure you want to do this?

This optimisation is not applicable if the matched values are given symbolic 
names.  You would be encouraging people to write bad code with lots of 
literals, for speed.

--
nosy: +AndersMunch

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-07 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +25165
pull_request: https://github.com/python/cpython/pull/26577

___
Python tracker 

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



[issue44333] Segmentation fault

2021-06-07 Thread Zachary Ware


Zachary Ware  added the comment:

Your examples appear to use code from outside the standard library, some of 
which may include C code that will happily segfault your process well outside 
of Python's control.  You'll need to reduce your problem to the smallest 
possible reproducer (100 lines or less is almost always possible) using no code 
from outside of the standard library.  If you can do so, please reopen this 
issue with your small reproducer.  Until then, though, I'm closing the issue as 
probably third-party.

--
nosy: +zach.ware
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



[issue44333] Segmentation fault

2021-06-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

The code you've attached doesn't generate the error you provided.

--

___
Python tracker 

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



[issue44334] urllib.parse.parse_qsl cannot parse large data

2021-06-07 Thread Mustafa El Agamey


Change by Mustafa El Agamey :


--
title: urllib cannot parse large data -> urllib.parse.parse_qsl cannot parse 
large data

___
Python tracker 

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



[issue44334] urllib cannot parse large data

2021-06-07 Thread Mustafa El Agamey


Change by Mustafa El Agamey :


--
components: Extension Modules
nosy: eng.mustafaelagamey
priority: normal
severity: normal
status: open
title: urllib cannot parse large data
type: performance
versions: Python 3.8

___
Python tracker 

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



[issue44187] Implement infrastructure for quickening and specializing

2021-06-07 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 001eb520b5757294dc455c900d94b7b153de6cdd by Mark Shannon in 
branch 'main':
bpo-44187: Quickening infrastructure (GH-26264)
https://github.com/python/cpython/commit/001eb520b5757294dc455c900d94b7b153de6cdd


--

___
Python tracker 

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



[issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf

2021-06-07 Thread Mark Dickinson

New submission from Mark Dickinson :

For floats x and y, x ** y and math.pow(x, y) mostly agree. There are three 
points of difference:

1. if x is finite and negative and y is finite and non-integral, then x ** y 
returns a complex number, while math.pow(x, y) raises ValueError
2. for cases where x ** y raises ZeroDivisionError (for example, 0.0 ** -1.0), 
math.pow(x, y) raises ValueError instead
3. the special cases 0.0 ** -inf and (-0.0) ** -inf return inf, but the 
equivalent math.pow calls raise ValueError

That third discrepancy is a surprising one: in particular, it's the only case 
where math.pow does not follow IEEE 754 rules.

Note that the math.pow behaviour is not accidental. The special cases were 
based on C99 Annex F (and are documented to do so), but the standards 
themselves have evolved here. In chronological order:

- IEEE 754-1985 did not cover transcendental functions, so has nothing to say 
on the topic of special values for pow.
- C99 §F.9.4.4 implies that pow(0, -inf) should raise the "divide-by-zero" 
exception; the relevant clause covers pow(0, y) for any y satisfying y < 0 and 
y not an odd integer
- IEEE 754-2008 §9.2.1 has an explicit clause specifying that pow(0, -inf) 
should be inf and that the operation does not raise any exception.
- C11 §F.10.4.4 mentions the case pow(0, -inf) explicitly and now says "may 
raise the divide-by-zero floating-point exception". The "may" is significant: 
other clauses simply say "raises the "divide-by-zero" floating-point exception".
- IEEE 754-2019 §9.2.1 is unchanged from IEEE 754-2008 for this particular 
special case.
- Similarly, C17 is unchanged from C11 in this respect.

For Python 3.11, I propose changing the behaviour of math.pow in this corner 
case so that it returns inf instead of raising. This would make math.pow 
conformant with IEEE 754, consistent with C11 and later, and consistent with 
the built-in pow function.

--
messages: 395277
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: Discrepancy between math.pow(0.0, -inf) and 0.0**-inf
versions: Python 3.11

___
Python tracker 

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



[issue44338] Port LOAD_GLOBAL to adaptive interpreter

2021-06-07 Thread Mark Shannon


New submission from Mark Shannon :

Port the implementation of LOAD_GLOBAL to the new adaptive interpreter

Once this and https://bugs.python.org/issue44337 are implemented we can remove 
the old opcache.

--
messages: 395272
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Port LOAD_GLOBAL to adaptive interpreter

___
Python tracker 

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



[issue44334] Use bytearray in urllib.unquote_to_bytes

2021-06-07 Thread Terry J. Reedy


New submission from Terry J. Reedy :

'eng' claimed in original title that "urllib.parse.parse_qsl cannot parse large 
data".  On original PR, said problem with 6-7 millions bytes.

Claim should be backed up by a generated example that fails with original code 
and succeeds with new code.  Claims of 'faster' also needs some examples.

Original PRs must nearly all propose merging a branch created from main into 
main.  Performance enhancements are often not backported.

--
nosy: +orsenthil, terry.reedy
title: urllib.parse.parse_qsl cannot parse large data -> Use bytearray in 
urllib.unquote_to_bytes
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue44334] Use bytearray in urllib.unquote_to_bytes

2021-06-07 Thread Gregory P. Smith


Change by Gregory P. Smith :


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



[issue44336] Windows buildbots hang after fatal exit

2021-06-07 Thread Jeremy Kloth


New submission from Jeremy Kloth :

Currently, a stack overflow is causing the debug build Windows buildbots to 
abort (bpo-11105).  Once the regrtest process is terminated, the buildbot test 
process hangs indefinitely waiting for handles to be closed (see msg350191 from 
bpo-37531 for some details).

--
components: Tests, Windows
messages: 395268
nosy: jkloth, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows buildbots hang after fatal exit
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44335] "Wrong" invalid character identified

2021-06-07 Thread Andre Roberge

New submission from Andre Roberge :

When using Python 3.10.0b2 on a line with more than one invalid characters, the 
second one is identified as being incorrect, whereas in previous versions the 
first such character was identified.


> py -3.8 unicode_quote.py
  File "unicode_quote.py", line 2
a = « hello » « world »
^
SyntaxError: invalid character in identifier


> py -3.9 unicode_quote.py
  File "C:\...\unicode_quote.py", line 2
a = « hello » « world »
^
SyntaxError: invalid character '«' (U+00AB)


> py -3.10 unicode_quote.py
  File "C:\...\unicode_quote.py", line 2
a = « hello » « world »
^
SyntaxError: invalid character '»' (U+00BB)

--
messages: 395267
nosy: aroberge, pablogsal
priority: normal
severity: normal
status: open
title: "Wrong" invalid character identified
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



[issue44337] Port LOAD_ATTR to adaptive interpreter

2021-06-07 Thread Mark Shannon


New submission from Mark Shannon :

Port the implementation of LOAD_ATTR to the new adaptive interpreter

--
messages: 395271
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Port LOAD_ATTR to adaptive interpreter

___
Python tracker 

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



[issue44336] Windows buildbots hang after fatal exit

2021-06-07 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

The PR has been successfully run on the buildbots.

Before:
https://buildbot.python.org/all/#/builders/593/builds/58

After:
https://buildbot.python.org/all/#/builders/593/builds/59

With these changes, at least now aborted runs can be seen as direct failures of 
Python's tests instead of just builder exceptions.

--

___
Python tracker 

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



[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-06-07 Thread Steve Dower


Steve Dower  added the comment:

The appx layout is also the only one in CI that actually uses an installed 
layout - all the rest run tests from the source tree. So it could be related to 
that.

If it's a warning, it could also be that the warning is being triggered 
somewhere else first. Since tests run in a random order, you'll want to look 
for how reliable the failure is.

--

___
Python tracker 

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



[issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf

2021-06-07 Thread Mark Dickinson


Change by Mark Dickinson :


--
components: +Library (Lib)
type:  -> enhancement

___
Python tracker 

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



[issue44283] Add jump table for certain safe match-case statements

2021-06-07 Thread Brandt Bucher


Brandt Bucher  added the comment:

> Are you sure you want to do this?

No, not yet. But there has been some positive feedback here, and it seems like 
an interesting project to prototype. :)

> This optimisation is not applicable if the matched values are given symbolic 
> names. You would be encouraging people to write bad code with lots of 
> literals, for speed.

I had the same concern initially, but I'm honestly not losing too much sleep 
over it. Literals already get lots of optimizations that symbolic constants 
don't, and to me it seems a bit silly to avoid optimizing literals here when it 
is quite straightforward (and powerful) to do so. There are also many cases 
where using symbolic constants for certain literals doesn't make much sense.

I'd be okay not loudly publicizing this change if it lands. After all, I'm the 
guy who spent the better part of a year trying to convince people that this is 
Not A Switch Statement. :)

(Although, on the flip side, maybe it will help appease the people who have 
been asking for one all these years.)

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-07 Thread Eric Snow


Eric Snow  added the comment:


New changeset 2ab27c4af4ddf7528e1375e77c787c7fbb09b5e6 by Eric Snow in branch 
'main':
bpo-43693: Un-revert commits 2c1e258 and b2bf2bc. (gh-26577)
https://github.com/python/cpython/commit/2ab27c4af4ddf7528e1375e77c787c7fbb09b5e6


--

___
Python tracker 

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



[issue42627] urllib.request.getproxies() misparses Windows registry proxy settings

2021-06-07 Thread 狂男风

狂男风  added the comment:

We should have no problem with how to parse HTTP proxy and HTTPS proxy. But I 
recently discovered an additional problem when using `requests`, that is, how 
to parse the SOCKS proxy correctly.

I investigated the parsing of some commonly used software:
`curl` will try to read the `all_proxy` variable first, if not, then read the 
two system environment variables `http_proxy` and `https_proxy`.
Only these two environment variables related to proxy exist in most Linux 
distributions.
The following formats are valid for `curl`:
```
export http_proxy=socks4h://127.0.0.1:5050
export https_proxy=socks5://1.1.1.1:4040
```
The `h` in `socks4h` means doing DNS query on the proxy server.

`requests` also follows this format.
If you want to use the socks proxy in `requests[socks]`, you need to specify 
the proxies parameter:
```
proxies['http']='socks4://127.0.0.1:6060'
proxies['https']='socks5h://127.0.0.1:7070'
```

Since it is customary to resolve SOCKS proxies in this way, I think CPython can 
consider doing the same with Windows registry.

In previous versions, CPython parsed the SOCKS proxy in the Windows registry 
`socks=localhost:8080` as:
```
proxies['socks']='socks://localhost:8080'
```
I think it can be changed to
```
proxies['http']=proxies['http'] or'socks4://localhost:8080'
proxies['https']=proxies['http'] or'socks4://localhost:8080'
proxies['socks']='socks://localhost:8080'
```
The use of `or` is to prevent the existing HTTP and HTTPS proxy settings from 
being overwritten.  
I tried it on my Win10 PC. When I set up HTTP and SOCKS proxies at the same 
time, IE and Edge will use HTTP proxy.  
The reason using `socks4` instead of `socks4h` or `socks5` is that, when I 
change system proxy setting to a remote SOCKS proxy, I found that IE and Edge 
do not query DNS from the proxy but from local DNS polluted by the ISP. And if 
the running socks proxy version is SOCKS5, it will output errors of 
`unsupported socks version 0x4`. So Windows only supports the SOCKS proxy 
`socks4://`.  
It's a pity that we don't know the code of Windows, and I can't prove it with 
the codes.  
`proxies['socks']` is reserved for backward compatibility.

If you have any comments or suggestions, please let me know.

--

___
Python tracker 

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



[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-06-07 Thread Nils Kattenbeck


Nils Kattenbeck  added the comment:

> I believe it had something to do with TypedDict instances being instances of 
> dict at runtime, but I can't actually reconstruct the reason.

Hm that may be true.
My limited low-level Python knowledge leads me to believe that this could also 
be done using __new__ but I also read that most magic methods get called as 
type(Foo).__magic__(bar, ...) so that might not be possible.
(However also no methods can be declared on a TypedDict class so that might not 
be a problem?)

> Maybe it's written up in PEP 589, but I suspect not (I skimmed and couldn't 
> find it).

I read it completely and could not find anything

> If you ask on typing-sig maybe David Foster (who contributed the initial idea 
> and implementation) remembers.

I asked [here on 
typing-sig](https://mail.python.org/archives/list/typing-...@python.org/thread/RNFWPRLHTUTZES2FDSSMY472JFGMD4EW/)
 but did not yet get any responses.

--

___
Python tracker 

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



[issue44334] Use bytearray in urllib.unquote_to_bytes

2021-06-07 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

fwiw this sort of thing may be reasonable to backport to 3.9 as it is more than 
just a performance enhancement but also a resource consumption bug and should 
result in no behavior change.

"""
In case of form contain very large data ( in my case the string to parse was 
about 600 byte )
Old code use list of bytes during parsing consumes a lot of memory
New code will use bytearry , which use less memory
""" - text from the original PR

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue44336] Windows buildbots hang after fatal exit

2021-06-07 Thread Jeremy Kloth


Change by Jeremy Kloth :


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

___
Python tracker 

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



[issue44187] Implement infrastructure for quickening and specializing

2021-06-07 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.11

___
Python tracker 

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



[issue41299] Python3 threading.Event().wait time is twice as large as Python27

2021-06-07 Thread Steve Dower


Steve Dower  added the comment:

Change looks good. 3.8 is security fixes only at this stage, but it can go back 
to 3.9

--
versions:  -Python 3.8

___
Python tracker 

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



[issue44336] Windows buildbots hang after fatal exit

2021-06-07 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

To verify the PR, can someone please add the test-with-buildbots label on GH?

--

___
Python tracker 

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



[issue27901] DOC: inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2021-06-07 Thread Andrei Kulakov

Andrei Kulakov  added the comment:

The data model docs still have 2 references to unbound methods:

For callables, it may indicate that an instance of the given type (or a 
subclass) is expected or required as the first positional argument (for 
example, CPython sets this attribute for unbound methods that are implemented 
in C).
...
Incorrectly attempting to invoke an unbound method of a class in this way is 
sometimes referred to as ‘metaclass confusion’, and is avoided by bypassing the 
instance when looking up special methods:

So the concept of unbound methods is still valid, and in addition I would 
expect that majority of users think of a method defined in a class as a 
"method" rather than "function defined in class that will become a method" - 
perhaps because the former is much shorter ;-)

Therefore inspect.ismethod() returning False can easily cause confusion.

I think it might be worth adding this note to `ismethod` docs, something like:

"While the term 'unbound method' is commonly used for functions defined on 
class objects, from the point of view of `inspect` it is not a method because 
the object itself is just a plain function."

I can make a PR if this sounds reasonable?

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44343] Adding the "with" statement support to ContextVar

2021-06-07 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue40468] IDLE: configdialog tab rearrange

2021-06-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

There are two immediate issues.

2. Issues are blocked because of lack of room on the General pane.  The Windows 
Preferences frame is about as large as the Editor and Shell frame together.  
Splitting that way will leave room for enough more options for quite a while.

1. The screen on my 2012 MacBook Air is 768 pixels tall.  There are other 
people with screens about this small, though I doubt much smaller.  With the 
dock on the bottom, the configdialog buttons are not accessible.  (The are if 
IDLE is made full screen.)

The Additional Help Source box takes up over 20% of the Notebook pane height.  
With it removed and all panes shortened, the problem on my screen and other at 
least as tall will be fixed.

I am therefore adopting EP's idea of moving the Help menu extension to the 
Extensions tab.  I think it fits there better than on the Font page or either 
split of the General tab.

I am starting now to separate out a HelpSrc frame class in the code and a 
HelpSrcTest class in the test file.
---

EP, coordinated help on this other dialog issue is welcome.

--

___
Python tracker 

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



[issue44345] The first line (comment) of the parser.c is incorrect.

2021-06-07 Thread Akira Nonaka


Change by Akira Nonaka :


--
title: The First-line (comment) of the parser.c is incorrect. -> The first line 
(comment) of the parser.c is incorrect.

___
Python tracker 

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



[issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf

2021-06-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+1 from me as well.

--
nosy: +rhettinger

___
Python tracker 

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



[issue44345] The First-line (comment) of the parser.c is incorrect.

2021-06-07 Thread Akira Nonaka


New submission from Akira Nonaka :

The First-line (comment) of the parser.c is incorrect.

"// @generated by pegen.py from ./Grammar/python.gram"

pegen.py no longer exists. It is now "pegen" package.

--
components: Demos and Tools
messages: 395306
nosy: anonaka
priority: normal
severity: normal
status: open
title: The First-line (comment) of the parser.c is incorrect.
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



[issue44343] Adding the "with" statement support to ContextVar

2021-06-07 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +aeros, yselivanov

___
Python tracker 

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2021-06-07 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue44013] tempfile.TemporaryFile: name of file descriptor cannot be reused in consecutive initialization

2021-06-07 Thread Xiang Zhong

Xiang Zhong  added the comment:

Dear Mr. Jollans,

Thanks for your additions, I think I know well about the SHELL programming 
language, now, every thing about the low-level file descriptors is linked 
together. I guess now I completely know your writing, thanks again for your 
detail explanations!

The potential “bug” of your consideration is the post operation caused by 
OS.close() in the delay/conflict of tempfile.Temporary(), as a result, fd does 
not know whether its linked file descriptor is valid or not due to “with” 
method.

However, if you have a look on “test_4” in attached “xtempfile.py”, you will 
see that in the first fd generated by tempfile.Temporary(), it is assumed to be 
handled by the first “with”, no more other operations are executed. Even after 
first “with” it becomes invalid, there are no further executions performed.

On the second fd returned by tempfile.TemporaryFile(), it should be a valid 
file descriptor no matter how the first one is dealt with. From the coding 
perspective, these two variables are just “happen to” be the same chars.

Besides, from my testing, changing any one of them to the different variable 
name, then the problem is gone. Furthermore, if you have a look on “test_3”, 
“test_5” and “test_6” (xtempfile.py), especially on “test_5”, they all prove 
that it should be a bug.

To go deeper, I attached another test file “new-xtempfile.py”, on “test_11”, 
you will see that it should have some problems on "__del__" method if its 
linking file descriptor is closed by os.close().

They two may or may not be the same problem.


Thanks again for your illustration of “fd.fileno()” and “fd.name”.

--

___
Python tracker 

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



[issue44330] IDLE: Colorizer and output tests hang on macOS

2021-06-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Yes, I have the 'old' 3.9.5.  In IDLE, ^C does not break the hang, but Restart 
Shell does.  As I expected, I had to skip test_outwin's test_write and 
test_writelines to stop that test hanging.

Next failure: test_sidebar.LineNumbersTest ends with test_toggle_linenumbering 
... OK.  That is the last test method and the hang is in tearDownClass 
"cls.root.update()".  Changing to .update_idletasks() fixes this.  I believe 
that the latter is what we usually use before destroying root.  But still, 
update should not crash.  At worst, a TclError.

With this fix, test_idle passes.  So do test_tcl and test_ttk_textonly.  
Test_tk and test_ttk_guionly each have 1 failure.  (For me) The test suite as a 
whole is a mess, with multiple Python-crashed message boxes.

--

___
Python tracker 

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



[issue44340] Add support for building cpython with clang thin lto

2021-06-07 Thread Brett Holman


New submission from Brett Holman :

The existing --with-lto argument could be extended to pass through a value to 
select non-default lto compiler options:

CC=clang ./configure --with-lto=thin

This would allow default behavior to remain unchanged, while allowing those 
that want to use thin lto to opt in.

For what it's worth, the tests (make test) pass using clang 11.1.0 and thinlto.

--
components: Interpreter Core
messages: 395293
nosy: holmanb
priority: normal
severity: normal
status: open
title: Add support for building cpython with clang thin lto
type: enhancement

___
Python tracker 

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



[issue44341] Conflict between re.match and match keyword

2021-06-07 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

`match` is a soft keyword. Which means that the interpreter should still 
recognise `match 'str': ...` even if the *name* "match" is defined.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-07 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +25173
pull_request: https://github.com/python/cpython/pull/26588

___
Python tracker 

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



[issue44341] Conflict between re.match and match keyword

2021-06-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I don't understand this example. 

> importing re.match directly into __main__ replaces the keyword with the 
> function. 

It has not replaced anything, if you do a match statement it works and doesn't 
call your function. For example:

>>> x = [1,2]
>>>
>>> def match(*args):
...print("Oh no")
...
>>> match x:
...case [y,z]:
...   print(y,z)
...
1 2

Here "match" when used as a statement has not been replaced by the function 
that prints "oh no" so the match statement works as expected and so does the 
function:

>>> match


--
nosy: +pablogsal
resolution:  -> not a bug
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



[issue44341] Conflict between re.match and match keyword

2021-06-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

As Steven mentions, match is a soft keyword:

>>> import keyword
>>> keyword.softkwlist
['_', 'case', 'match']

And they don't follow the same rules as keywords. Check the pattern matching 
PEPs for more info.

--

___
Python tracker 

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



[issue44343] Adding the "with" statement support to ContextVar

2021-06-07 Thread Joongi Kim


New submission from Joongi Kim :

This is just an idea: ContextVar.set() and ContextVar.reset() looks naturally 
mappable with the "with" statement.

For example:

a = ContextVar('a')
token = a.set(1234)
...
a.reset(token)

could be naturally rewritten as:

a = ContextVar('a')
with a.set(1234):
...

Is there any particular reason *not* to do this?
If not, I'd like make a PR to add this API.
Naming suggestions of this API are welcome, but it also seems possible to keep 
it "set()" if we retain the reference to the ContextVar instance in the Token 
instance.

--
components: Library (Lib)
messages: 395302
nosy: achimnol
priority: normal
severity: normal
status: open
title: Adding the "with" statement support to ContextVar
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf

2021-06-07 Thread Tim Peters


Tim Peters  added the comment:

+1. Although, to be fair, I'd personally be happy if (+-0)**inf returned, say, 
1.375 instead ;-)

--
nosy: +tim.peters

___
Python tracker 

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



[issue44344] Documentation for pow() should include the possibility of complex numbers as a return type

2021-06-07 Thread Erik Y. Adams


New submission from Erik Y. Adams :

https://docs.python.org/3/library/functions.html#pow

The built-in pow() function will return a complex number if the base is 
negative and the exponent is a float between 0 and 1. For example, the value 
returned by `pow(-1, 1.0/3)` is `(1.0002+1.7320508075688772j)`

The answer is mathematically correct, but `-2.0` is also mathematically 
correct. There is nothing in the documentation currently to suggest that a 
complex number might be returned; in fact, given the statement "[with] mixed 
operand types, the coercion rules for binary arithmetic operators apply", one 
might reasonably expect `-2.0` as the answer. 

I suggest the following sentences be added to the end of the second paragraph:

"If `base` is negative and the `exp` is a `float` between 0 and 1, a complex 
number will be returned. For example, `pow(-8, 1.0/3)` will return 
`(1.0002+1.7320508075688772j)`, and not `-2.0.`"

--
assignee: docs@python
components: Documentation
messages: 395305
nosy: docs@python, eyadams
priority: normal
severity: normal
status: open
title: Documentation for pow() should include the possibility of complex 
numbers as a return type
type: enhancement
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



[issue44345] The first line (comment) of the parser.c is incorrect.

2021-06-07 Thread Akira Nonaka


Change by Akira Nonaka :


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

___
Python tracker 

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



[issue44344] Documentation for pow() should include the possibility of complex numbers as a return type

2021-06-07 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

For some prior art, 
https://www.wolframalpha.com/input/?i=%28-8%29+%5E+%281%2F3%29 says it defaults 
to using "the principal root" over "the real-valued root"

Also, I think the relevant property is that the exponent is not an integer; 
being between 0 and 1 is irrelevant:

>>> pow(-8, 4/3)
(-8.005-13.856406460551014j)

Maybe the tweak could be something like

"Note that using a negative base with a non-integer exponent will return the 
principal complex exponent value, even if a different real value exists."

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache

2021-06-07 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Thanks, Victor :)

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-07 Thread Eric Snow


Eric Snow  added the comment:


New changeset 631f9938b1604d4f893417ec339b9e0fa9196fb1 by Eric Snow in branch 
'main':
bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. 
(gh-26396)
https://github.com/python/cpython/commit/631f9938b1604d4f893417ec339b9e0fa9196fb1


--

___
Python tracker 

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



[issue44341] Conflict between re.match and match keyword

2021-06-07 Thread Finn Mason


New submission from Finn Mason :

>>> import re
>>> re.match('str', 'str').group()
'str'
>>> match 'str':
... case 'str':
... print('match!')
...
match!
>>> from re import match
>>> match


As the above example demonstrates, while re.match doesn't raise an error 
despite having a keyword name, importing re.match directly into __main__ 
replaces the keyword with the function. The obvious solution is to rename 
re.match, but this would break many, many pieces of code.

--
components: Library (Lib), Regular Expressions
messages: 395295
nosy: ezio.melotti, finnjavier08, mrabarnett
priority: normal
severity: normal
status: open
title: Conflict between re.match and match keyword
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue44341] Conflict between re.match and match keyword

2021-06-07 Thread Finn Mason


Change by Finn Mason :


--
nosy:  -finnjavier08

___
Python tracker 

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



[issue44342] enum with inherited type won't pickle

2021-06-07 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman
nosy: +ethan.furman

___
Python tracker 

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



[issue41299] Python3 threading.Event().wait time is twice as large as Python27

2021-06-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset 449e6f0ef395231e3abe467f910b02d7f075c27f by Ryan Hileman in 
branch 'main':
bpo-41299: Reduce lag in Windows threading timeouts by using a higher precision 
time source (GH-26568)
https://github.com/python/cpython/commit/449e6f0ef395231e3abe467f910b02d7f075c27f


--

___
Python tracker 

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



[issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache

2021-06-07 Thread STINNER Victor


STINNER Victor  added the comment:

I like the new code, thanks for these enhancements Erlend ;-)

--

___
Python tracker 

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



[issue44242] enum.IntFlag regression: missing values cause TypeError

2021-06-07 Thread Ethan Furman


Change by Ethan Furman :


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

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-07 Thread Eric Snow


Eric Snow  added the comment:


New changeset 165c884154901deae46b5e328a6414d130e6bfff by Eric Snow in branch 
'main':
bpo-43693: Silence some compiler warnings. (gh-26588)
https://github.com/python/cpython/commit/165c884154901deae46b5e328a6414d130e6bfff


--

___
Python tracker 

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



[issue44335] "Wrong" invalid character identified

2021-06-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue44342] enum with inherited type won't pickle

2021-06-07 Thread Tom Brown


New submission from Tom Brown :

The following script runs without error in 3.8.5 and raises an error in 3.8.6, 
3.9.5 and 3.10.0b1. 

Source:
```
import enum, pickle

class MyInt(int):
pass
# work-around: __reduce_ex__ = int.__reduce_ex__

class MyEnum(MyInt, enum.Enum):
A = 1

pickle.dumps(MyEnum.A)
```

Error (same in 3.8.6, 3.9.5 and 3.10.0b1):
```
Traceback (most recent call last):
  File "/home/thecap/projects/covid-data-model/./enum-pickle.py", line 12, in 

pickle.dumps(MyEnum.A)
  File "/home/thecap/.pyenv/versions/3.10.0b1/lib/python3.10/enum.py", line 83, 
in _break_on_call_reduce
raise TypeError('%r cannot be pickled' % self)
TypeError: MyEnum.A cannot be pickled
```

Like https://bugs.python.org/issue41889 this seems to be related to the fix for 
https://bugs.python.org/issue39587 which changes member_type from int to MyInt. 
A work-around is in the comment above.

--
components: Library (Lib)
messages: 395300
nosy: Tom.Brown
priority: normal
severity: normal
status: open
title: enum with inherited type won't pickle
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



[issue41299] Python3 threading.Event().wait time is twice as large as Python27

2021-06-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25168
pull_request: https://github.com/python/cpython/pull/26580

___
Python tracker 

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



[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-06-07 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-44297.

--
nosy: +vstinner

___
Python tracker 

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



[issue31472] "Emulating callable objects" documentation misleading

2021-06-07 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I don't think the docs in current form imply keyword args are disallowed: 
"arguments" covers both positional and keyword args, and the call as given in 
example would work for both positional and keyword args (though not overriding 
the default value of an arg). It seems to me this can be closed.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44340] Add support for building cpython with clang thin lto

2021-06-07 Thread Brett Holman


Change by Brett Holman :


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

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-07 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +25172
pull_request: https://github.com/python/cpython/pull/26587

___
Python tracker 

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



[issue40120] Undefined C behavior going beyond end of struct via a [1] arrays.

2021-06-07 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
versions: +Python 3.11 -Python 3.9

___
Python tracker 

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



[issue41299] Python3 threading.Event().wait time is twice as large as Python27

2021-06-07 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 10.0 -> 11.0
pull_requests: +25167
pull_request: https://github.com/python/cpython/pull/26579

___
Python tracker 

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



[issue44330] IDLE: Colorizer and output tests hang on macOS

2021-06-07 Thread Ned Deily


Ned Deily  added the comment:

I can reproduce test_idle hanging on all of the current python.org macOS 
universal2 variants (3.8.10, 3.9.5, 3.10.0b2) which use Tk 8.6.11 but not with 
the legacy 10.9 variants for 3.8.10 and 3.9.5 which use Tk 8.6.8.  I've tried 
it on a few older systems, as far back as 10.9, and they all seem to hang the 
same way.  For 3.9.5 (and 3.8.10 now in security-fix mode), the first hang 
seems to be in test_removecolors which I need to Ctrl-C out of:

/usr/local/bin/python3.9 -m test -v -uall test_idle
[...]
test_insert (idlelib.idle_test.test_colorizer.ColorDelegatorTest) ... ok
test_notify_range (idlelib.idle_test.test_colorizer.ColorDelegatorTest) ... ok
test_recolorize (idlelib.idle_test.test_colorizer.ColorDelegatorTest) ... ok
test_recolorize_main (idlelib.idle_test.test_colorizer.ColorDelegatorTest) ... 
ok
test_removecolors (idlelib.idle_test.test_colorizer.ColorDelegatorTest) ...

I also see the hangs with current MacPorts Pythons linked with their build of 
Tk 8.6.11.

--
priority: normal -> critical
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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2021-06-07 Thread STINNER Victor


STINNER Victor  added the comment:

Ken Jin: Please open a separated issue for 
test_exceptions.test_recursion_in_except_handler(). It's not directly related 
to marking PyObject opaque, as William Pickard explained.

See my notes on the stack size and stack overflow on a recursion error on 
Windows:
https://pythondev.readthedocs.io/unstable_tests.html#unlimited-recursion

--

___
Python tracker 

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



[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-06-07 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Thanks Steve for the feedback.

> If it's a warning, it could also be that the warning is being triggered 
> somewhere else first. Since tests run in a random order, you'll want to look 
> for how reliable the failure is.

It is a warning, but it seems unlikely that any other code is calling it, given 
that the supporting codepath was not present until the same PR.

> The appx layout is also the only one in CI that actually uses an installed 
> layout - all the rest run tests from the source tree. So it could be related 
> to that.

If someone could help by producing a docker image that can build the appx 
layout and run the tests, that would help me as I don't have a lot of 
proficiency with installing build tools on Windows through the CLI... and the 
experience I do have has been fraught with challenges.

--

___
Python tracker 

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



[issue44332] For Loop temporary variable scope should be local to For loop

2021-06-07 Thread Mark Dickinson


Change by Mark Dickinson :


--
status: open -> closed

___
Python tracker 

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



[issue44258] Support PEP 515 for Fraction's initialization from string

2021-06-07 Thread Mark Dickinson


Change by Mark Dickinson :


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

___
Python tracker 

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



[issue44317] Suggestion for better syntax errors in tokenizer errors

2021-06-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See also issue43833.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44323] install module fail on windows 10

2021-06-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
title: insttall module faid on wondows 10 -> install module fail on windows 10

___
Python tracker 

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



[issue44258] Support PEP 515 for Fraction's initialization from string

2021-06-07 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 89e50ab36fac6a0e7f1998501f36fcd2872a6604 by Sergey B Kirpichev in 
branch 'main':
bpo-44258: support PEP 515 for Fraction's initialization from string (GH-26422)
https://github.com/python/cpython/commit/89e50ab36fac6a0e7f1998501f36fcd2872a6604


--

___
Python tracker 

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-07 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
pull_requests: +25162
pull_request: https://github.com/python/cpython/pull/26574

___
Python tracker 

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



[issue44331] Generate static PyCodeObjects for faster startup

2021-06-07 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue44333] Segmentation fault

2021-06-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

Python 3.6 is no longer supported. Please try to reproduce this with python 3.8 
or 3.9.

Without seeing the code that causes the failure, it's not possible for us to 
provide any help. Please try to reproduce the code with the smallest possible 
example and include the code here.

Please do not post images, as they make it impossible for us to copy and paste 
from the file you upload. They also make it difficult for visually impaired 
people to read them.

--
nosy: +eric.smith
status: open -> pending

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2021-06-07 Thread Julien Palard


Change by Julien Palard :


--
pull_requests: +25163
pull_request: https://github.com/python/cpython/pull/26575

___
Python tracker 

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



[issue44333] Segmentation fault

2021-06-07 Thread Kuldeep Daksh


Kuldeep Daksh  added the comment:

I am not getting this error when I run same code in other window. I am not
able to get why this is happening.

On Mon, Jun 7, 2021, 14:20 Eric V. Smith  wrote:

>
> Eric V. Smith  added the comment:
>
> Python 3.6 is no longer supported. Please try to reproduce this with
> python 3.8 or 3.9.
>
> Without seeing the code that causes the failure, it's not possible for us
> to provide any help. Please try to reproduce the code with the smallest
> possible example and include the code here.
>
> Please do not post images, as they make it impossible for us to copy and
> paste from the file you upload. They also make it difficult for visually
> impaired people to read them.
>
> --
> nosy: +eric.smith
> status: open -> pending
>
> ___
> Python tracker 
> 
> ___
>

--
status: pending -> open

___
Python tracker 

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



[issue44333] Segmentation fault

2021-06-07 Thread Kuldeep Daksh

Kuldeep Daksh  added the comment:

I run same code on different window with python3.6. at other place smtp
working in a right way but as I run it in my project its still giving the
error. please find the attachment of my code.

On Mon, 7 Jun 2021 at 14:44, Kuldeep Daksh  wrote:

>
> Kuldeep Daksh  added the comment:
>
> I am having lunch right now.after lunch I will give you the information.
>
> On Mon, Jun 7, 2021, 14:42 Eric V. Smith  wrote:
>
> >
> > Eric V. Smith  added the comment:
> >
> > If you can't provide any more information, we can't help you and I'll
> have
> > to close this issue.
> >
> > --
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: https://bugs.python.org/file50095/alert_emailer.py

___
Python tracker 

___import os
import inspect
import logging
import smtplib,ssl
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from jinja2 import FileSystemLoader, Environment

from alerts.models.alert_rule import AlertRule
from alerts.models.user import User
from alerts.models.asset import Asset
from alerts.repositories.user_alert_email_count_repo import 
UserAlertEmailCountRepository


class AlertEmailer:
__instance = None
__config = None
__from = None
__pwd = None
__server = None
__image_url = 
'https://s3-us-west-2.amazonaws.com/s3-us-west-2.amazonaws.com.public-images/alert.png'
__user_email_count_repo = None

@staticmethod
def getInstance(config):
if AlertEmailer.__instance == None:
AlertEmailer(config)
return AlertEmailer.__instance

def __init__(self, config):
self.logger = logging.getLogger(__name__)
if self.__config is None:
self.__config = config
self.context = ssl.create_default_context()
with smtplib.SMTP_SSL("smtp.gmail.com", 465, context=self.context) 
as server:

self.__from = config.email_from
self.__pwd = config.email_from_pwd
server.login(self.__from, self.__pwd)
if self.__user_email_count_repo is None:
self.__user_email_count_repo = 
UserAlertEmailCountRepository(self.__config)
if AlertEmailer.__instance is not None:
raise Exception("This class is a singleton class!")
else:
AlertEmailer.__instance = self

def send_email(self, title: str, al_msg: str, alert_rule: AlertRule):
users = alert_rule.get_users()
if len(users) > 0:
recipients = []
for user in users:
if user.is_email_alerts_enabled():
self.logger.info(user.get_email())
if alert_rule.is_critical():
recipients.append(user.get_email())
elif self.__should_send_alert_email(user, alert_rule):
recipients.append(user.get_email())
if len(recipients) > 0:
self.__send_default(title, al_msg, recipients)
else:
self.logger.info("No recipient for sending email.")

def send_fault_alert_email(self, title: str, al_msg: str, asset: Asset):
users = ["ksi...@sensegrow.com"]
if (len(users) > 0):
recipients = ["ksi...@sensegrow.com"]
# for user in users:
# self.logger.info(user.get_email())
# recipients.append(user.get_email())

self.__send_default(title, al_msg, recipients)
else:
self.logger.info("No recipient for sending email.")

def __should_send_alert_email(self, user: User, alert_rule: AlertRule):
try:
alert_count = 
self.__user_email_count_repo.get_alert_rule_count(user, alert_rule)
alert_group_count = 
self.__user_email_count_repo.get_alert_rule_group_count(user, alert_rule)
if user.get_alert_msg_rate_limit_throttle() > alert_count:
if alert_group_count < 1:
self.__user_email_count_repo.update_count(user, alert_rule);
return True
return False
except Exception as ex:
self.logger.error(ex)
return False

def __send_default(self, title: str, al_msg: str, recipients):
current_dir = 
os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe(
file_name = 'alert_email_template.html'

template_loader = FileSystemLoader(searchpath=current_dir)
template_env = Environment(loader=template_loader)
template = template_env.get_template(file_name)
message = 

[issue44333] Segmentation fault

2021-06-07 Thread Kuldeep Daksh

Kuldeep Daksh  added the comment:

Please ignore previous attachment and find new one.

On Mon, 7 Jun 2021 at 15:20, Kuldeep Daksh 
wrote:

> I run same code on different window with python3.6. at other place smtp
> working in a right way but as I run it in my project its still giving the
> error. please find the attachment of my code.
>
> On Mon, 7 Jun 2021 at 14:44, Kuldeep Daksh  wrote:
>
>>
>> Kuldeep Daksh  added the comment:
>>
>> I am having lunch right now.after lunch I will give you the information.
>>
>> On Mon, Jun 7, 2021, 14:42 Eric V. Smith  wrote:
>>
>> >
>> > Eric V. Smith  added the comment:
>> >
>> > If you can't provide any more information, we can't help you and I'll
>> have
>> > to close this issue.
>> >
>> > --
>> >
>> > ___
>> > Python tracker 
>> > 
>> > ___
>> >
>>
>> --
>>
>> ___
>> Python tracker 
>> 
>> ___
>>
>

--
Added file: https://bugs.python.org/file50096/alert_emailer.py

___
Python tracker 

___import os
import inspect
import logging
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from jinja2 import FileSystemLoader, Environment

from alerts.models.alert_rule import AlertRule
from alerts.models.user import User
from alerts.models.asset import Asset
from alerts.repositories.user_alert_email_count_repo import 
UserAlertEmailCountRepository

class AlertEmailer:
__instance = None
__config = None
__from = None
__pwd = None
__server = None
__image_url = 
'https://s3-us-west-2.amazonaws.com/s3-us-west-2.amazonaws.com.public-images/alert.png'
__user_email_count_repo = None


@staticmethod
def getInstance(config):
if AlertEmailer.__instance == None:
AlertEmailer(config)
return AlertEmailer.__instance

def __init__(self, config):
self.logger = logging.getLogger(__name__)
if self.__config is None:
self.__config = config
if self.__server is None:
self.__server = smtplib.SMTP('smtp.gmail.com', 587)
self.__server.starttls()
self.__from = config.email_from
self.__pwd = config.email_from_pwd
self.__server.login(self.__from, self.__pwd)
if self.__user_email_count_repo is None:
self.__user_email_count_repo = 
UserAlertEmailCountRepository(self.__config)
if AlertEmailer.__instance is not None:
raise Exception("This class is a singleton class!")
else:
AlertEmailer.__instance = self

def send_email(self, title: str, al_msg: str, alert_rule: AlertRule):
users = alert_rule.get_users()
if len(users) > 0:
recipients = []
for user in users:
if user.is_email_alerts_enabled():
self.logger.info(user.get_email())
if alert_rule.is_critical():
recipients.append(user.get_email())
elif self.__should_send_alert_email(user, alert_rule):
recipients.append(user.get_email())
if len(recipients) > 0:
self.__send_default(title, al_msg, recipients)
else:
self.logger.info("No recipient for sending email.")

def send_fault_alert_email(self, title: str, al_msg: str, asset: Asset):
users = ["ksi...@sensegrow.com"]
if (len(users) > 0):
recipients = ["ksi...@sensegrow.com"]
# for user in users:
# self.logger.info(user.get_email())
# recipients.append(user.get_email())

self.__send_default(title, al_msg, recipients)
else:
self.logger.info("No recipient for sending email.")

def __should_send_alert_email(self, user: User, alert_rule: AlertRule):
try:
alert_count = 
self.__user_email_count_repo.get_alert_rule_count(user, alert_rule)
alert_group_count = 
self.__user_email_count_repo.get_alert_rule_group_count(user, alert_rule)
if user.get_alert_msg_rate_limit_throttle() > alert_count:
if alert_group_count < 1:
self.__user_email_count_repo.update_count(user, alert_rule);
return True
return False
except Exception as ex:
self.logger.error(ex)
return False

def __send_default(self, title: str, al_msg: str, recipients):
current_dir = 
os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe(
file_name = 'alert_email_template.html'

template_loader = FileSystemLoader(searchpath=current_dir)

[issue44333] Segmentation fault

2021-06-07 Thread Kuldeep Daksh


New submission from Kuldeep Daksh :

I am getting Segmentation fault when i run server.starttls() method.

--
components: Library (Lib)
files: segment_fault.png
messages: 395251
nosy: mechatronickuldeep
priority: normal
severity: normal
status: open
title: Segmentation fault
versions: Python 3.6
Added file: https://bugs.python.org/file50094/segment_fault.png

___
Python tracker 

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



[issue44333] Segmentation fault

2021-06-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

If you can't provide any more information, we can't help you and I'll have to 
close this issue.

--

___
Python tracker 

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



[issue44333] Segmentation fault

2021-06-07 Thread Kuldeep Daksh


Kuldeep Daksh  added the comment:

I am having lunch right now.after lunch I will give you the information.

On Mon, Jun 7, 2021, 14:42 Eric V. Smith  wrote:

>
> Eric V. Smith  added the comment:
>
> If you can't provide any more information, we can't help you and I'll have
> to close this issue.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue44325] IDLE: Fix shell comment anomalies

2021-06-07 Thread Tal Einat


Tal Einat  added the comment:

> 1) trailing whitespace (' ' and '\t' at least) is removed before this 
> function is called.  I presume in IDLE rather than code.II, but cannot find 
> where.  It is not with .rstrip.

You're probably looking for this code in 
EditorWindow.newline_and_indent_event():

# Strip whitespace after insert point.
while text.get("insert") in " \t":
text.delete("insert")

See: 
https://github.com/python/cpython/blob/89e50ab36fac6a0e7f1998501f36fcd2872a6604/Lib/idlelib/editor.py#L1390

--

___
Python tracker 

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



[issue44325] IDLE: Fix shell comment anomalies

2021-06-07 Thread Tal Einat


Tal Einat  added the comment:

> However, I sometimes saw ... appear very briefly, only to be overwritten with 
> >>>.

This is a known limitation of the current sidebar implementation, which was 
very difficult to avoid and was considered minor enough to let be for now.

--

___
Python tracker 

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



[issue44325] IDLE: Fix shell comment anomalies

2021-06-07 Thread Tal Einat


Tal Einat  added the comment:

The sidebar doesn't seem to be causing this issue, it's just making it a bit 
more visible, since what was previously a blank line now also has a more 
visible "..." continuation prompt.

--

___
Python tracker 

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



[issue42349] Compiler front-end produces a broken CFG

2021-06-07 Thread Mark Shannon


Mark Shannon  added the comment:

Basic blocks have only a single exit, at the end.
https://en.wikipedia.org/wiki/Basic_block

If the devguide says otherwise it is wrong.

--

___
Python tracker 

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