[issue40287] SpooledTemporaryFile.seek returns None

2020-04-17 Thread miss-islington


miss-islington  added the comment:


New changeset 11ae7d075293fe855c8af26b577656d1026cd9bb by Miss Islington (bot) 
in branch '3.7':
bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540)
https://github.com/python/cpython/commit/11ae7d075293fe855c8af26b577656d1026cd9bb


--

___
Python tracker 

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



[issue40287] SpooledTemporaryFile.seek returns None

2020-04-17 Thread miss-islington


miss-islington  added the comment:


New changeset 9796fe88da7415925b3e8f7e0a5e55301548734f by Miss Islington (bot) 
in branch '3.8':
bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540)
https://github.com/python/cpython/commit/9796fe88da7415925b3e8f7e0a5e55301548734f


--

___
Python tracker 

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



[issue40287] SpooledTemporaryFile.seek returns None

2020-04-17 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue40303] argparse parse_args args parameter bug or intended

2020-04-17 Thread Gharg

Gharg  added the comment:

Hi Rémi and Paul,

thanks for your quick response.
It is as i expected and i will use 'store_true'/'store_false' to resolve my 
problem.

I see this issue as resolved and close it.

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



[issue40309] “unmatched paren” for space before parenthesis in Py_BuildValue

2020-04-17 Thread Gerrit Ansmann

New submission from Gerrit Ansmann :

According to the C-API documentation¹ for `Py_BuildValue`:

