[issue44371] asyncio.wait_for does not cancel running tasks in the correct fashion

2021-06-09 Thread Ofek Kirzner


New submission from Ofek Kirzner :

Following https://bugs.python.org/issue32751 I think wait_for should also wait 
for running coroutine in case it has been cancelled.

Example code:

import asyncio


async def inner():
try:
print(1)
await asyncio.sleep(3600)
print(2)
except asyncio.CancelledError:
print('inner - canc')
raise


async def outer(f):
try:
print('a')
# Version 1 - This creates the expected behaviour
# await f
# Version 2 - This creates the reversed behaviour
await asyncio.wait_for(f, timeout=500)
print('b')
except asyncio.CancelledError:
print('outer - canc')


@pytest.mark.asyncio
async def test_t1():
t = asyncio.create_task(outer(inner()))
done, pending = await asyncio.wait([t], timeout=1)
t.cancel()

await t

--
I expect inner to be cancelled and awaited before outer is finished.
i.e., exepcted output:
1
inner - canc
outer - canc


While I get:
1
outer - canc
inner - canc

--
components: asyncio
messages: 395505
nosy: asvetlov, ofekkir, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.wait_for does not cancel running tasks in the correct fashion
type: behavior
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



[issue40468] IDLE: configdialog tab rearrange

2021-06-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Along with the spinbox PR for #33962, I believe everything discussed here is 
done.  There are still issues to improve specific pages.

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



[issue14322] More test coverage for hmac

2021-06-09 Thread Arjun


Change by Arjun :


--
pull_requests: +25222
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/26636

___
Python tracker 

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



[issue33051] IDLE: Create new tab for editor options in configdialog

2021-06-09 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> IDLE: configdialog tab rearrange

___
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-09 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +25221
pull_request: https://github.com/python/cpython/pull/26635

___
Python tracker 

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



[issue44352] Native Windows Python builds running on Europe/Moscow TZ report wrong time from datetime.datetime.now when there is TZ environment variable also set to Europe/Moscow

2021-06-09 Thread Eryk Sun


Eryk Sun  added the comment:

> 2. Execute 'set TZ=Europe/Moscow'

The Windows C runtime supports a simple format for the TZ environment variable, 
which is detailed in the documentation of _tzset() [1]. For example, it's 
"MSK-3" for Moscow Standard Time. It's -3 because the offset is from local time 
to UTC. 

The CRT does not verify that the TZ value is valid. "Europe/Moscow" is invalid, 
but it's blindly parsed anyway. There's no UTC offset, so it defaults to UTC (0 
offset). It's parsed as supporting daylight saving time, according to U.S. 
rules. Currently this corresponds to UTC + 1. That's why there's a -2 hour 
delta from Moscow Standard Time, which does not observe daylight saving time.

I recommend that you unset the TZ environment variable before running Windows 
Python. Use the system timezone.

---
[1] 
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset?view=msvc-160

--
nosy: +eryksun

___
Python tracker 

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



[issue42088] types.SimpleNamespace.__repr__ documentation inconsistency

2021-06-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Given how long this object has been its current state, the OP's request seems 
reasonable to me and it is an easy change to make.  I don't think there is any 
downside.  Also, if this ever becomes a builtin, I think we would leave the 
current implementation in place and deprecate it over the course of a couple of 
releases.  So making any improvements now probably wouldn't get in the way of a 
proposal to have a builtin namespace object.

--
nosy: +rhettinger

___
Python tracker 

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



[issue44370] Inconsistent results for min() and max() with math.nan as argument

2021-06-09 Thread Joël Larose

Joël Larose  added the comment:

The same problem occurs if the argument is a `list`.  The same inconsistency 
happens depending on the position in the list that `nan` happens to be.

>>> max([5, nan, 3, 0, 8, -10])
8

>>> min([5, nan, 3, 0, 8, -10])
-10

>>> min([nan, 5, 3, 0, 8, -10])
nan

>>> max([nan, 5, 3, 0, 8, -10])
nan

Passing a `tuple` with the same values produces the same inconsistency.

For the examples above, replacing the lists with sets with the same values 
(i.e. replace [] with {}) always results in `nan`.  This may have to do with 
the hash value of `nan` always making the first value in iteration be `nan` 
given the sample space.

--