> The characters space, tab, colon and comma are ignored in format strings (but 
> not within format units such as s#). This can be used to make long format 
> strings a tad more readable.

However format strings such as `"(d )"` cause the error:

> Unmatched paren in format

By contrast `"( d)"` and `"(d d)"` cause no problems. I therefore assume that 
tuples are not considered “format units” in the sense of the above quote and 
this is a bug. Alternatively, the documentation needs clarification.

I could reproduce this problem with Python 3.7 and 3.8. I did not try other 
versions.

Appended is a minimal C extension exhibiting the problem. I compile and run 
with:

gcc -fPIC -I/usr/include/python3.8 -c foo.c -o foo.o
gcc -shared foo.o -o foo.so
python3.8 -c "import foo; foo.bar()"



¹ https://docs.python.org/3/c-api/arg.html

--
components: C API
files: foo.c
messages: 366647
nosy: Wrzlprmft
priority: normal
severity: normal
status: open
title: “unmatched paren” for space before parenthesis in Py_BuildValue
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file49069/foo.c

___
Python tracker 

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



[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2020-04-17 Thread Pikamander2


Pikamander2  added the comment:

For reference, my Python version is 3.8.2 and my bs4 version is 4.8.1

--

___
Python tracker 

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



[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2020-04-17 Thread Pikamander2


Pikamander2  added the comment:

I updated to bs4 version 4.9.0 and the same issue occurs.

--

___
Python tracker 

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



[issue40281] Add pathlib.PurePath.as_uri()

2020-04-17 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Is this different from 
https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.as_uri

--
nosy: +xtreak

___
Python tracker 

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



[issue40310] If use element from for in while loop it will have bad iterate.

2020-04-17 Thread Maks Bleo


New submission from Maks Bleo :

Windows 10
Version 1909 (OS Build18363.778)
Python 3.7.7 x64

cars_av_by_spider_scr.py - py file for scrapy.
bash command to use
scrapy runspider cars_av_by_spider_scr.py -o cars_av_by_spider_scr.json > 
cars_av_by_spider_scr.txt 2>&1

Bad behavior in line 52. (In comment fixed version)

When while loop iterate on second step instead of using
model[0], model[1] it start use model[1][0] and model[1][1].
On third step it  crash, out of range.

But if assign value before while loop and use it in while loop everything work 
fine. 


It's my first bug report.

--
components: Interpreter Core
files: cars_av_by_spider_scr.py
messages: 366652
nosy: Maks Bleo
priority: normal
severity: normal
status: open
title: If use element from for in while loop it will have bad iterate.
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file49071/cars_av_by_spider_scr.py

___
Python tracker 

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



[issue40281] Add pathlib.PurePath.as_uri()

2020-04-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Hmm, it looks like I lost my head from 10 years ago :-S

Sorry for the noise, everyone.

--
resolution:  -> works for me
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



[issue40310] If use element from for in while loop it will have bad iterate.

2020-04-17 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Maks, when you report a bug please write a minimal example that show the bug 
so we don't have to read the whole application 
(https://stackoverflow.com/help/minimal-reproducible-example).

I think in this case that the issue is that you overrride model on line 65 
`model = car[1]` hence the error on the next iteration, model has been replaced.

This bug tracker is for bugs in the Python interpreter, for help in using 
Python please use the python-help mailing list or a forum like StackOverflow.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue40310] If use element from for in while loop it will have bad iterate.

2020-04-17 Thread Maks Bleo

Maks Bleo  added the comment:

I don't think that it will overwrite element from for loop. In my mind it
was a bug.

Thank you.

On Fri, Apr 17, 2020, 1:59 PM Rémi Lapeyre  wrote:

>
> Rémi Lapeyre  added the comment:
>
> Hi Maks, when you report a bug please write a minimal example that show
> the bug so we don't have to read the whole application (
> https://stackoverflow.com/help/minimal-reproducible-example).
>
> I think in this case that the issue is that you overrride model on line 65
> `model = car[1]` hence the error on the next iteration, model has been
> replaced.
>
> This bug tracker is for bugs in the Python interpreter, for help in using
> Python please use the python-help mailing list or a forum like
> StackOverflow.
>
> --
> nosy: +remi.lapeyre
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40310] If use element from for in while loop it will have bad iterate.

2020-04-17 Thread Maks Bleo


Change by Maks Bleo :


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



[issue32494] interface to gdbm_count

2020-04-17 Thread Zackery Spytz


Change by Zackery Spytz :


--
versions: +Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 
3.7, Python 3.8

___
Python tracker 

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



[issue32494] interface to gdbm_count

2020-04-17 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 1.0 -> 2.0
pull_requests: +18910
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19569

___
Python tracker 

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



[issue38884] __import__ is not thread-safe on Python 3

2020-04-17 Thread Martin Laus


Change by Martin Laus :


--
nosy: +Martin Laus

___
Python tracker 

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



[issue40154] embedded null byte when connecting to sqlite database using a bytes object

2020-04-17 Thread Fernando


Fernando  added the comment:

Hello SilentGhost,

Okay, now I understand the difference and had my code working! Thank you very 
much for your answer and to all of you who help in making Python better.

(Wish I had more knowledge of it to help)

Have a nice day!

--

___
Python tracker 

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



[issue40270] activate (or include) json1 extension in sqlite

2020-04-17 Thread Big Stone


Big Stone  added the comment:

You may also consider having it on Mac Python-3.8 and not on Windows Python-3.8 
is a total abnormality. For example, in the context of a Classroom.

--

___
Python tracker 

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



[issue19081] zipimport behaves badly when the zip file changes while the process is running

2020-04-17 Thread Philip Lee


Philip Lee  added the comment:

The issue still remains in Python 3.8.

--
nosy: +iMath
versions: +Python 3.8 -Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue40302] Add _Py_bswap32() function to pyport.h

2020-04-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1ae035b7e847064d09df01ca62b8a761e9b5aae3 by Victor Stinner in 
branch 'master':
bpo-40302: Add pycore_byteswap.h header file (GH-19552)
https://github.com/python/cpython/commit/1ae035b7e847064d09df01ca62b8a761e9b5aae3


--

___
Python tracker 

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



[issue40300] logging.Formatter crashes when default_msec_format is None.

2020-04-17 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 06a35542aad15666cace307d841a95e33f3cbee6 by Mariusz Felisiak in 
branch 'master':
bpo-40300: Allow empty logging.Formatter.default_msec_format. (GH-19551)
https://github.com/python/cpython/commit/06a35542aad15666cace307d841a95e33f3cbee6


--

___
Python tracker 

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



[issue40311] docs.python.org banner - release blocker for 2.7.18

2020-04-17 Thread Sumana Harihareswara


New submission from Sumana Harihareswara :

Add an --outdated flag to the build_docs.py script, which sets the 'outdated' 
value within HTML templates.

See also https://github.com/python/docsbuild-scripts/pull/86  which also would 
need to be merged.

I'm not sure how to mark this in the bug metadata, but this is a blocker for 
the final 2.7.18 release; see 
https://github.com/python/steering-council/issues/3 .

--
assignee: docs@python
components: Documentation
messages: 31
nosy: benjamin.peterson, docs@python, mdk, sumanah
priority: normal
pull_requests: 18911
severity: normal
status: open
title: docs.python.org banner - release blocker for 2.7.18
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue40302] Add _Py_bswap32() function to pyport.h

2020-04-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18912
pull_request: https://github.com/python/cpython/pull/19572

___
Python tracker 

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



[issue40302] Add _Py_bswap32() function to pyport.h

2020-04-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18913
pull_request: https://github.com/python/cpython/pull/19573

___
Python tracker 

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



[issue40311] docs.python.org banner - release blocker for 2.7.18

2020-04-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm marking it as a release blocker, as I believe that's the correct priority 
if it must be done before the 2.7.18 release.

--
nosy: +eric.smith
priority: normal -> release blocker

___
Python tracker 

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



[issue40302] Add pycore_byteswap.h header file with _Py_bswap32() function

2020-04-17 Thread STINNER Victor


Change by STINNER Victor :


--
title: Add _Py_bswap32() function to pyport.h -> Add pycore_byteswap.h header 
file with _Py_bswap32() function

___
Python tracker 

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



[issue39901] `pathlib.Path.owner()` and `group()` use `pwd` and `grp` modules directly

2020-04-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 22386bb4ef740ee92d34c87b8cb90d681423a853 by Barney Gale in branch 
'master':
bpo-39901: Move `pathlib.Path.owner()` and `group()` implementations into the 
path accessor. (GH-18844)
https://github.com/python/cpython/commit/22386bb4ef740ee92d34c87b8cb90d681423a853


--
nosy: +pitrou

___
Python tracker 

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



[issue40302] Add pycore_byteswap.h internal header file with _Py_bswap32() function

2020-04-17 Thread STINNER Victor


Change by STINNER Victor :


--
title: Add pycore_byteswap.h header file with _Py_bswap32() function -> Add 
pycore_byteswap.h internal header file with _Py_bswap32() function

___
Python tracker 

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



[issue39901] `pathlib.Path.owner()` and `group()` use `pwd` and `grp` modules directly

2020-04-17 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
nosy:  -pitrou
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



[issue40308] Intermittent failure of test_os.TestScandir.test_attributes on Windows

2020-04-17 Thread Steve Dower


Steve Dower  added the comment:

Presumably you have something else on your system accessing the file.

Can you try disabling any file sync, anti-malware or indexing tools and see if 
that helps?

--

___
Python tracker 

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



[issue40286] Add randbytes() method to random.Random

2020-04-17 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote a quick benchmark:
---
import pyperf
import random

gen = random.Random()
# gen = random.SystemRandom()
gen.seed(850779834)

if 1: #hasattr(gen, 'randbytes'):
func = type(gen).randbytes
elif 0:
def py_randbytes(gen, n):
data = bytearray(n)
i = 0
while i < n:
chunk = 4
word = gen.getrandbits(32)
word = word.to_bytes(4, 'big')
chunk = min(n, 4)
data[i:i+chunk] = word[:chunk]
i += chunk
return bytes(data)

func = py_randbytes
else:
def getrandbits_to_bytes(gen, n):
return gen.getrandbits(n * 8).to_bytes(n, 'little')

func = getrandbits_to_bytes

runner = pyperf.Runner()
for nbytes in (1, 4, 16, 1024, 1024 * 1024):
runner.bench_func(f'randbytes({nbytes})', func, gen, nbytes)
---

Results on Linux using gcc -O3 (without LTO or PGO) using the C randbytes() 
implementation as the reference:

++-+--+---+
| Benchmark  | c_randbytes | py_randbytes | 
getrandbits_to_bytes  |
++=+==+===+
| randbytes(1)   | 71.4 ns | 1.04 us: 14.51x slower (+1351%)  | 244 ns: 
3.42x slower (+242%)  |
++-+--+---+
| randbytes(4)   | 71.4 ns | 1.03 us: 14.48x slower (+1348%)  | 261 ns: 
3.66x slower (+266%)  |
++-+--+---+
| randbytes(16)  | 81.9 ns | 3.07 us: 37.51x slower (+3651%)  | 321 ns: 
3.92x slower (+292%)  |
++-+--+---+
| randbytes(1024)| 1.05 us | 173 us: 165.41x slower (+16441%) | 3.66 
us: 3.49x slower (+249%) |
++-+--+---+
| randbytes(1048576) | 955 us  | 187 ms: 196.30x slower (+19530%) | 4.37 
ms: 4.58x slower (+358%) |
++-+--+---+

* c_randbytes: PR 19527, randbytes() methods implemented in C
* py_randbytes: bytearray, getrandbits(), .to_bytes()
* getrandbits_to_bytes: Serhiy's implementation: gen.getrandbits(n * 
8).to_bytes(n, 'little')

So well, the C randbytes() implementation is always the fastest.


random.SystemRandom().randbytes() (os.urandom(n)) performance using 
random.Random().randbytes() (Mersenne Twister) as a reference:

++-+-+
| Benchmark  | c_randbytes | systemrandom|
++=+=+
| randbytes(1)   | 71.4 ns | 994 ns: 13.93x slower (+1293%)  |
++-+-+
| randbytes(4)   | 71.4 ns | 1.04 us: 14.60x slower (+1360%) |
++-+-+
| randbytes(16)  | 81.9 ns | 1.02 us: 12.49x slower (+1149%) |
++-+-+
| randbytes(1024)| 1.05 us | 6.22 us: 5.93x slower (+493%)   |
++-+-+
| randbytes(1048576) | 955 us  | 5.64 ms: 5.91x slower (+491%)   |
++-+-+

os.urandom() is way slower than Mersenne Twister.

Well, that's not surprising: os.urandom() requires at least one syscall 
(getrandom() syscall on my Linux machine).

--

___
Python tracker 

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



[issue40286] Add randbytes() method to random.Random

2020-04-17 Thread STINNER Victor


Change by STINNER Victor :


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



[issue40286] Add randbytes() method to random.Random

2020-04-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9f5fe7910f4a1bf5a425837d4915e332b945eb7b by Victor Stinner in 
branch 'master':
bpo-40286: Add randbytes() method to random.Random (GH-19527)
https://github.com/python/cpython/commit/9f5fe7910f4a1bf5a425837d4915e332b945eb7b


--

___
Python tracker 

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



[issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child

2020-04-17 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue40302] Add pycore_byteswap.h internal header file with _Py_bswap32() function

2020-04-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d7c657d4b121164caa439253da5266b2e29a1bed by Victor Stinner in 
branch 'master':
bpo-40302: UTF-32 encoder SWAB4() macro use a|b rather than a+b (GH-19572)
https://github.com/python/cpython/commit/d7c657d4b121164caa439253da5266b2e29a1bed


--

___
Python tracker 

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



[issue40302] Add pycore_byteswap.h internal header file with _Py_bswap32() function

2020-04-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1a1bd2e23871619adc1405e1cdc7c1e61252fd2c by Victor Stinner in 
branch 'master':
bpo-40302: Replace PY_INT64_T with int64_t (GH-19573)
https://github.com/python/cpython/commit/1a1bd2e23871619adc1405e1cdc7c1e61252fd2c


--

___
Python tracker 

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



[issue40302] Add pycore_byteswap.h internal header file with _Py_bswap32() function

2020-04-17 Thread STINNER Victor


STINNER Victor  added the comment:

FYI this issue was motivated by the implementation of 
random.Random().randbytes(): bpo-40286.

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



[issue40282] random.getrandbits(0) should succeed

2020-04-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 75a3378810bab03949ad9f653f78d933bdf3879c by Antoine Pitrou in 
branch 'master':
bpo-40282: Allow random.getrandbits(0) (GH-19539)
https://github.com/python/cpython/commit/75a3378810bab03949ad9f653f78d933bdf3879c


--

___
Python tracker 

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



[issue40282] random.getrandbits(0) should succeed

2020-04-17 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue39897] `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses

2020-04-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset c746c4f353510a17683a49ed7f90ffaae664ff7b by Barney Gale in branch 
'master':
bpo-39897: Remove needless `Path(self.parent)` call, which makes `is_mount()` 
misbehave in `Path` subclasses. (GH-18839)
https://github.com/python/cpython/commit/c746c4f353510a17683a49ed7f90ffaae664ff7b


--
nosy: +pitrou

___
Python tracker 

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



[issue39897] `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses

2020-04-17 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue39894] `pathlib.Path.samefile()` calls `os.stat()` without using accessor

2020-04-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 5b1d9184bb0e34391637c06bc7651fb6de8a6240 by Barney Gale in branch 
'master':
bpo-39894: Route calls from pathlib.Path.samefile() to os.stat() via the path 
accessor (GH-18836)
https://github.com/python/cpython/commit/5b1d9184bb0e34391637c06bc7651fb6de8a6240


--
nosy: +pitrou

___
Python tracker 

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



[issue39894] `pathlib.Path.samefile()` calls `os.stat()` without using accessor

2020-04-17 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue33898] pathlib issues with Windows device paths

2020-04-17 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue35306] OSError [WinError 123] when testing if pathlib.Path('*') (asterisks) exists

2020-04-17 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue40223] Add -fwrapv for new icc versions

2020-04-17 Thread Furkan Onder


Furkan Onder  added the comment:

Pr has been sent.

--

___
Python tracker 

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



[issue40247] Logged out of user when running Tkinter

2020-04-17 Thread Ned Deily


Change by Ned Deily :


--
nosy: +ned.deily

___
Python tracker 

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