___
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-09 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I managed to put together a Dockerfile that seemingly has the build tools 
installed 
(https://github.com/jaraco/jaraco.windows/blob/d2edad2e2af9d469189d7ac6a14a4ba6f6270348/Dockerfile).

When I attempt to build CPython, however, it fails with this error:

```
PS C:\code\public\cpython> PCBuild\build.bat
Using py -3.9 (found 3.9 with py.exe)
Fetching external libraries...
bzip2-1.0.6 already exists, skipping.
sqlite-3.35.5.0 already exists, skipping.
xz-5.2.2 already exists, skipping.
zlib-1.2.11 already exists, skipping.
Fetching external binaries...
libffi already exists, skipping.
openssl-bin-1.1.1k-1 already exists, skipping.
tcltk-8.6.11.0 already exists, skipping.
Finished.
Using "C:\Program Files (x86)\Microsoft Visual 
Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe"  (found in the PATH)
Using py -3.9 (found 3.9 with py.exe)

C:\code\public\cpython>"C:\Program Files (x86)\Microsoft Visual 
Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe"  
"C:\code\public\cpython\PCbuild\pcbuild.proj" /t:Build /m /nologo /v:m 
/clp:summary /p:Configuration=Release /p:Platform=x64 /p:IncludeExternals=true 
/p:IncludeCTypes=true /p:IncludeSSL=true /p:IncludeTkinter=true 
/p:UseTestMarker= /p:GIT="C:\Program Files\Git\cmd\git.exe"
C:\code\public\cpython\PCbuild\python.props(111,31): error MSB4184: The 
expression "[System.Version]::Parse('')" cannot be evaluated. Version string 
portion was too short or too long. 
[C:\code\public\cpython\PCbuild\pythoncore.vcxproj]

Build FAILED.

C:\code\public\cpython\PCbuild\python.props(111,31): error MSB4184: The 
expression "[System.Version]::Parse('')" cannot be evaluated. Version string 
portion was too short or too long. 
[C:\code\public\cpython\PCbuild\pythoncore.vcxproj]
0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.15
```

--

___
Python tracker 

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



[issue44352] Native Windows Python builds running on Europe/Moscow TZ report wrong time from datetime.datetime.now when there is TZ environment variable also set to Europe/Moscow

2021-06-09 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +belopolsky, p-ganssle

___
Python tracker 

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



[issue44362] improve documentation of SSL deprecations

2021-06-09 Thread Jack DeVries


Jack DeVries  added the comment:

These changes are part of PEP 644; support for OpenSSL v1.1.1. The benefits are 
detailed in `the PEP `_.

Later, the deprecation process began in `bpo-43880 
`_. It seems like `PROTOCOL_TLS` is the 
only thing with a deprecation warning that does not have a suggested 
alternative.

I'm confused as to how this can be deprecated; what will be the new mechanism 
for selecting a protocol? If someone can provide some brief clarification, I'd 
be more than happy to update the docs!

--
nosy: +jack__d

___
Python tracker 

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



[issue44370] Inconsistent results for min() and max() with math.nan as argument

2021-06-09 Thread Joël Larose

Joël Larose  added the comment:

Forgot to mention the environment:
Python version: 3.9.0
OS: Windows 10

I have not tested this on any other version of python.

--

___
Python tracker 

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



[issue44370] Inconsistent results for min() and max() with math.nan as argument

2021-06-09 Thread Joël Larose

New submission from Joël Larose :

If `math.nan` is the first argument for either max() or min(), the result is 
always `nan`, regardless of the other values in the results.  However, if `nan` 
is in any other position in the arguments list, the result is always what you 
would expect if `nan` was not in the arguments list.

E.g.
from math import nan, inf

>>> max(nan, 5, 3, 0)
nan

>>> min(nan, 5, 3, 0)
nan

>>> min(nan, 5, 3, 0, inf, -inf)
nan

>>> max(nan, 5, 3, 0, inf, -inf)
nan

>>> max(inf, 5, 3, 0, nan, -inf)
inf

>>> max(8, inf, 5, 3, 0, nan, -inf)
inf

>>> min(8, inf, 5, 3, 0, nan, -inf)
-inf

>>> min(8, nan, inf, 5, 3, 0, nan, -inf)
-inf

>>> max(8, nan, inf, 5, 3, 0, nan, -inf)
inf

>>> max(8, 5, 3, 0, nan)
8

As you can see, the results for min() and max() are inconsistent for `nan` 
depending on whether it's the first argument or not.

I would prefer for min() and max() to ignore `nan` unless all arguments are 
`nan`.  However, the other path for consistent behaviour is to return `nan` if 
any of the arguments are `nan`.

--
components: Interpreter Core
messages: 395497
nosy: joel.larose
priority: normal
severity: normal
status: open
title: Inconsistent results for min() and max() with math.nan as argument
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue44336] Windows buildbots hang after fatal exit

2021-06-09 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

While now not as immediately beneficial, I believe that the linked PR would be 
good for the long run.  The ramifications of bpo-11105 meant that the Windows 
buildbots were basically unusable for 5 days.

Realistically, any commit that triggers aborts in the Windows test runs will 
exhibit this problematic behavior.  I'm confident that the PR is in ready-to-go 
form.

--

___
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-09 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