[issue19113] duplicate test names in Lib/ctypes/test/test_functions.py

2020-04-17 Thread Furkan Onder


Furkan Onder  added the comment:

There are two tests with same name in the same test class  
(ctypes.test.test_functions test_errors)
After merging both and re-run I encounter with this error
which looks like it was always there but overwritten by other test (with same 
name)

F...s.s...
==
FAIL: test_errors (__main__.FunctionTestCase)
--
Traceback (most recent call last):
  File "/home/furkan/cpython/Lib/ctypes/test/test_functions.py", line 219, in 
test_errors
self.assertRaises(TypeError, f, X()) #cannot convert parameter
AssertionError: TypeError not raised by _testfunc_p_p

--
Ran 22 tests in 0.003s

--
nosy: +furkanonder

___
Python tracker 

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



[issue40286] Add randbytes() method to random.Random

2020-04-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18914
pull_request: https://github.com/python/cpython/pull/19574

___
Python tracker 

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



[issue40312] Weakref callbacks running before finalizers in GC collection

2020-04-17 Thread Allan Feldman


New submission from Allan Feldman :

Our team is making use of a weakref.WeakValueDictionary() that is accessed 
through the finalizer of a class. We observed that in Python 3 occasionally 
values that are directly referenced by an object being finalized were missing 
from the WeakValueDictionary.


Example:

import weakref
cache = weakref.WeakValueDictionary()

class Foo(object):
pass


class Bar(object):
def __init__(self, foo):
self.foo = foo
cache['foo'] = foo

def __del__(self):
del cache['foo']

bar = Bar(Foo())
del bar


Upon further investigation, we realized that this had to do with the weakref 
callback within WeakValueDictionary being called (removing the key from the 
dict) before the finalizer for Foo was called.

Reproduction:

import gc
import weakref

cache = weakref.WeakValueDictionary()


class Foo(object):
pass


class Bar(object):
def __init__(self, foo):
# Force a reference cycle to run del only on gc.collect
self._self = self
self.foo = foo
cache["foo"] = foo

def __del__(self):
# foo is missing from the cache because the weakref callback has
# already run. KeyError is raised.
del cache["foo"]


bar = Bar(Foo())
del bar

gc.collect()


Expected behavior:

The weakref callback should only be called when the object is known to be 
deleted (after the finalizer runs). Running weakref callbacks before then means 
that the weakref callback can run on objects being ressurected by the finalizer.

Example:

import gc
import weakref


class ForeverObject(object):
def __init__(self, circular):
# Introduce a circular reference so that gc must collect the object
if circular:
self._self = self

def __del__(self):
global o
o = self


def callback(wr):
print("callback running", wr)


for circular in (True, False):
print("--- Circular reference:", circular, "---")
o = ForeverObject(circular)
wr = weakref.ref(o, callback)
del o
gc.collect()
print("--")


Note: Python 2.7 appears to have the opposite behavior - weakref callbacks are 
only invoked when dealloc occurs outside of gc. The Python 2.7 behavior hasn't 
yet been investigated.


If the expected behavior above is confirmed, I would be happy to submit a patch 
for this issue!

--
components: Interpreter Core
messages: 366675
nosy: a-feld
priority: normal
severity: normal
status: open
title: Weakref callbacks running before finalizers in GC collection
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue40286] Add randbytes() method to random.Random

2020-04-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18915
pull_request: https://github.com/python/cpython/pull/19575

___
Python tracker 

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



[issue40286] Add randbytes() method to random.Random

2020-04-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 223221b290db00ca1042c77103efcbc072f29c90 by Serhiy Storchaka in 
branch 'master':
bpo-40286: Makes simpler the relation between randbytes() and getrandbits() 
(GH-19574)
https://github.com/python/cpython/commit/223221b290db00ca1042c77103efcbc072f29c90


--

___
Python tracker 

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



[issue40286] Add randbytes() method to random.Random

2020-04-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 87502ddd710eb1f030b8ff5a60b05becea3f474f by Victor Stinner in 
branch 'master':
bpo-40286: Use random.randbytes() in tests (GH-19575)
https://github.com/python/cpython/commit/87502ddd710eb1f030b8ff5a60b05becea3f474f


--

___
Python tracker 

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



[issue40313] bytes.hex(sep, bytes_per_sep) is many times slower than manually inserting the separators

2020-04-17 Thread Antony Lee

New submission from Antony Lee :

Consider the following example, linewrapping 10^4 bytes in hex form to 128 
characters per line, on Py 3.8.2 (Arch Linux repo package):

In [1]: import numpy as np, math

In [2]: data = np.random.randint(0, 256, (100, 100), 
dtype=np.uint8).tobytes()  

In [3]: %timeit data.hex("\n", -64)
123 µs ± 5.8 µs per loop (mean ± std. dev. of 7 runs, 1 loops each)

In [4]: %timeit h = data.hex(); "\n".join([h[n * 128 : (n+1) * 128] for n 
in range(math.ceil(len(h) / 128))])
45.4 µs ± 746 ns per loop (mean ± std. dev. of 7 runs, 1 loops each)

In [5]: h = data.hex(); "\n".join([h[n * 128 : (n+1) * 128] for n in 
range(math.ceil(len(h) / 128))]) == data.hex("\n", -64) 
  
Out[5]: True

(the last line checks the validity of the code.)

It appears that a naive manual wrap is nearly 3x faster than the builtin 
functionality.

--
components: Library (Lib)
messages: 366678
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: bytes.hex(sep, bytes_per_sep) is many times slower than manually 
inserting the separators
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



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

2020-04-17 Thread STINNER Victor


STINNER Victor  added the comment:

I understand that with PR 19460, code coverage is not longer run on C extension 
modules of the stdlib. I'm not using C code coverage, so I don't know how it's 
supposed to be used or analyzed.

Hai: if you want to move on this issue, you have to find who uses this CI and 
how it should behave.

The other option is to only fix test_distutils.

--

___
Python tracker 

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



[issue40312] Weakref callbacks running before finalizers in GC collection

2020-04-17 Thread deekay


deekay  added the comment:

I'm baffled by the performance difference of the following two semantically 
equivalent(?) programs.

Python:

#test.py
import time
starttime=time.time()
import tensorflow 
print(f"Import took: {time.time() - starttime}")

C using CPython

//test.c
#include 
#include  
#include  
int main(int argc, char *argv[])
{
Py_Initialize();
clock_t t = clock();
PyObject* pModule = PyImport_ImportModule("tensorflow");
double time_taken = ((double)clock() - t)/CLOCKS_PER_SEC;
printf("Import took:  %f\n", time_taken);
return 0;
}

Now compare the two:


cl.exe /I"C:\Program Files\Python37\include" test.c
link test.obj python37.lib /LIBPATH:"C:\Program Files\Python37\libs"
.\test.exe


> 2020-04-17 13:00:51.598550: W 
> tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load 
> dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
> 2020-04-17 13:00:51.606296: I 
> tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart 
> dlerror if you do not have a GPU set up on your machine.

> **Import took: 23.160523891448975**


python test.py


> 2020-04-17 13:01:19.525648: W 
> tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load 
> dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
> 2020-04-17 13:01:19.530726: I 
> tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart 
> dlerror if you do not have a GPU set up on your machine.

> **Import took: 2.3172824382781982**


Not that it should matter much but my tensorflow version is 1.15
Why is the python VM code so much faster than the compiled CPython code?
Does the python vm add some magic that PyImport_ImportModule doesn't?

--
nosy: +deekay

___
Python tracker 

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



[issue40312] Weakref callbacks running before finalizers in GC collection

2020-04-17 Thread deekay


deekay  added the comment:

Wrong thread, wrong thread, abort!
Sorry, I meant to submit this as a separate issue.
I don't see a delete option.
Maybe a mod can remove this please?

--

___
Python tracker 

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



[issue40312] Weakref callbacks running before finalizers in GC collection

2020-04-17 Thread Ned Deily


Ned Deily  added the comment:

Going going gone

--
nosy: +ned.deily

___
Python tracker 

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



[issue40312] Weakref callbacks running before finalizers in GC collection

2020-04-17 Thread Ned Deily


Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg366680

___
Python tracker 

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



[issue40312] Weakref callbacks running before finalizers in GC collection

2020-04-17 Thread Ned Deily


Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg366682

___
Python tracker 

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



[issue40312] Weakref callbacks running before finalizers in GC collection

2020-04-17 Thread Ned Deily


Change by Ned Deily :


--
nosy:  -ned.deily

___
Python tracker 

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



[issue40314] python code order of magnitude faster than equivalent CPython code for simple import statement

2020-04-17 Thread deekay


New submission from deekay :

I'm baffled by the performance difference of the following two semantically 
equivalent(?) programs.

Python:

#test.py
import time
starttime=time.time()
import tensorflow 
print(f"Import took: {time.time() - starttime}")

vs C using CPython