In [this 
Dockerfile](https://github.com/jaraco/jaraco.windows/blob/feature/vs-2/Dockerfile),
 I've attempted to install Visual Studio, but without success. Docker fails to 
build on [line 
6](https://github.com/jaraco/jaraco.windows/blob/4de80c897cb92362bd1084a9851f3f08b6ed697e/Dockerfile#L6).
 The install fails with this error: 

```
ERROR: Running 
["C:\Users\ContainerAdministrator\AppData\Local\Temp\chocolatey\visualstudio2019buildtools\16.10.0.0\vs_BuildTools.exe"
 --quiet --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add 
Microsoft.VisualStudio.Workload.NetCoreBuildTools --norestart --wait] was not 
successful. Exit code was '-2147024770'. See log for possible error messages.
```

Any tips on creating a Windows environment with build support would be 
appreciated.

--

___
Python tracker 

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



[issue35800] remove smtpd.MailmanProxy

2021-06-09 Thread Dong-hee Na


Change by Dong-hee Na :


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



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

2021-06-09 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



[issue44347] Unclear documentation for shutil.copytree()

2021-06-09 Thread Jack DeVries


Jack DeVries  added the comment:

I've created a PR: https://github.com/python/cpython/pull/26634

I forgot to put a news entry, but hopefully that's ok since this is a very 
small change.

--

___
Python tracker 

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



[issue42801] Exception catching function crashes on recursive list

2021-06-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.8 -Python 3.7

___
Python tracker 

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



[issue44347] Unclear documentation for shutil.copytree()

2021-06-09 Thread Jack DeVries


Change by Jack DeVries :


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

___
Python tracker 

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



[issue44328] time.monotonic() should use a different clock source on Windows

2021-06-09 Thread Ryan Hileman


Ryan Hileman  added the comment:

Great information, thanks!

> Windows 10 also provides QueryInterruptTimePrecise(), which is a hybrid 
> solution. It uses the performance counter to interpolate a timestamp between 
> interrupts. I'd prefer to use this for time.monotonic() instead of QPC, if 
> it's available via GetProcAddress()

My personal vote is to use the currently most common clock source (QPC) for now 
for monotonic(), because it's the same across Windows versions and the most 
likely to produce portable monotonic timestamps between apps/languages on the 
same system. It's also the easiest patch, as there's already a code path for 
QPC.

(As someone building multi-app experiences around Python, I don't want to check 
the Windows version to see which time base Python is using. I'd feel better 
about switching to QITP() if/when Python drops Windows 8 support.)

A later extension of this idea (maybe behind a PEP) could be to survey the 
existing timers available on each platform and consider whether it's worth 
extending `time` to expose them all, and unify cross-platform the ones that are 
exposed (e.g. better formalize/document which clocks will advance while the 
machine is asleep on each platform).

--

___
Python tracker 

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



[issue35800] remove smtpd.MailmanProxy

2021-06-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
resolution:  -> fixed

___
Python tracker 

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



[issue35800] remove smtpd.MailmanProxy

2021-06-09 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 309ab616020f8504ced8ca64f7d7abc2df25a37f by Dong-hee Na in branch 
'main':
bpo-35800: Remove smtpd.MailmanProxy since 3.11 (GH-26617)
https://github.com/python/cpython/commit/309ab616020f8504ced8ca64f7d7abc2df25a37f


--

___
Python tracker 

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



[issue44369] Improve syntax error for wrongly closed strings

2021-06-09 Thread Andre Roberge


Andre Roberge  added the comment:

I like this. While it would be a bit longer, I'm wondering if the message 
should not read instead as follows:

... Did you use the same quotes here as those enclosing the string?

===

I suspect that errors coming from the use of a single quote, as in:

'Don't do this'

might be just as prevalent if not more so; however, they might be more 
difficult to properly diagnose.

--
nosy: +aroberge

___
Python tracker 

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



[issue44328] time.monotonic() should use a different clock source on Windows

2021-06-09 Thread Eryk Sun


Eryk Sun  added the comment:

You resolved bpo-41299 using QueryPerformanceCounter(), so we're already a step 
toward making it the default monotonic clock. Personally, I've only relied on 
QPC for short intervals, but, as you've highlighted above, other language 
runtimes use it for their monotonic clock. Since Vista, it's apparently more 
reliable in terms of calibration and ensuring that a processor TSC is only used 
if it's known to be invariant and constant.

That said, Windows 10 also provides QueryInterruptTimePrecise(), which is a 
hybrid solution. It uses the performance counter to interpolate a timestamp 
between interrupts. I'd prefer to use this for time.monotonic() instead of QPC, 
if it's available via GetProcAddress().

QueryInterruptTimePrecise() is about 1.38 times the cost of QPC (on average 
across 100 million calls). Both functions are significantly more expensive than 
QueryInterruptTime() and GetTickCount64(), which simply return a value that's 
read from shared memory (i.e. the KUSER_SHARED_DATA structure).

> QueryUnbiasedInterruptTime() is available on Windows 8 while 
> QueryInterruptTime() is new as of Windows 10. The "Unbiased" 
> just refers to whether it advances during sleep.

QueryInterruptTime() and QueryUnbiasedInterruptTime() don't provide 
high-resolution timestamps. They're updated by the system timer interrupt 
service routine, which defaults to 64 interrupts/second. The time increment 
depends on when the counter is read by the ISR, but it averages out to 
approximately the interrupt period (e.g. 15.625 ms).

> I'm not actually sure whether time.monotonic() in Python counts 
> time spent asleep, or whether that's desirable. 

POSIX doesn't specify whether CLOCK_MONOTONIC [1] should include the time that 
elapses while the system is in standby mode. In Linux, CLOCK_BOOTTIME includes 
this time, and CLOCK_MONOTONIC excludes it. Windows 
QueryUnbiasedInterruptTime[Precise]() excludes it.

> Perhaps the long term answer would be to introduce separate 
> "asleep" and "awake" monotonic clocks in Python

Both may not be supportable on all platforms, but they're supported in Linux, 
Windows 10, and macOS. The latter has mach_continuous_time(), which includes 
the time in standby mode, and mach_absolute_time(), which excludes it.

--- 
[1] 
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_gettime.html

--
nosy: +eryksun

___
Python tracker 

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



[issue44347] Unclear documentation for shutil.copytree()

2021-06-09 Thread Jack DeVries


Jack DeVries  added the comment:

I would like to submit a patch for this. This would be my first contribution :)

I am starting on a patch now.

--
nosy: +jack__d

___
Python tracker 

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



[issue44360] test_compile killed by SIGKILL on AMD64 Ubuntu 3.x (Linux OOM Killer)

2021-06-09 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

>  Maybe you should give more memory to your worker, or you should spawn less 
> jobs in parallel

It was related to high number of jobs in that particular agent and result in 
OOM Kill from the Linux kernel - https://pastebin.com/559H4ksa

The machine has 1GB Ram, but I realize that it has only one 1 CPU (This seems 
not optimal, minimal of 2 CPU seems to be recommendation - 
https://devguide.python.org/buildworker/) 

I will change it to run few jobs in parallel, and disable some services which 
are not used) and we could see again.

For this, I would rather side with an agent resource issue than a compiler 
issue. Sorry for that.


--- 

I also notice number unsuccessful SSH attempts on the server (today) - 
https://pastebin.com/ab0EKDuF


The agent got unreachable probably due this, and I did reboot of the agent from 
the cloud console, so that I could login and see what might have happened.

--

___
Python tracker 

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



[issue44369] Improve syntax error for wrongly closed strings

2021-06-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Checkout PR 26632, and see if this works for you

--

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +25218
pull_request: https://github.com/python/cpython/pull/26632

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Could we just try parsing "as _" and raise if so? That wouldn't conflict with 
> any existing rules, and that way we could actually have a helpful error 
> message.

No, the same happens with other targets such as:

 File "/home/pablogsal/github/python/master/lel.py", line 2
case 42 as 1+1:
   ^
SyntaxError: expected ':'

--

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread miss-islington


miss-islington  added the comment:


New changeset f807a4fad4da8f629ea7fe1f00719e817c77b63c by Miss Islington (bot) 
in branch '3.10':
bpo-44368: Ensure we don't raise incorrect custom syntax errors with soft 
keywords (GH-26630)
https://github.com/python/cpython/commit/f807a4fad4da8f629ea7fe1f00719e817c77b63c


--
nosy: +miss-islington

___
Python tracker 

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



[issue14322] More test coverage for hmac

2021-06-09 Thread Arjun


Arjun  added the comment:

The only things I think we should add to the current hmac tests are 
test_update_error_handling and test_with_invalid_msg. 

For test_withnoncallable_digestmod(), hmac itself seems it can no longer be 
used:

>>> hmac.HMAC(b"", None, "hmac")

using new
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/arjun/Python/Sources/cpython/Lib/hmac.py", line 61, in __init__
self._init_hmac(key, msg, digestmod)
  File "/Users/arjun/Python/Sources/cpython/Lib/hmac.py", line 69, in _init_hmac
self._hmac = _hashopenssl.hmac_new(key, msg, digestmod=digestmod)
ValueError: unsupported hash type hmac

For tests test_small_block_size and test_no_block_size, a custom .blocksize 
cannot be set (changing .block_size has no difference on digest()):

>>> hmac.HMAC(b"", None, "md5").blocksize = 15

using new
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'HMAC' object attribute 'blocksize' is read-only

```
class myHMAC(hmac.HMAC):
blocksize = 1
def __init__(self, key, msg, digestmod_):
super().__init__(key, msg, digestmod=digestmod_)

h = myHMAC(b"key", b"", digestmod_="md5")
h.digest() # <- works perfectly fine.
```
Does this sound okay? I can go ahead an implement it if so.

--
nosy: +CCLDArjun -Vijay.Majagaonkar, christian.heimes, eric.araujo, 
gregory.p.smith, packetslave, pitrou

___
Python tracker 

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



[issue44360] test_compile killed by SIGKILL on AMD64 Ubuntu 3.x (Linux OOM Killer)

2021-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

> Yes, this was related to the Linux OOM Killer.

Oh ok. Maybe you should give more memory to your worker, or you should spawn 
less jobs in parallel (-j1 instead of -j2). Or you should disable other 
services which eat memory.

How much memory does it have?

--
title: test_compile killed by SIGKILL on AMD64 Ubuntu 3.x -> test_compile 
killed by SIGKILL on AMD64 Ubuntu 3.x (Linux OOM Killer)

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Brandt Bucher


Brandt Bucher  added the comment:

Like "SyntaxError: can't capture into a wildcard (consider removing)".

--

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Brandt Bucher


Brandt Bucher  added the comment:

Could we just try parsing "as _" and raise if so? That wouldn't conflict with 
any existing rules, and that way we could actually have a helpful error message.

--

___
Python tracker 

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



[issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots

2021-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

> https://github.com/python/buildmaster-config/commit/9e0c812694d6fa599b4c8890045ed006fe7c1f6b

aarch64 Fedora Rawhide Refleaks 3.8:
https://buildbot.python.org/all/#/builders/401/builds/47

This change worked as expected: buildbot now uses a timeout of 4 hours (14400 
seconds).

At the first run, test_asyncio was blocked in test_close_kill_running() of 
test_asyncio/test_subprocess.py. From the traceback, it's not possible to be 
sure that the test uses MultiLoopChildWatcher. But it smells a lot like 
bpo-38323.

bpo-38323 was recently fixed in 3.9, 3.10 and main branches (by skipping 
MultiLoopChildWatcher tets, since this class has a known race condition). 
Sadly, the 3.8 branch no longer accepts bugfixes.

Logs:

0:00:00 load avg: 2.85 Run tests in parallel using 10 child processes (timeout: 
3 hour 15 min, worker timeout: 3 hour 20 min)
(...)
3:21:15 load avg: 0.04 [423/423/1] test_asyncio crashed (Exit code 1)
beginning 6 repetitions
123456
.Timeout (3:15:00)!
Thread 0xaecbcd50 (most recent call first):
  File 
"/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-aarch64.refleak/build/Lib/selectors.py",
 line 468 in select
  File 
"/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-aarch64.refleak/build/Lib/asyncio/base_events.py",
 line 1823 in _run_once
  File 
"/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-aarch64.refleak/build/Lib/asyncio/base_events.py",
 line 570 in run_forever
  File 
"/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-aarch64.refleak/build/Lib/asyncio/base_events.py",
 line 603 in run_until_complete
  File 
"/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-aarch64.refleak/build/Lib/test/test_asyncio/test_subprocess.py",
 line 484 in test_close_kill_running
(...)
test_ensure_future_task (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... 
ok
test_error_in_call_soon (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... 
ok
test_exception_traceback (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) 
... ok
test_gather_shield (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... ok
test_get_coro (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... ok
test_get_stack (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... ok
test_iscoroutinefunction (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) 
... ok
command timed out: 14400 seconds elapsed running [b'make', b'buildbottest', 
b'TESTOPTS=-R 3:3 -u-cpu -j10 ${BUILDBOT_TESTOPTS}', b'TESTPYTHONOPTS=', 
b'TESTTIMEOUT=11700'], attempting to kill
.make: *** [Makefile:1173: buildbottest] Terminated
process killed by signal 15
program finished with exit code -1
elapsedTime=14400.032773
test_log_destroyed_pending_task 
(test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ...

--

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Oh, this one is actually correct:

match ...:
case 42 as _:
pass

  File "", line 2
case 42 as _:
   ^
SyntaxError: expected ':'

That is literally expecting a ":" and that's the error. It has identified "case 
42" correctly and it now expects a ":". Is just that the error marker is wrong 
because it has reached the "as and _" as part of the parsing so the error is 
there.

That is going to be a bit tricky to "fix"

--
nosy:  -miss-islington

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 457ce60fc70f1c9290023f46fb82b6a490dff32e by Pablo Galindo in 
branch 'main':
bpo-44368: Ensure we don't raise incorrect custom syntax errors with soft 
keywords (GH-26630)
https://github.com/python/cpython/commit/457ce60fc70f1c9290023f46fb82b6a490dff32e


--

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I will fix that one in another PR

--

___
Python tracker 

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



[issue44369] Improve syntax error for wrongly closed strings

2021-06-09 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Let's asume this string:
"
x = "Cannot recover from "MemoryErrors" while something happnes while "

The line is incorrect because the quotes arround MemoryErrors are the same as 
the string is used, resulting in STRING + expression + STRING.

Currenly we say:

>>> 'Cannot recover from 'MemoryErrors' while '
  File "", line 1
'Cannot recover from 'MemoryErrors' while '
  ^
SyntaxError: invalid syntax

but I think it will be a great improvement if we say:

>>> 'Cannot recover from 'MemoryErrors' while '
  File "", line 1
'Cannot recover from 'MemoryErrors' while '
  
SyntaxError: invalid syntax. Did you use the same quotes here as the string?

Probably the message should be better, but I think this is a good improvement.

--
components: Parser
messages: 395476
nosy: lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Improve syntax error for wrongly closed strings
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



[issue21760] inspect documentation describes module type inaccurately

2021-06-09 Thread Eric Snow


Eric Snow  added the comment:

I've merged the changes for __file__.  Thanks, furkanonder!

The fixes in the types module remain to be done, though now I see 4 of the 
relevant attributes instead of 2.  (missing: __path__, __file__, __cached__)

--

___
Python tracker 

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



[issue24234] Should we define complex.__complex__ and bytes.__bytes__?

2021-06-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah, the more I think about it, the more it looks like we should add the 
special methods -- even if they won't necessarily be called *if the type is 
exactly 'complex' or 'bytes'*.

Now, until we've written and released the code we won't know for sure whether 
this might break somebody's corner case, so we should play it safe and only do 
this for 3.11 and make sure it's mentioned in the What's New.

--
versions: +Python 3.11 -Python 3.5

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Is this covered by your fix?

No, that is not a backtracking error (is not going all the way to the "match" 
expression).

--

___
Python tracker 

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



[issue21760] inspect documentation describes module type inaccurately

2021-06-09 Thread miss-islington


miss-islington  added the comment:


New changeset 878d7e4ee464913438fd59582bbb795e7e0fa387 by Furkan Onder in 
branch 'main':
 bpo-21760: fix __file__ description (GH-19097)
https://github.com/python/cpython/commit/878d7e4ee464913438fd59582bbb795e7e0fa387


--
nosy: +miss-islington

___
Python tracker 

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



[issue24234] Should we define complex.__complex__ and bytes.__bytes__?

2021-06-09 Thread Ethan Smith


Ethan Smith  added the comment:

While I don't think it is nonsense, I do think it would be quite useful to add 
these. I just submitted PRs to typeshed and numpy adding complex to unions that 
already had SupportsComplex, because of the lack of __complex__. I'd be happy 
to work on a PR for this if it would be accepted.

--
nosy: +ethan smith

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Brandt Bucher


Brandt Bucher  added the comment:

I found a similar one, by the way (not related to mapping patterns):

match ...:
case 42 as _:
pass

  File "", line 2
case 42 as _:
   ^
SyntaxError: expected ':'

Is this covered by your fix?

--

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Brandt Bucher


Brandt Bucher  added the comment:

Wow, that was quite a roller-coaster ride. Thanks Pablo. :)

--

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue42088] types.SimpleNamespace.__repr__ documentation inconsistency

2021-06-09 Thread Eric Snow


Eric Snow  added the comment:

> According to the documentation for types.SimpleNamespace, 
> `repr(SimpleNamespace())`
> should return `"SimpleNamespace()"`, but in actuality returns `"namespace()"`.

Note that I purposefully wrote "roughly" in the docs ("The type is roughly 
equivalent to the following code:").  That code was meant to illustrate the 
functionality rather than be proscriptive of the implementation.  That said, it 
certainly would be good for the documentation to match. :)

> but also the (perhaps less interesting issue) of 
> `eval(repr(SimpleNamespace))` resulting in a NameError.

This is true of many of the types exposed by the types module (e.g. 
types.CodeType).

> I propose that `_PyNamespaceObject`'s __repr__ method be changed to return 
> `"SimpleNamespace()"`.

My preference would be as outlined in my previous comment: make it a builtin.  
However, I'm not in a position to make that happen at the moment.

--

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Oh, turns out I already added machinery to solved this but I was missing a 
piece!

--

___
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-09 Thread miss-islington


miss-islington  added the comment:


New changeset d9f38d77c870cdb04273914c92fa4fe92b830d88 by Miss Islington (bot) 
in branch '3.9':
bpo-40468: Split IDLE settings General tab (GH-26621)
https://github.com/python/cpython/commit/d9f38d77c870cdb04273914c92fa4fe92b830d88


--

___
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-09 Thread miss-islington


miss-islington  added the comment:


New changeset 664ae29e6f61988e74cb8753dd4ee71e9ea57227 by Miss Islington (bot) 
in branch '3.10':
bpo-40468: Split IDLE settings General tab (GH-26621)
https://github.com/python/cpython/commit/664ae29e6f61988e74cb8753dd4ee71e9ea57227


--

___
Python tracker 

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



[issue42088] types.SimpleNamespace.__repr__ documentation inconsistency

2021-06-09 Thread Eric Snow


Eric Snow  added the comment:

I'm not sure what to think about this.

The type is explicitly exposed to Python code "SimpleNamespace" via the types 
module.  However, that's the same as how other builtin types are exposed in 
that module.  For example, the builtin `PyCode_Type` (for `PyCodeObject`) is 
exposed as `types.CodeType`.  I called it "SimpleNamespace" because "Namespace" 
(or "NamespaceType") was a little too unclear and I wanted it to say what it 
was.  In retrospect, "SimpleNamespace" was probably a good choice.

FYI, `tp_name` was originally set to "namespace", rather than 
"types.SimpleNamespace".  I changed it to "types.SimpleNamespace" to add pickle 
support (in b5c8f927829a1679c6748df84a6289fb68343e51, for bpo-15022).  IIRC, 
changing the name was the easiest was to allow pickle to find it.  That said, 
it would be better to do it properly and set `tp_name` to the correct value.

It would probably help to have a little more context on the name and my 
intentions. 
 When I added it (for use in the PEP 421 implementation), I thought of the type 
as one that others would find very useful.  So I imagined we would eventually 
expose it as one of the builtins.  Basically all the other builtin types have 
lowercase names, hence I named it "namespace".  I just didn't get around to 
proposing adding it to the builtins and it fell off my radar.  Note that 
changing the name to "types.SimpleNamespace", while primarly to benefit 
pickling, also made the type more discoverable, which becomes less relevant if 
it is a builtin.

FWIW, I still think it is a good candidate for the builtins, though I'd 
probably name it "simplenamespace" at this point.  Cementing the name as 
"types.SimpleNamespace" would probably be a disappointment for me.  Instead it 
would be better to fix the pickle support, so tp_name could go back to the 
correct name, and make it a builtin.  This isn't a priority for me, though, and 
I don't have a huge sense of ownership here, so I don't feel like I am in much 
of a position to champion my preferences on this.  (I'd be glad to mentor 
someone on this though.)

Thus I'm not sure what to think about this. :)

--
nosy: +eric.snow

___
Python tracker 

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



[issue44221] ImportError: sys.meta_path is None, Python is likely shutting down

2021-06-09 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

Hello, 

Can you please provide a piece of code to reproduce the issue?

--
nosy: +eamanu

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think it actually will be very useful to explain that these cases are invalid 
in the Syntax error, which will also solve this problem.

This on the other hand shows a bigger problem: any generic syntax error that 
happens inside "match" will probably end identifying the keyword as a name, 
even if we don't have specific errors, the parser will point to it and complain 
about "match".

--

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Oh, wait, I think I misunderstood the problem. The problem is that the parser 
is backtracking and identifying match as a name. 

Indeed, the soft keyword is a pain :(

--

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The backtracking with the soft keyword may make this very annoying, by the way.

--

___
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-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25215
pull_request: https://github.com/python/cpython/pull/26629

___
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-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 275d5f7957dbb56a6d5e1248addff210ee2e7270 by Terry Jan Reedy in 
branch 'main':
bpo-40468: Split IDLE settings General tab (GH-26621)
https://github.com/python/cpython/commit/275d5f7957dbb56a6d5e1248addff210ee2e7270


--

___
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-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25214
pull_request: https://github.com/python/cpython/pull/26628

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Probably, otherwise is going to hurt because the syntax errors that you 
describe trigger when two names are place together, which in general is a 
missing comma.

The error message also doesn't say: "you are missing a comma" it says that the 
most typical reason is a missing comma, which is important to distinguish :)

--

___
Python tracker 

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



[issue44360] test_compile killed by SIGKILL on AMD64 Ubuntu 3.x

2021-06-09 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Yes, this was related to the Linux OOM Killer. The agent went down
shortly after this. Either multiple parallel jobs might have led to OOM
or something else. I will see if logs provide more information.

--

___
Python tracker 

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



[issue44360] test_compile killed by SIGKILL on AMD64 Ubuntu 3.x

2021-06-09 Thread STINNER Victor


STINNER Victor  added the comment:

Oh right, exit code -9 means killed by SIGKILL, it doesn't not mean killed 
SIGSEGV. Sorry about the confusion.

How can a signal be killed by SIGKILL? Can it be related to Linux OOM Killer?

Senthil: Would you mind to have a look at the server logs to see if you see 
anything suspicious?

--
nosy: +orsenthil
title: test_compile segfault on AMD64 Ubuntu 3.x -> test_compile killed by 
SIGKILL on AMD64 Ubuntu 3.x

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Brandt Bucher


Brandt Bucher  added the comment:

Perhaps we need something like invalid_mapping_pattern or 
invalid_mapping_pattern_double_star rules?

--

___
Python tracker 

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



[issue44368] Invalid mapping patterns give confusing SyntaxErrors

2021-06-09 Thread Brandt Bucher


New submission from Brandt Bucher :

Here are a few that I found. Not sure when they were introduced:

match ...:
case {**rest, "key": value}:
pass

match ...:
case {"first": first, **rest, "last": last}:
pass

match ...:
case {**_}:
pass

These all give the following error while parsing the second line:

  File "", line 1
match ...:
^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

--
components: Parser
messages: 395453
nosy: brandtbucher, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Invalid mapping patterns give confusing SyntaxErrors
type: behavior
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



[issue44347] Unclear documentation for shutil.copytree()

2021-06-09 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Library (Lib)
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



[issue44347] Unclear documentation for shutil.copytree()

2021-06-09 Thread Irit Katriel


Irit Katriel  added the comment:

>From the code, this arg is simply passed to os.mkdirs() here:
https://github.com/python/cpython/blob/e6e34e45222b9c7a63ba92386612acf768082ba0/Lib/shutil.py#L450

os.mkdir is documented here: 
https://docs.python.org/3/library/os.html#os.makedirs

and says just "If exist_ok is False (the default), an FileExistsError is raised 
if the target directory already exists."

So I agree that the sentence you highlighted can be improved.

Would you like to submit a patch?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Eric Snow


Eric Snow  added the comment:

This was my bad.  I only partially fixed original problem when un-reverting 
3fa63e in gh-26609.  I've merged the rest of the fix in gh-26626.  Sorry about 
that.

--
nosy: +eric.snow

___
Python tracker 

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



[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-09 Thread Ken Jin


Ken Jin  added the comment:

@Steve thanks for the info,

> This is already what we do, so if someone has increased stack usage, they 
> should also decrease the value here.

I see the recursion limit set in _PyEval_InitState but I don't see any special 
settings for windows. Is it somewhere else or am I missing something here :( ?

BTW, I'm thinking about changing the CI checks for windows to test on debug 
builds. I find it strange that the macOS and ubuntu CIs test on debug builds 
while windows seemingly doesn't[1]. If we change it, similar errors may be 
caught earlier at the PR stage rather than when it's committed and causes the 
buildbots to fail. What do you think?

[1] https://github.com/python/cpython/blob/main/.github/workflows/build.yml#L95

--

___
Python tracker 

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



[issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds

2021-06-09 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +25213
pull_request: https://github.com/python/cpython/pull/26627

___
Python tracker 

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



[issue44365] Bad dataclass post-init example

2021-06-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Agreed that that's not a good (or even workable) example. Thanks for pointing 
it out.

I'll come up with something better.

--
assignee: docs@python -> eric.smith
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



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

2021-06-09 Thread Eric Snow


Eric Snow  added the comment:


New changeset e6e34e45222b9c7a63ba92386612acf768082ba0 by Eric Snow in branch 
'main':
bpo-43693: Do not check co_cell2arg if a non-cell offset. (gh-26626)
https://github.com/python/cpython/commit/e6e34e45222b9c7a63ba92386612acf768082ba0


--

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>From the gdb session looks to me that you are reading freed or invalid memory 
>from the dictionary keys. Well, I'm quite sure you are doing that, but I don't 
>know why they is happening.

--

___
Python tracker 

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



[issue44356] Abstract enum mixins not allowed

2021-06-09 Thread Jordan Ephron


Jordan Ephron  added the comment:

Oh, on further investigation I see that the example wouldn't have worked on 3.8 
anyway, due to issue34536 adding some checks to the type returned by _missing_, 
so maybe I'm pushing Enum too far in that case.

--

___
Python tracker 

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



[issue44367] Python Code for WebView2 Exe Testing

2021-06-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

Sorry, this tracker is not for getting help, only for submitting changes to 
Python itself.

Try https://discuss.python.org/c/users/7 instead.

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



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

2021-06-09 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +25212
pull_request: https://github.com/python/cpython/pull/26626

___
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-09 Thread Mark Shannon


Mark Shannon  added the comment:

No, this is done

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



[issue44187] Implement infrastructure for quickening and specializing

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Is anything left in this issue?

--
nosy: +pablogsal

___
Python tracker 

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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

We'll wait for more builds, but for now the buildbot is green so I think this 
should be closed and reopened if we see it again.

--

___
Python tracker 

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



[issue44360] test_compile segfault on AMD64 Ubuntu 3.x

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I am quite sure this is not a segmentation fault, Victor.

--

___
Python tracker 

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



[issue44366] Define functions without parentheses (if no parameters given)

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Closing as this would obviously need a PEP, please open a discusion first on 
python-ideas

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Mark Shannon


Mark Shannon  added the comment:

This line seems to be responsible for most of the failures:
https://github.com/python/cpython/blob/main/Objects/frameobject.c#L985

Which does appear to be a true positive.

--

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



[issue44366] Define functions without parentheses (if no parameters given)

2021-06-09 Thread Irit Katriel


Irit Katriel  added the comment:

The python-ideas mailing list is a better place for such questions than the bug 
tracker.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue44358] AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933).

2021-06-09 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



[issue44367] Python Code for WebView2 Exe Testing

2021-06-09 Thread Bhavna Sewani


New submission from Bhavna Sewani :

I have an application developed using webview2.
It is a web application that would be driven by Microsoft Edge(Chromium). It 
would give a feel of Native/Desktop app
instead of web app to the end user.

I want to automate testing for this app using Python/Robot framework. 
I found an documentation which uses Dotnet, Selenium and Edge drivers for 
testing it.

https://docs.microsoft.com/en-us/microsoft-edge/webview2/how-to/webdriver

Can someone help how can we write below code in Python and Robot to test the 
same using Selenium Library:

static void Main(string[] args)
{

EdgeOptions edgeOptions = new EdgeOptions(false, "webview2");
edgeOptions.BinaryLocation = @"C:\path\to\your\webview2\project.exe";
string msedgedriverDir = @"C:\path\to\your\msededriver.exe's\directory";
string msedgedriverExe = @"msedgedriver.exe";
EdgeDriverService service = 
EdgeDriverService.CreateDefaultService(msedgedriverDir, msedgedriverExe, false);

EdgeDriver e = new EdgeDriver(service, edgeOptions);
e.Url = @"https://www.microsoft.com;; //myexe or webpage path
e.Quit();
}

--
components: Library (Lib)
messages: 395437
nosy: bhavna.sewani, gvanrossum, ncoghlan
priority: normal
severity: normal
status: open
title: Python Code for WebView2 Exe Testing
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



[issue44366] Define functions without parentheses (if no parameters given)

2021-06-09 Thread Boštjan Mejak

New submission from Boštjan Mejak :

The syntax to define a class looks like this:

class MyClass:
pass

Nice and neat.

***
And the syntax to define a function looks like this:

def my_function():
pass

Hmmm...

***
What if we could define functions (that don't have any parameters) like this:

def my_function:
pass

***
Is that a possible scenario at this point, or even desirable?

--
components: Interpreter Core
messages: 395436
nosy: PedanticHacker
priority: normal
severity: normal
status: open
title: Define functions without parentheses (if no parameters given)
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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

commit e858ea15718709bc8ec3c13bd8451ff7d62cbe80 (HEAD -> specialize-load-attr)
Author: Mark Shannon 
Date:   Wed Jun 9 09:33:13 2021 +0100

Assert that address is in bounds (ASAN thinks it might not be).

diff --git a/Python/ceval.c b/Python/ceval.c
index 06a02b40f9..784d0244e8 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3517,6 +3517,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, 
PyFrameObject *f, int throwflag)
 DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR);
 PyDictObject *dict = (PyDictObject *)((PyModuleObject 
*)owner)->md_dict;
 DEOPT_IF(dict->ma_keys->dk_version != cache1->dk_version_or_hint, 
LOAD_ATTR);
+assert(cache0->index < dict->ma_keys->dk_nentries);
 PyDictKeyEntry *ep = DK_ENTRIES(dict->ma_keys) + cache0->index;
 res = ep->me_value;
 DEOPT_IF(res == NULL, LOAD_ATTR);

--

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Mark Shannon


Mark Shannon  added the comment:

What commit are you running that on?

--

___
Python tracker 

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



[issue44356] Abstract enum mixins not allowed

2021-06-09 Thread Jordan Ephron

Jordan Ephron  added the comment:

> But what is an `UnexpectedString()`

Sorry, that’s maybe less relevant to the example. It’s just a subclass of 
string with some marker to make it detectable later on, similar to schemes that 
taint user input to prevent sql injection or whatever

> On Jun 8, 2021, at 23:20, Ethan Furman  wrote:
> 
> 
> Ethan Furman  added the comment:
> 
> Excellent bug report.
> 
> But what is an `UnexpectedString()` ?
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

This is not a false positive. I break into gdb at the moment the sanitizer 
makes the report and inspecting the values that apparently are wrong. I did 
that by breaking into __sanitizer::ColorizeReports which is called for making 
the report. THis is what I did:

$export CFLAGS='-g3 -O0'
$export ASAN_OPTIONS=detect_leaks=0:allocator_may_return_null=1:handle_segv=0
$./configure --with-address-sanitizer --without-pymalloc
$make -j -s
$gdb --args ./python -m test test_lib2to3 -v -m test_prefix_preservation
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
== CPython 3.11.0a0 (heads/specialize-load-attr-dirty:e858ea1571, Jun 9 2021, 
17:34:14) [GCC 11.1.0]
[Detaching after vfork from child process 18105]
== Linux-5.12.9-arch1-1-x86_64-with-glibc2.33 little-endian
== cwd: /home/pablogsal/github/python/master/build/test_python_18103æ
== CPU count: 36
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 1.64 Run tests sequentially
0:00:00 load avg: 1.64 [1/1] test_lib2to3
test_prefix_preservation (lib2to3.tests.test_fixers.Test_dict) ... ok
test_prefix_preservation (lib2to3.tests.test_fixers.Test_except) ... 
=

Breakpoint 1, __sanitizer::ColorizeReports ()
at 
/build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp:62
62  
/build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp:
 No such file or directory.
(gdb) up
#1  0x775f6af1 in 
__sanitizer::SanitizerCommonDecorator::SanitizerCommonDecorator 
(this=)
at 
/build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_report_decorator.h:26
26  
/build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_report_decorator.h: 
No such file or directory.
(gdb)
#2  __asan::Decorator::Decorator (this=) at 
/build/gcc/src/gcc/libsanitizer/asan/asan_descriptions.h:45
45  /build/gcc/src/gcc/libsanitizer/asan/asan_descriptions.h: No such file 
or directory.
(gdb)
#3  __asan::ErrorGeneric::Print (this=this@entry=0x77710908 
<__asan::ScopedInErrorReport::current_error_+8>)
at /build/gcc/src/gcc/libsanitizer/asan/asan_errors.cpp:574
574 /build/gcc/src/gcc/libsanitizer/asan/asan_errors.cpp: No such file or 
directory.
(gdb)
#4  0x7768531e in __asan::ErrorDescription::Print (
this=this@entry=0x77710900 
<__asan::ScopedInErrorReport::current_error_>)
at /build/gcc/src/gcc/libsanitizer/asan/asan_errors.h:440
440 /build/gcc/src/gcc/libsanitizer/asan/asan_errors.h: No such file or 
directory.
(gdb)
#5  0x77685528 in __asan::ScopedInErrorReport::~ScopedInErrorReport 
(this=0x7ffd12e6,
__in_chrg=) at 
/build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp:141
141 /build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp: No such file or 
directory.
(gdb)
#6  0x77684d8d in __asan::ReportGenericError (pc=93824995352503, 
bp=bp@entry=140737488166752,
sp=sp@entry=140737488166736, addr=106515189666344, 
is_write=is_write@entry=false, access_size=access_size@entry=8,
exp=0, fatal=true) at 
/build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp:478
478 in /build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp
(gdb)
#7  0x77685c1c in __asan::__asan_report_load8 (addr=)
at /build/gcc/src/gcc/libsanitizer/asan/asan_rtl.cpp:121
121 /build/gcc/src/gcc/libsanitizer/asan/asan_rtl.cpp: No such file or 
directory.
(gdb)
#8  0x5584dfb7 in _PyEval_EvalFrameDefault (tstate=0x61200040, 
f=0x608b08b0, throwflag=0)
at Python/ceval.c:3549
3549DEOPT_IF(ep->me_key != name, LOAD_ATTR);
(gdb) p ep->me_key
$3 = (PyObject *) 0x60eb1250
(gdb) p ep->me_key->ob_refcnt
$4 = 652835033347

That ep->me_key is obviously corrupted.

--

___
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-09 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset eea8148b7dff5ffc7b84433859ac819b1d92a74d by Ethan Furman in 
branch 'main':
bpo-44242: [Enum] remove missing bits test from Flag creation (GH-26586)
https://github.com/python/cpython/commit/eea8148b7dff5ffc7b84433859ac819b1d92a74d


--

___
Python tracker 

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



[issue44364] Add non integral tests for `sqrt()`

2021-06-09 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Mark Dickinson


Mark Dickinson  added the comment:

If we *really* wanted to bikeshed on the name, back in 1991 Kahan wrote:

> Perhaps the last problem is the hardest: choosing the program's name. Ideally 
> it should need no explanation, but a limitation upon its length may preclude 
> that. Although "CBRT" has seen use, I prefer "QBRT" in order that the prefix 
> "C" may be reserved for use with complex-valued functions.

Source: https://csclub.uwaterloo.ca/~pbarfuss/qbrt.pdf

But that was 30 years ago, and I think the "CBRT"-shaped ship has long since 
sailed.

--

___
Python tracker 

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



[issue44365] Bad dataclass post-init example

2021-06-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eric.smith

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

> It seems like ceval.c:1600 upsets the sanitizer, at least for gcc.

Even if you don't trust the sanitizer, you can also use valgrind, it shows the 
same error:

❯ valgrind ./python -m test test_lib2to3
==27010== Memcheck, a memory error detector
==27010== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==27010== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
==27010== Command: ./python -m test test_lib2to3
==27010==
0:00:00 load avg: 1.53 Run tests sequentially
0:00:00 load avg: 1.53 [1/1] test_lib2to3
==27010== Invalid read of size 8
==27010==at 0x2363E1: _PyEval_EvalFrameDefault (ceval.c:3549)
==27010==by 0x23B270: _PyEval_EvalFrame (pycore_ceval.h:46)

For running valgrind, make sure do disable pymalloc:

export PYTHONMALLOC=malloc

--

___
Python tracker 

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



[issue44363] Address sanitizer (gcc version) is generating false positives

2021-06-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Do you think it would be it feasible to run the address sanitizer on all PRs, 
> so that we can keep it passing?


That's a good idea,let me see how easy doing that would be

--

___
Python tracker 

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



[issue44365] Bad dataclass post-init example

2021-06-09 Thread Micael Jarniac


New submission from Micael Jarniac :

https://docs.python.org/3/library/dataclasses.html#post-init-processing

https://github.com/python/cpython/blob/3.9/Doc/library/dataclasses.rst#post-init-processing

In the example, a base class "Rectangle" is defined, and then a "Square" class 
inherits from it.

On reading the example, it seems like the Square class is meant to be used like:

>>> square = Square(5)

Since the Square class seems to be supposed to be a "shortcut" to creating a 
Rectangle with equal sides.

However, the Rectangle class has two required init arguments, and when Square 
inherits from it, those arguments are still required, so using Square like in 
the above example, with a single argument, results in an error:

>>> square = Square(5)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __init__() missing 2 required positional arguments: 'width' and 
'side'

To "properly" use the Square class, it'd need to be instantiated like so:

>>> square = Square(0, 0, 5)
>>> square
Square(height=5, width=5, side=5)

Which, in my opinion, is completely counter-intuitive, and basically 
invalidates this example.

--
assignee: docs@python
components: Documentation
messages: 395427
nosy: MicaelJarniac, docs@python
priority: normal
severity: normal
status: open
title: Bad dataclass post-init example
type: behavior
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



  1   2   >