//test.c
#include 
#include  
#include  
int main(int argc, char *argv[])
{
Py_Initialize();
clock_t t = clock();
PyObject* pModule = PyImport_ImportModule("tensorflow");
double time_taken = ((double)clock() - t)/CLOCKS_PER_SEC;
printf("Import took:  %f\n", time_taken);
return 0;
}

Now compare the two:

cl.exe /I"C:\Program Files\Python37\include" test.c
link test.obj python37.lib /LIBPATH:"C:\Program Files\Python37\libs"
.\test.exe


> 2020-04-17 13:00:51.598550: W 
> tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load 
> dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
> 2020-04-17 13:00:51.606296: I 
> tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart 
> dlerror if you do not have a GPU set up on your machine.

> **Import took: 23.160523891448975**


python test.py


> 2020-04-17 13:01:19.525648: W 
> tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load 
> dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
> 2020-04-17 13:01:19.530726: I 
> tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart 
> dlerror if you do not have a GPU set up on your machine.

> **Import took: 2.3172824382781982**


Not that it should matter much but my tensorflow version is 1.15
Why is the python VM code so much faster than the compiled CPython code?
Does the python vm add some magic that PyImport_ImportModule doesn't?

--
components: C API
messages: 366683
nosy: deekay
priority: normal
severity: normal
status: open
title: python code order of magnitude faster than equivalent CPython code for 
simple import statement
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



[issue40312] Weakref callbacks running before finalizers in GC collection

2020-04-17 Thread Ned Deily


Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg366681

___
Python tracker 

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



[issue40247] Logged out of user when running Tkinter

2020-04-17 Thread Ned Deily


Ned Deily  added the comment:

Can you give the exact sequence of steps to reproduce the problem you see, 
please?

--

___
Python tracker 

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



[issue40301] zipfile module: new feature (two lines of code), useful for test, security and forensics

2020-04-17 Thread Massimo Sala


Massimo Sala  added the comment:

Hi Steven

Every software "ecosystem" has its guidelines and I am a newbie about
python development.

Mmh I see your concerns. I agree about your deletions of all py 3 versions
before the latest 3.9.

About Py 2, I remark these facts:
- there are a lot of forensics tools still written for py 2;
- python 2.7.18 will be forever the last python 2 and I think is it fine to
end-users to have zipfile with this feature both in py 2.7 and py 3.9;
- in the code there isn't any new routine to test: the change is just to
expose one internal variable.

I agree my request is an exception but I think you have to agree this
situation is exceptional.
IMHO rules must exist to help us and I think this request doesn't carry any
burden.

I ask you please
- to reconsider my request
- anyway, to put me in contact with zipfile mainteners, I don't know how to
reach them but I want to hear them about this.

Many thanks, Massimo

--

___
Python tracker 

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



[issue38492] Microsoft Store app IDLE (Python 3.8) needs msvcp140.dll

2020-04-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18916
pull_request: https://github.com/python/cpython/pull/19576

___
Python tracker 

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



[issue38492] Microsoft Store app IDLE (Python 3.8) needs msvcp140.dll

2020-04-17 Thread miss-islington


miss-islington  added the comment:


New changeset c46dc6f72b4b23a33e66f196f174602d520716df by Miss Islington (bot) 
in branch '3.7':
bpo-38492: Remove pythonw.exe dependency on the Microsoft C++ runtime (GH-16824)
https://github.com/python/cpython/commit/c46dc6f72b4b23a33e66f196f174602d520716df


--

___
Python tracker 

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



[issue39959] Bug on multiprocessing.shared_memory

2020-04-17 Thread Diogo Flores


Diogo Flores  added the comment:

Any update on this issue?

--
title: (Possible) bug on multiprocessing.shared_memory -> Bug on 
multiprocessing.shared_memory

___
Python tracker 

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



[issue19081] zipimport behaves badly when the zip file changes while the process is running

2020-04-17 Thread Philip Lee


Philip Lee  added the comment:

and I got ZipImportError: bad local file header

--

___
Python tracker 

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



[issue35967] Better platform.processor support

2020-04-17 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy: +yan12125
nosy_count: 4.0 -> 5.0
pull_requests: +18917
pull_request: https://github.com/python/cpython/pull/19577

___
Python tracker 

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



[issue40301] zipfile module: new feature (two lines of code), useful for test, security and forensics

2020-04-17 Thread Daniel Hillier


Daniel Hillier  added the comment:

Could something similar be achieved by looking for the earliest file header 
offset?

def find_earliest_header_offset(zf):
earliest_offset = None
for zinfo in zf.infolist():
if earliest_offset is None:
earliest_offset = zinfo.header_offset
else:
earliest_offset = min(zinfo.header_offset, earliest_offset)
return earliest_offset


You could also adapt this using

zinfo.compress_size + len(zinfo.FileHeader())

to see if there were any sections inside the archive which were not referenced 
from the central directory. Not sure if zip files with arbitrary bytes inside 
the archive would be valid everywhere, but I think they are using zipfile.

You can also have zipped content inside an archive which has a valid fileheader 
but no reference from the central directory. Those entries are discoverable by 
implementations which process content serially from the start of the file but 
not implementations which rely on the central directory.

--
nosy: +dhillier

___
Python tracker 

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



[issue40314] python code order of magnitude faster than equivalent CPython code for simple import statement

2020-04-17 Thread Andy Lester


Change by Andy Lester :


--
nosy: +petdance

___
Python tracker 

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



[issue40301] zipfile module: new feature (two lines of code), useful for test, security and forensics

2020-04-17 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Sorry Massimo, there are no new features being added to 2.7, not even 
critical security fixes. That's not my decision.

https://www.python.org/doc/sunset-python-2/

Python 2 is effectively now a dead project from the point of view of us 
here at CPython. The very final bug fix release, 2.7.18, is due out any 
time soon, but it only includes fixes up to 1st of January.

You could try submitting your feature request to third-party bundlers of 
2.7, such as Red Hat, but I expect they will say no to new features.

For what it is worth, I don't agree that this situation is exceptional. 
Even if 2.7 wasn't obsolete, this is still a new feature. If we made an 
exception for you, then people using Python 2.7 still couldn't use this 
feature: `myzipfile.offset` would fail on code using Python 2.7, 2.7.1, 
2.7.2, 2.7.3, ... 2.7.17 and only work with 2.7.18. Nobody could use it 
unless their application required 2.7.18.

If you want this in 2.7 for your own personal use, wait for the 2.7.18 
final release, then add it into your personal copy. It is open source 
and you are completely permitted!

--

___
Python tracker 

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



[issue1490384] PC new-logo-based icon set

2020-04-17 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution: accepted -> fixed
stage:  -> resolved
type:  -> enhancement

___
Python tracker 

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



[issue40308] Intermittent failure of test_os.TestScandir.test_attributes on Windows

2020-04-17 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I disabled indexing and antivirus and I didn't see anything else obvious that 
would access the files, but I'm probably missing something -- I get the same 
intermittent failure when I build from the source at the 3.8.2 release, but not 
on a copy of 3.8.2 from python.org, so it's probably some setting that I don't 
know about for the repo folder. I think perhaps this isn't a real issue but 
rather me just not knowing the goings-on of my OS. :)

--

___
Python tracker 

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



[issue40315] Incorrect stacksize in code object

2020-04-17 Thread Skip Montanaro

New submission from Skip Montanaro :

Consider this trivial function:

>>> def f():
...   while True:
...     pass
...

and its disassembly:

>>> dis.dis(f)
  3     >>    0 JUMP_ABSOLUTE               0
              2 LOAD_CONST                  0 (None)
              4 RETURN_VALUE

Despite its infinite-loop-ness, the generated LOAD_CONST/RETURN_VALUE pair 
suggests the code object's stacksize should be 1, but it's 0:

>>> print(f.__code__.co_stacksize)
0

I understand that the compiler might have decided the code was unreachable and 
the LOAD_CONST instruction would never be reached, but if that was the case, 
why would that instruction pair be generated?

This is only of interest because my register virtual machine translator trusts 
that the co_nlocals and co_stacksize attributes of the code object reflect the 
actual space allocation in the frame object. I can use

max(1, f.__code__.co_stacksize + f.__code__.co_nlocals)

as the allocated locals+stack space. (That first slot in the frame object will 
always be available.) That makes this example translate, but doesn't guarantee 
there's not a bug in determination of the stack size which could pop up again 
later.

--
components: Interpreter Core
messages: 366692
nosy: skip.montanaro
priority: normal
severity: normal
status: open
title: Incorrect stacksize in code object
type: compile error
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



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

2020-04-17 Thread hai shi


hai shi  added the comment:

> Hai: if you want to move on this issue, you have to find who uses this CI and 
> how it should behave.

Copy that. I found PR7773 updated the travis' coverage ci and a discussion 
issue in https://github.com/python/core-workflow/issues/2, so I add brett and 
ammar to the noisy list, MAYBE they know the historical background.

--
nosy: +ammar2, brett.cannon

___
Python tracker 

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



[issue1490384] PC new-logo-based icon set

2020-04-17 Thread SilentGhost


Change by SilentGhost :


--
pull_requests:  -16955

___
Python tracker 

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