[issue41524] PyOS_mystricmp advances pointers too far

2020-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21088
pull_request: https://github.com/python/cpython/pull/21979

___
Python tracker 

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



[issue41524] PyOS_mystricmp advances pointers too far

2020-08-26 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41524] PyOS_mystricmp advances pointers too far

2020-08-26 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 97eaf2b5e5c826b9abe59896a363853bef55c5d9 by wmeehan in branch 
'master':
bpo-41524: fix pointer bug in PyOS_mystr{n}icmp (GH-21845)
https://github.com/python/cpython/commit/97eaf2b5e5c826b9abe59896a363853bef55c5d9


--
nosy: +corona10

___
Python tracker 

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



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

2020-08-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage: patch review -> needs patch
versions:  -Python 3.5

___
Python tracker 

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



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

2020-08-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Pending improving the our docs, I would like to replace the Archive link, which 
is slow to respond.  Issue: there is no copyright notice.  Once might expect it 
to belong to NMT, but they seem to have disowned it by removing the web pages.  
The dead links should be removed from any copy.  The .pdf line in the does work 
at this moment.

If not a work-for-hire, the copyright belonged to Shipman, and now his estate.  
I would not add it to the PSF site without formal permission, but I don't see 
why linking to one unauthorized copy versus another would make much difference.

--
versions: +Python 3.10 -Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

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



[issue17005] Add a topological sort algorithm

2020-08-26 Thread Paddy McCarthy


Paddy McCarthy  added the comment:

Please ignore my earlier Message-id 
<1598493715.04.0.06462575371.issue17...@roundup.psfhosted.org>.

I missed a dependency in cutting down a larger example. Sorry.

--

___
Python tracker 

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



[issue17005] Add a topological sort algorithm

2020-08-26 Thread Paddy McCarthy

Paddy McCarthy  added the comment:

I've been playing with Python 3.9.0rc1 and was looking at a particular graph to 
see when it released tasks for processing.
I ran the following code:

from functools import reduce
from pprint import pprint as pp
from collections import defaultdict
from graphlib import TopologicalSorter
from heapq import heapify, heappush, heappop, heappushpop

print("""
###
### TASK DEPENDENCY 
###

A -> B -> C
↓↓↓
D -> E -> F
""")
graph3 = {"A": {"B", "D"},
  "B": {"C", "E"},
  "C": {"F"},
  "D": {"E"},
  "E": {"F"},
  }
tasktime = {task: 2 for task in 'ABCDEF'}


def simulate(graph, tasktime):
print("\n## NEW SIMULATION")
t = 0
heap = []
heapify(heap)
print("\n# Task runtimes:")
for node, tm in tasktime.items():
print(f"  {node}: {tm}")

print("\n# OUTPUT. (:> for task start times, <: for stop times).\n")
ts = TopologicalSorter(graph)
ts.prepare()
while ts.is_active():
for node in ts.get_ready():
finish = t + tasktime[node]
heappush(heap, (finish, node))
print(f"{'  ' * t}{node}:> @{t}")
t, node = heappop(heap)
print(f"{'  ' * t}{node}<: @{t}")
ts.done(node)

simulate(graph3, tasktime)
tasktime['C'] = 1
simulate(graph3, tasktime)


I got the following output:


###
### TASK DEPENDENCY 
###

A -> B -> C
↓↓↓
D -> E -> F


## NEW SIMULATION

# Task runtimes:
  A: 2
  B: 2
  C: 2
  D: 2
  E: 2
  F: 2

# OUTPUT. (:> for task start times, <: for stop times).

F:> @0
F<: @2
C:> @2
E:> @2
C<: @4
E<: @4
B:> @4
D:> @4
B<: @6
D<: @6
A:> @6
A<: @8

## NEW SIMULATION

# Task runtimes:
  A: 2
  B: 2
  C: 1
  D: 2
  E: 2
  F: 2

# OUTPUT. (:> for task start times, <: for stop times).

F:> @0
F<: @2
C:> @2
E:> @2
  C<: @3
E<: @4
B:> @4
D:> @4
B<: @6
D<: @6
A:> @6
A<: @8
>>> 


Note that in the second simulation, C finish, but B isn't then immediately 
started. I have my own code that also works like this but it isn't optimal.

Thanks guys.

--
nosy: +Paddy McCarthy

___
Python tracker 

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread Dong-hee Na

Dong-hee Na  added the comment:

Thanks Łukasz for finanlizing this work :)

--

___
Python tracker 

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



[issue41609] pdb's whatis command reports method as function

2020-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thank you for your contribution, Irit!

--

___
Python tracker 

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



[issue41609] pdb's whatis command reports method as function

2020-08-26 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue41609] pdb's whatis command reports method as function

2020-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 7361451b97a30de0e758094ac83a1fb1f01ed5bb by Miss Islington (bot) 
in branch '3.9':
bpo-41609: Fix output of pdb's whatis command for instance methods (GH-21935) 
(#21977)
https://github.com/python/cpython/commit/7361451b97a30de0e758094ac83a1fb1f01ed5bb


--

___
Python tracker 

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



[issue41609] pdb's whatis command reports method as function

2020-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 641279e6e51b5d2e10d3fbffe6330e47c94c4bb2 by Miss Islington (bot) 
in branch '3.8':
bpo-41609: Fix output of pdb's whatis command for instance methods (GH-21935) 
(#21976)
https://github.com/python/cpython/commit/641279e6e51b5d2e10d3fbffe6330e47c94c4bb2


--

___
Python tracker 

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



[issue41609] pdb's whatis command reports method as function

2020-08-26 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41609] pdb's whatis command reports method as function

2020-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21086
pull_request: https://github.com/python/cpython/pull/21977

___
Python tracker 

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:

Sorry it took so long, this will get released in Python 3.8.6 and newer.

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

___
Python tracker 

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



[issue41609] pdb's whatis command reports method as function

2020-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 022bc7572f061e1d1132a4db9d085b29707701e7 by Irit Katriel in 
branch 'master':
bpo-41609: Fix output of pdb's whatis command for instance methods (GH-21935)
https://github.com/python/cpython/commit/022bc7572f061e1d1132a4db9d085b29707701e7


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 211e4c6e9c1ab60bb2577dda6587fbec79f679b2 by Miss Islington (bot) 
in branch '3.9':
bpo-33660: Fix PosixPath to resolve a relative path on root (#21974)
https://github.com/python/cpython/commit/211e4c6e9c1ab60bb2577dda6587fbec79f679b2


--

___
Python tracker 

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 7475aa2c590e33a47f5e79e4079bca0645e93f2f by Miss Islington (bot) 
in branch '3.8':
bpo-33660: Fix PosixPath to resolve a relative path on root (GH-21975)
https://github.com/python/cpython/commit/7475aa2c590e33a47f5e79e4079bca0645e93f2f


--

___
Python tracker 

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



[issue41624] typing.Coroutine documentation

2020-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 8c58d2a216ca2b5965361df9b8d8944bc7d4854d by MingZhe Hu in branch 
'master':
bpo-41624: fix documentation of typing.Coroutine (GH-21952)
https://github.com/python/cpython/commit/8c58d2a216ca2b5965361df9b8d8944bc7d4854d


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 94ad6c674f7687ef22853cb8d42b440d6b42ddc8 by Łukasz Langa 
(Dong-hee Na) in branch 'master':
bpo-33660: Fix PosixPath to resolve a relative path on root
https://github.com/python/cpython/commit/94ad6c674f7687ef22853cb8d42b440d6b42ddc8


--

___
Python tracker 

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +21083
pull_request: https://github.com/python/cpython/pull/21974

___
Python tracker 

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21084
pull_request: https://github.com/python/cpython/pull/21975

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +21082
pull_request: https://github.com/python/cpython/pull/21973

___
Python tracker 

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread Łukasz Langa

Change by Łukasz Langa :


--
nosy: +lukasz.langa
nosy_count: 7.0 -> 8.0
pull_requests: +21081
pull_request: https://github.com/python/cpython/pull/21972

___
Python tracker 

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread Manuel Barkhau


Manuel Barkhau  added the comment:

This issue cropped up recently in the black project: 
https://github.com/psf/black/issues/1631

It appears to me that PR 7666 was closed without being merged.

I created https://github.com/python/cpython/pull/21971 before I had found this 
issue.

--
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory

2020-08-26 Thread Manuel Barkhau


Change by Manuel Barkhau :


--
nosy: +mbarkhau
nosy_count: 6.0 -> 7.0
pull_requests: +21079
pull_request: https://github.com/python/cpython/pull/21971

___
Python tracker 

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



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

2020-08-26 Thread Mark Roseman


Mark Roseman  added the comment:

Hello, also (very) late to this party. 

If this would be useful, and unless anyone has any objections, I'd be open to 
hosting a copy of John's material on tkdocs.com. I'd add a header to each page 
explaining it's an unmaintained archive with all the usual caveats. 

That would at least provide a stable place to link to.

--

___
Python tracker 

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



[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Implementing that last option:

```
diff --git a/zipp.py b/zipp.py
index 697d4a9..f244cba 100644
--- a/zipp.py
+++ b/zipp.py
@@ -111,6 +111,7 @@ class CompleteDirs(zipfile.ZipFile):
 
 res = cls.__new__(cls)
 vars(res).update(vars(source))
+res.close = lambda: None
 return res
 
 
```

Does appear to address the issue. I'm not super happy about the implementation, 
though.

--

___
Python tracker 

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



[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I see a few options here:

- Implement CompleteDirs/FastLookup as adapters instead of subclasses, allowing 
the original ZipFile object to represent the state in a single place. This 
approach would likely be slower due to the indirection on all operations 
through the wrapper.
- Instead of constructing a new object and copying the state, CompleteDirs.make 
could mutate the existing ZipFile class, replacing `source.__class__` with the 
new class. This approach is messy and the caller would still need to be aware 
that this change could be applied to the zipfile object.
- Consider this use-case unsupported and document that any ZipFile object 
passed into Path is no longer viable and should not be referenced for another 
purpose.
- Eliminate the class-based performance optimizations and replace them with 
some functional/imperative form. This approach may provide less separation of 
concerns.
- Disable the close-on-delete behavior for the subclasses when state is copied 
from another.

--

___
Python tracker 

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



[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I suspect the issue lies in how the CompleteDirs.make [replaces one instance 
with 
another](https://github.com/jaraco/zipp/blob/8ad959e61cd4be40baab93528775c2bf03c8f4e1/zipp.py#L112-L114)
 in order to provide a complete list of implied directories and to memoize the 
names lookup.

Because constructing a zipfile.Path object around a zipfile.ZipFile copies the 
underlying state, closing one will have the affect of closing the other.

I believe this issue is the same root issue as issue41350.

--

___
Python tracker 

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



[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I am able to replicate the failure using the ondisk fixture:

```diff
diff --git a/test_zipp.py b/test_zipp.py
index a6fbf39..539d0a9 100644
--- a/test_zipp.py
+++ b/test_zipp.py
@@ -259,3 +259,11 @@ class TestPath(unittest.TestCase):
 def test_implied_dirs_performance(self):
 data = ['/'.join(string.ascii_lowercase + str(n)) for n in 
range(1)]
 zipp.CompleteDirs._implied_dirs(data)
+
+def test_read_does_not_close(self):
+for alpharep in self.zipfile_ondisk():
+with zipfile.ZipFile(alpharep) as file:
+for rep in range(2):
+p_ = zipp.Path(file, 'a.txt')
+with p_.open() as inner:
+print(list(inner))
```

--

___
Python tracker 

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



[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I've attempted to replicate the issue in the 
[zipp](https://github.com/jaraco/zipp) test suite with this test:

```diff
diff --git a/test_zipp.py b/test_zipp.py
index a6fbf39..dc7c8aa 100644
--- a/test_zipp.py
+++ b/test_zipp.py
@@ -259,3 +259,10 @@ class TestPath(unittest.TestCase):
 def test_implied_dirs_performance(self):
 data = ['/'.join(string.ascii_lowercase + str(n)) for n in 
range(1)]
 zipp.CompleteDirs._implied_dirs(data)
+
+def test_read_does_not_close(self):
+for alpharep in self.zipfile_alpharep():
+for rep in range(2):
+p_ = zipp.Path(alpharep, 'a.txt')
+with p_.open() as inner:
+print(list(inner))
```

But the test passes.

--

___
Python tracker 

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



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2020-08-26 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 57b698886b47bb81c782c2ba80a8a72fe66c7aad by Elvis Pranskevichus 
in branch '3.8':
[3.8] bpo-32751: Wait for task cancel in asyncio.wait_for() when timeout <= 0 
(GH-21895) (#21967)
https://github.com/python/cpython/commit/57b698886b47bb81c782c2ba80a8a72fe66c7aad


--

___
Python tracker 

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



[issue41598] Adding support for rounding modes to builtin round

2020-08-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Given that most of commenters don't think this is a good idea, I'm going to 
mark it as closed.  Feel free to continue the discussion on python-ideas.  If 
it gains traction, open this back up and give it more core-developer attention.

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



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

2020-08-26 Thread Kyle Mulka


Kyle Mulka  added the comment:

Was able to reproduce with Python 3.9.0rc1 using issue38884.zip. macOS 10.15.5

--

___
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-08-26 Thread Kyle Mulka


Change by Kyle Mulka :


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



[issue41151] Support for new Windows pseudoterminals in the subprocess module

2020-08-26 Thread Chad Smith


Change by Chad Smith :


--
nosy: +cs01

___
Python tracker 

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



[issue39116] StreamReader.readexactly() raises GeneratorExit on ProactorEventLoop

2020-08-26 Thread Guilherme Salgado


Change by Guilherme Salgado :


--
nosy: +salgado

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Initialized: when dlopen on import.

With this I mean import-> dlopen -> dlsym for init function -> call init 
function

--

___
Python tracker 

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread Elvis Pranskevichus


Change by Elvis Pranskevichus :


--
pull_requests: +21078
pull_request: https://github.com/python/cpython/pull/21969

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> What I'm not yet clear on: when is that shared object is initialized and 
> destroyed?

I am assuming that you mean at the Python level and not at the linker level. 
Then:

* Initialized: when dlopen on import.

* Destroyed: never. The interpreter does not dlclose the shared objects.

--

___
Python tracker 

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



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2020-08-26 Thread Elvis Pranskevichus


Change by Elvis Pranskevichus :


--
pull_requests: +21077
pull_request: https://github.com/python/cpython/pull/21968

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Petr Viktorin


Petr Viktorin  added the comment:

> Also, option 1 is virtually equivalent to the state of the _ast module prior 
> to the recent changes except that the symbols are in a shared object instead 
> of the binary or libpython. The advantage here is not moving them out of the 
> shared object, is making them having static storage.

What I'm not yet clear on: when is that shared object is initialized and 
destroyed?

> Would that impact performance considerably?
> Also, adding them into a module that needs access through Python had a 
> bootstrap problem

Only for PyCF_ONLY_AST, which is, AFAIK, not used by the interpreter itself.

--

___
Python tracker 

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



[issue41644] builtin type kwargs

2020-08-26 Thread Joseph Perez


Joseph Perez  added the comment:

That's why it's not an interpreter issue but a lack in the official 
documentation where the signature is documented.
I quote https://docs.python.org/3/library/functions.html#type:
> class type(object)
> class type(name, bases, dict)

The second line should be "class type(name, bases, dict, **kwargs)".

(I've mentioned Pycharm and Mypy, but i think it's a kind of side-effect of the 
incomplete official documentation on which is based their typeshed)

In fact, I've raised this issue because I've found myself needing to 
instantiate a class using `type` and kwargs, and I've not found in the 
documentation an example of it.

--

___
Python tracker 

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



[issue41598] Adding support for rounding modes to builtin round

2020-08-26 Thread Vedran Čačić

Vedran Čačić  added the comment:

Well, of course, but that's possible even now, and people still reach for 
`round`. I guess the problem is that it's too easily accessible. :-)

--

___
Python tracker 

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



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2020-08-26 Thread Elvis Pranskevichus


Change by Elvis Pranskevichus :


--
pull_requests: +21076
pull_request: https://github.com/python/cpython/pull/21967

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Also, adding them into a module that needs access through Python had a 
bootstrap problem:

Basically:

initializing import system -> initialize codec -> compile -> ast init -> init 
ast module -> 

--

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Also, option 1 is virtually equivalent to the state of the _ast module prior to 
the recent changes except that the symbols are in a shared object instead of 
the binary or libpython. The advantage here is not moving them out of the 
shared object, is making them having static storage.

--

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>The mod2obj/obj2mod functions, called by e.g. compile(..., PyCF_ONLY_AST), 
>should:
* import the _ast module
* call a Python-accessible function, e.g. _ast._mod2obj


Would that impact performance considerably?

--

___
Python tracker 

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



[issue41645] Typo First Page of Documentation

2020-08-26 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I don't think that Python, a computer language, IS an approach to OOP. A 
programming language HAS an approach to OOP.

We would say "Python's approach to OOP is ..." so the approach is something 
that belongs to Python, it isn't Python itself.

(My dog's approach to cats is to bark loudly and chase them. It would be wrong 
to say that my dog is to bark loudly and chase cats.)

So the sentence is grammatically correct, inserting an "is" would make it 
incorrect. But perhaps it could be re-written to be more clear? It seems a 
little clumsy to me.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Petr Viktorin


Petr Viktorin  added the comment:

Regarding ac46eb4ad6662cf6d771b20d8963658b2186c48c:
Module states come and go with the modules that contain them; if a 
"get_global_ast_state" or "astmodulestate_global" needs to be accessed from 
outside the module, it shouldn't be module state :/



So, the main issue here is that the AST types are not used only by the _ast 
module, but by the interpreter itself: the compile() builtin and 
Py_CompileStringObject.

I see two ways of fixing this properly:

1. All the classes _ast provides should be built-in, like, say, `function`. 
(Currently, that means they should be static types; later they could be 
per-interpreter.)
The _ast module should merely expose them from Python, like the `types` module 
exposes the function type.
This would mean that calling Py_CompileStringObject with PyCF_ONLY_AST will be 
independent of the _ast module.

2. The mod2obj/obj2mod functions, called by e.g. compile(..., PyCF_ONLY_AST), 
should:
* import the _ast module
* call a Python-accessible function, e.g. _ast._mod2obj
This would mean replacing the _ast module (in sys.modules or through an import 
hook, which you can do from Python code) will affect what AST types will be 
used throughout the interpreter.

--
nosy: +dino.viehland, eric.snow, petr.viktorin

___
Python tracker 

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 6e1954cd8286e083e7f8d09516d91b6b15769a4e by Miss Islington (bot) 
in branch '3.8':
bpo-37658: Fix asyncio.wait_for() to respect waited task status (GH-21894) 
(#21965)
https://github.com/python/cpython/commit/6e1954cd8286e083e7f8d09516d91b6b15769a4e


--

___
Python tracker 

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



[issue41645] Typo First Page of Documentation

2020-08-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

I read it as "It HAS ... data structures and it HAS ... a simple but effective 
approach ...".

So if I were changing it I might add the second "has". Or maybe adding "uses" 
would be better. But I'm not sure it's a great sentence either way.

--
nosy: +eric.smith

___
Python tracker 

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



[issue41548] Tk Window rendering on macOS Big Sur

2020-08-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage:  -> resolved
status: open -> closed
versions:  -Python 3.8, Python 3.9

___
Python tracker 

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



[issue41645] Typo First Page of Documentation

2020-08-26 Thread Krishan Agarwal


New submission from Krishan Agarwal :

Grammatical error (parallelism) in Python 3.8.5 documentation, "The Python 
Tutorial". First page first paragraph. The "it" refers to the Python 
programming language. It HAS...data structures and it IS...a simple but 
effective approach...

Currently reads:
Python is an easy to learn, powerful programming language. It has efficient 
high-level data structures and a simple but effective approach to 
object-oriented programming. 

Should read:
Python is an easy to learn, powerful programming language. It has efficient 
high-level data structures and is a simple but effective approach to 
object-oriented programming.

--
assignee: docs@python
components: Documentation
messages: 375945
nosy: docs@python, kagarwal603
priority: normal
severity: normal
status: open
title: Typo First Page of Documentation
type: enhancement
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



[issue41598] Adding support for rounding modes to builtin round

2020-08-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

If you're using round(str(some_float), digits) and the result is a float, then 
that's a problem, since you're going to round it again for display at some 
point.

If you want a string result, you're better off using format(float, 
format_spec), or f-strings, or str.format() (all of which have the same 
underlying implementation) to do your float-to-string-for-display-purposes work.

I just don't see how getting a binary float via decimal rounding would be 
useful.

--

___
Python tracker 

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



[issue40077] Convert static types to PyType_FromSpec()

2020-08-26 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 31967fd8d0220af84e2698172d1378bffc8cd851 by Dong-hee Na in branch 
'master':
bpo-40077: Convert _operator to use PyType_FromSpec (GH-21954)
https://github.com/python/cpython/commit/31967fd8d0220af84e2698172d1378bffc8cd851


--

___
Python tracker 

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 9de6be4e2ae605a1deb6fa72d5c5f66b07817e4c by Miss Islington (bot) 
in branch '3.9':
bpo-37658: Fix asyncio.wait_for() to respect waited task status (GH-21894) 
(GH-21964)
https://github.com/python/cpython/commit/9de6be4e2ae605a1deb6fa72d5c5f66b07817e4c


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2020-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 1036ccb55de4abc70837cb46a72ddbb370b8fc94 by Miss Islington (bot) 
in branch '3.9':
bpo-32751: Wait for task cancel in asyncio.wait_for() when timeout <= 0 
(GH-21895) (GH-21963)
https://github.com/python/cpython/commit/1036ccb55de4abc70837cb46a72ddbb370b8fc94


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue41598] Adding support for rounding modes to builtin round

2020-08-26 Thread Vedran Čačić

Vedran Čačić  added the comment:

> Personally, I think I'd rather have easier ways to create Decimal objects

Wouldn't everybody? :-P But that's been proposed at least 4 times already and 
never got anywhere. My proposal is at least original, has a precedent at the 
above link (strings as surogate literals, preserving value across semantic 
boundaries), _and_ comes with a natural scope limitation guarantee: noone can 
argue for '2.1' + '3.5' to be '5.6' (because it is already '2.13.5';), it works 
only in the first argument of round.

Also, the string at that time is not so pointless: many people use round for 
printing, at that point you are going to convert to str anyway. And 
round(str(result), digits) gives a nice way to use python's builtin repr 
capability of "picking the shortest representation" for DWIMming: it's the best 
of both worlds, your implementation DWIMs, but you're not responsible for 
corner cases. ;-=

But no, I'm not going to Python-ideas, for the same reason I'm not going back 
to high school: too many bullies, too hard to get your voice heard, mostly 
because everyone assumes you wouldn't be there if you had anything smart to 
say. :-/

--

___
Python tracker 

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



[issue41644] builtin type kwargs

2020-08-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is rather an issue of MyPy and PyCharm. The Python interpreter itself does 
not perform static type testing and does not provide annotations for builtins.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21075
pull_request: https://github.com/python/cpython/pull/21965

___
Python tracker 

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +21074
pull_request: https://github.com/python/cpython/pull/21964

___
Python tracker 

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2020-08-26 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset a2118a14627256197bddcf4fcecad4c264c1e39d by Elvis Pranskevichus 
in branch 'master':
bpo-37658: Fix asyncio.wait_for() to respect waited task status (#21894)
https://github.com/python/cpython/commit/a2118a14627256197bddcf4fcecad4c264c1e39d


--

___
Python tracker 

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



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2020-08-26 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset c517fc712105c8e5930cb42baaebdbe37fc3e15f by Elvis Pranskevichus 
in branch 'master':
bpo-32751: Wait for task cancel in asyncio.wait_for() when timeout <= 0 (#21895)
https://github.com/python/cpython/commit/c517fc712105c8e5930cb42baaebdbe37fc3e15f


--

___
Python tracker 

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



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2020-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21073
pull_request: https://github.com/python/cpython/pull/21963

___
Python tracker 

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



[issue41644] builtin type kwargs

2020-08-26 Thread Joseph Perez


New submission from Joseph Perez :

Class definition can have kwargs which are used by `__init_subclass__` (and 
`__prepare__`).
However, passing these kwargs using `type` builtin function instead of class 
definition syntax is not documented; kwargs are not mentioned in the function 
signature.
https://docs.python.org/3/library/functions.html#type

However, passing kwargs to `type` works:
```python
class Foo:
def __init_subclass__(cls, **kwargs):
print(kwargs)
Bar = type("Bar", (Foo,), {}, bar=None) # mypy and Pycharm complain
#> {'bar': None}
```

By the way, the possibility to pass kwargs in `type` call is not documented  in 
https://docs.python.org/3/reference/datamodel.html#customizing-class-creation 
too.

--
assignee: docs@python
components: Documentation
messages: 375936
nosy: docs@python, joperez
priority: normal
severity: normal
status: open
title: builtin type kwargs
versions: Python 3.10, 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



[issue41598] Adding support for rounding modes to builtin round

2020-08-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

@Vedran:

> I have tons of these ideas, but usually am afraid of voicing them ...

Always good to have ideas brought up, so long as there's no expectation that 
every idea gets implemented. :-) But I think rounding a string is probably 
another one for the python-ideas mailing list. (Personally, I think I'd rather 
have easier ways to create Decimal objects than have strings become a kind of 
proxy for Decimal objects - e.g., `round(2.675d, 2)` rather than 
`round("2.657", 2)`.)

--

___
Python tracker 

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



[issue41642] RHEL and fedora buildbots fail due to disk space error

2020-08-26 Thread STINNER Victor


STINNER Victor  added the comment:

Statistics on partition which are the most full.

Fedora Rawhide x86-64 is ok:

/dev/mapper/vg_root_python--builder--rawhide.osci.io-root14G5,4G  7,6G  
42% /
/dev/mapper/vg_root_python--builder--rawhide.osci.io-home36G 24G   11G  
70% /home

Fedora Stable x86-64 is ok:

/dev/mapper/vg_root_python--builder2--rawhide.osci.io-root14G7,7G  5,2G 
 60% /
/dev/mapper/vg_root_python--builder2--rawhide.osci.io-home36G 23G   12G 
 67% /home

RHEL8 x86-64 is ok:

/dev/mapper/vg_root_python--builder--rhel8.osci.io-root14G3,5G  9,5G  
27% /
/dev/mapper/vg_root_python--builder--rhel8.osci.io-home36G9,7G   24G  
29% /home

RHEL7 x86-64 is ok:

/dev/mapper/vg_root_python--builder--rhel7.osci.io-root   7,6G3,6G  3,7G  
49% /
/dev/mapper/vg_root_python--builder--rhel7.osci.io-home22G 15G  5,9G  
71% /home

RHEL8 FIPS x86-64 is ok:

/dev/mapper/vg_root_python--builder--rhel8--fips.osci.io-root   15G  2.8G   12G 
 20% /
/dev/mapper/vg_root_python--builder--rhel8--fips.osci.io-home   34G  3.7G   29G 
 12% /home

Fedora Rawhide AArch64 is ok:

/dev/mapper/fedora-root44G 26G   19G  58% /
tmpfs  16G436K   16G   1% /tmp

Fedora Stable AArch64 is ok:

/dev/mapper/fedora-root44G 33G   11G  76% /
tmpfs  16G1,6G   15G  11% /tmp

RHEL7 AArch64 is ok:

/dev/mapper/rhel-root44G 15G   30G  33% /

RHEL8 AArch64 had like 22 GB in /tmp, I removed them. It's now better:

* before: /dev/mapper/rhel-root   44G   41G  3.3G  93% /
* after: /dev/mapper/rhel-root   44G   16G   28G  36% /


Fedora Stable ppc64le /tmp contained 1 GB of temporay files. I removed them. 
Before:

/dev/mapper/fedora-root   45G   29G   17G  63% /
tmpfs4.0G  1.1G  3.0G  27% /tmp

Fedora Rawhide ppc64le is ok:

/dev/mapper/fedora-root   45G   27G   19G  59% /
tmpfs4.0G  384K  4.0G   1% /tmp

RHEL7 ppc64le is ok:

/dev/mapper/rhel-root45G 19G   27G  42% /

RHEL8 ppc64le had 22 GB of old files in /tmp: removed, rebooted. Before:

/dev/mapper/rhel-root   45G   41G  4.2G  91% /

--

___
Python tracker 

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



[issue41598] Adding support for rounding modes to builtin round

2020-08-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't think we should add this. It will often surprise the user. We get 
enough .1+.2 != .3 reports as it is, and this would be just as problematic.

--
nosy: +eric.smith

___
Python tracker 

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



[issue32313] Wrong inspect.getsource for datetime

2020-08-26 Thread Dong-hee Na


Dong-hee Na  added the comment:

_datetime.datetime's tp_name is datetime.datetime so
inspect module guess that _datetime.datetime's module name is datetime, not 
_datetime.
I don't think we have to fix this issue from inspect module side.

If the _datetime.datetime's tp_name is updated to _datetime.datetime it could 
be fixed but I don't know this is the right approach and there might be some 
reason for choosing tp_name as datetime.datetime instead of _datetime.datetime.

@p-ganssle is the best expert for datetime module :)
I think that he could give the answer to this.

--
nosy: +corona10

___
Python tracker 

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



[issue41642] RHEL and fedora buildbots fail due to disk space error

2020-08-26 Thread STINNER Victor


STINNER Victor  added the comment:

python-builder-rawhide had its /tmp partition full of temporary "cc.XXX" 
files. Before: /tmp was full at 100% (3.9 GB). After sudo rm -f /tmp/cc*, only 
52 KB are used (1%).

I'm not sure why gcc/clang left so many temporary files :-/ There are many 
large (22 MB) assembly files (.s).

--

___
Python tracker 

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



[issue41642] RHEL and fedora buildbots fail due to disk space error

2020-08-26 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

There were almost 10GB of remnant cc* files in /tmp from the compilers used, 
which I presume were also the temporary artifacts which remained there after 
the disconnects.

Cleaned those up and rebooted the RHEL8 x86_64 buildbot.

--

___
Python tracker 

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



[issue41632] Tkinter - Unexpected behavior after creating around 10000 widgets

2020-08-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue41643] make shutil.make_archive always accept pathlib objects

2020-08-26 Thread Thomas Grainger


Change by Thomas Grainger :


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

___
Python tracker 

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



[issue41639] Unpickling derived class of list does not call __init__()

2020-08-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

>From https://docs.python.org/3/library/pickle.html#pickling-class-instances:

When a class instance is unpickled, its __init__() method is usually not 
invoked.

If you want to change this behavior you have to implement the __reduce__ or 
__reduce_ex__ methods or register the object type in the global or per-pickler 
dispatch table. For example:

class NocaseList(list):

def __reduce__(self):
return self.__class__, (), None, iter(self)

--

___
Python tracker 

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



[issue41642] RHEL and fedora buildbots fail due to disk space error

2020-08-26 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

There is an issue which I discovered after I returned from holidays, basically 
the buildbot-worker keeps getting disconnected from master, so builds start and 
end abruptly, retaining some artifacts.

The next second it tried again with the same results, eventually filling the 
hard disk with the artifacts.

Might be due to an updated package, but I've yet to discover what the issue is.

--

___
Python tracker 

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



[issue41643] make shutil.make_archive always accepts pathlib objects

2020-08-26 Thread Thomas Grainger


New submission from Thomas Grainger :

>>> shutil.make_archive(pathlib.Path("./foo"), root_dir=pathlib.Path("./foo"), 
>>> format="zip")
'/home/graingert/projects/ham/foo.zip'


>>> shutil.make_archive(pathlib.Path("./foo"), root_dir=None, format="zip")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/shutil.py", line 1045, in make_archive
filename = func(base_name, base_dir, **kwargs)
  File "/usr/lib/python3.8/shutil.py", line 912, in _make_zipfile
zip_filename = base_name + ".zip"
TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'

see also https://bugs.python.org/issue23241

--
components: Library (Lib)
messages: 375927
nosy: graingert
priority: normal
severity: normal
status: open
title: make shutil.make_archive always accepts pathlib objects
type: behavior
versions: 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



[issue41643] make shutil.make_archive always accept pathlib objects

2020-08-26 Thread Thomas Grainger


Change by Thomas Grainger :


--
title: make shutil.make_archive always accepts pathlib objects -> make 
shutil.make_archive always accept pathlib objects

___
Python tracker 

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



[issue41642] RHEL and fedora buildbots fail due to disk space error

2020-08-26 Thread STINNER Victor


STINNER Victor  added the comment:

> It seems many of the RHEL and Fedora builds fail due to disk space

These workers have different owners and so need to reach different people. We 
should list all impacted workers.

> https://buildbot.python.org/all/#/builders/185/builds/2

AMD64 RHEL8 3.x is the worker: cstratak-RHEL8-x86_64.

--

___
Python tracker 

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



[issue41642] RHEL and fedora buildbots fail due to disk space error

2020-08-26 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

It seems many of the RHEL and Fedora builds fail due to disk space

https://buildbot.python.org/all/#/builders/185/builds/2

./configure: line 2382: cannot create temp file for here-document: No space 
left on device
./configure: line 2394: cannot create temp file for here-document: No space 
left on device
./configure: line 2429: cannot create temp file for here-document: No space 
left on device
./configure: line 2591: cannot create temp file for here-document: No space 
left on device
./configure: line 2595: cannot create temp file for here-document: No space 
left on device
./configure: line 2599: cannot create temp file for here-document: No space 
left on device
./configure: line 2603: cannot create temp file for here-document: No space 
left on device
./configure: line 2607: cannot create temp file for here-document: No space 
left on device
./configure: line 2611: cannot create temp file for here-document: No space 
left on device

--
components: Tests
messages: 375925
nosy: cstratak, pablogsal, vstinner, xtreak
priority: normal
severity: normal
status: open
title: RHEL and fedora buildbots fail due to disk space error
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue41641] Add a "message" action to warnings, to trigger for every *unique* message

2020-08-26 Thread Xavier Morel


New submission from Xavier Morel :

Warning actions allow deduplicating warning triggers based on category 
("once"), category + file ("module") and category + exact location ("default").

One thing which is missing is support for a single location generating warnings 
*on behalf* of other pieces of code.

`warnings.warn` provides some support via the "stacklevel" parameter, but it is 
difficult to compute if the warning is generated from somewhat nested generic 
code (or even impossible if the warning is generated from completely  generic 
code checking over e.g. data files or the like, or if the invoker could be 
invoked from multiple places with different depth difference from the code 
they're working for).


But in that case, the warning messages will often be unique per functional 
unit, so it could be a useful base for deduplication, even though the warning 
could dynamically be invoked multiple times (per functional unit) because e.g. 
code is reloaded or whatever.

--
components: Library (Lib)
messages: 375924
nosy: xmorel
priority: normal
severity: normal
status: open
title: Add a "message" action to warnings, to trigger for every *unique* message
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved

2020-08-26 Thread Wolfgang Fahl


Wolfgang Fahl  added the comment:

Note that there is also another error:

sqlite3.InterfaceError: Error binding parameter :series - probably unsupported 
type.

with similar issue but which actively shows the binding name (but not the 
record# and debugInfo ...

--

___
Python tracker 

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



[issue41640] module zipfile issue on closing

2020-08-26 Thread Bastian Ebeling


Bastian Ebeling  added the comment:

My used python Version is
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit 
(AMD64)] on win32
Indead - this issue seems to be the same as 40564, but maybe my suggested 
solution is helpful?

--
components: +Library (Lib)

___
Python tracker 

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



[issue41598] Adding support for rounding modes to builtin round

2020-08-26 Thread marco_ocram


marco_ocram  added the comment:

"- What would you expect round(2.675, ndigits=2, mode=ROUND_HALF_UP) to give? I 
strongly suspect that Marco would expect and want a result of 2.68. But if we 
follow the existing rules for round, it's going to give 2.67."
Yes, that's right. And my second humble implementation do this but only if the 
number have a decimal part, i mean the binary approximation is managed only for 
numbers with decimal positions, not for binary distortion in huge numbers with 
a positive exponent for example. For my application is ok but not in general, 
in my fast opinion a possible solution could be translate all numbers in 
exponential decimal format and evaluate the last digit that have to be 
condidered as an approximation decimal digit before applying calculations, or 
some kind of calculations. This is the case for example of 0.4...9

- What would you expect round(2.712, ndigits=3, mode=ROUND_UP) to give? The 
binary float given by the literal 2.712 is just a touch larger than 2.712, so 
it should round up, giving 2.713. But again, I doubt that's what users will 
expect or want.  Even worse, the rounding is not idempotent: the float 2.713 is 
again a little larger than Decimal("2.713"), so it rounds up again: so if we 
round the value 2.712 twice to 3 digits using ROUND_UP, we'll get 2.714.
This is the case of 0.5...1 for example and agreee with all stated. With 
the solution proposed above in my opinion could be managed this case too, 
translating and working on decimal representation and using last digit as 
rounding digit and only for this. The user will have no more the possibility to 
use it as a significant digit to don't have the need to guess nothing. But 
pheraps this means work with strings as implemented in decimals? Sorry i don't 
know this, but i can guess.

In the end, the problem is not simple but not impossible in my opinion, it's 
right that decimals are already implemented and someone could work using them 
if needed, i don't want to impose nothing and convince noone but it's really 
funny in my opinion the only built-in rounding in a cutting-edge language as 
Python give me the banking rounding that as an not so young :-( engineer i've 
learned about now and give me results the same Microsoft in documentation index 
as misleading. I's right as i've already stated in sums reduce the rounding 
error but as i've reported the more common rounding peoples have in mind is the 
half up rounding. These are only my considerations, the choice is your, more 
experienced in the field then me.

--

___
Python tracker 

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



[issue41639] Unpickling derived class of list does not call __init__()

2020-08-26 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pitrou, serhiy.storchaka

___
Python tracker 

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



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

2020-08-26 Thread Eryk Sun


Eryk Sun  added the comment:

Case-sensitive file access is potentially possible with 
FILE_FLAG_POSIX_SEMANTICS (CreateFileW) and FIND_FIRST_EX_CASE_SENSITIVE 
(FindFirstFileExW). These flags make the API omit the object-manager flag 
OBJ_CASE_INSENSITIVE in the NtCreateFile or NtOpenFile system call. That said, 
since Windows XP these API flags are usually ignored because the kernel object 
manager has a default-enabled global flag that makes it always use 
OBJ_CASE_INSENSITIVE for object types that are registered as case-insensitive, 
such as device objects. The global flag is configured as the value 
"obcaseinsensitive" in "HKLM\SYSTEM\CurrentControlSet\Control\Session 
Manager\kernel".

A filesystem may elect to ignore the OBJ_CASE_INSENSITIVE flag, though it's not 
particularly elegant. In Windows 10, NTFS ignores the OBJ_CASE_INSENSITIVE flag 
if the parent directory is flagged as case-sensitive via NtSetInformationFile: 
FileCaseSensitiveInformation [1], which can be set by WSL or fsutil.exe. This 
setting should be avoided for directories that are used by Windows programs. An 
example issue is the way shells use the PATHEXT environment variable to find a 
file when the extension is omitted. Typically each extension in PATHEXT gets 
appended to the base name and checked via FindFirstFileW or GetFileAttributesW. 
But, for example, checking for "spam.BAT" will fail in a case-sensitive 
directory if the extension is actually ".bat", ".Bat", etc.

---

[1] 
https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_file_case_sensitive_information

--

___
Python tracker 

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



[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-08-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Bisection show this to be caused due to 
e5bd73632e77dc5ab0cab77e48e94ca5e354be8a . See also issue41640 for a similar 
report.

--
nosy: +xtreak

___
Python tracker 

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



[issue41640] module zipfile issue on closing

2020-08-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This seems to be a duplicate of issue40564 . Can you please add the python 
version you are using?

--
nosy: +xtreak

___
Python tracker 

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue41557] Upgrade Windows and macOS builds to use SQLite 3.33

2020-08-26 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue41557] Upgrade Windows and macOS builds to use SQLite 3.33

2020-08-26 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +21070
pull_request: https://github.com/python/cpython/pull/21960

___
Python tracker 

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



[issue41640] module zipfile issue on closing

2020-08-26 Thread Bastian Ebeling


New submission from Bastian Ebeling :

When trying to open an archive and read internal binary streams, for me it 
occurs, that the file-stream gets closed.
As a code-Snippet:

import zipfile
srcfile=zipfile.ZipFile('file.zip')
a=zipfile.Path(srcfile,"data1.bin").read_bytes()
b=zipfile.Path(srcfile,"data2.bin").read_bytes()

the second call results in the ValueError: seek of closed file

A quick and dirty solution (as an idea) is to change close() for the 
_SharedFile to run self.close() instead of self._close(findeobj) in the end 
(somehow around line 772).

Hopefully that helps

--
messages: 375917
nosy: bastian.ebeling
priority: normal
severity: normal
status: open
title: module zipfile issue on closing
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



[issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved

2020-08-26 Thread Wolfgang Fahl


Wolfgang Fahl  added the comment:

see also 
https://stackoverflow.com/questions/17169642/python-sqlite-insert-named-parameters-or-null
 for the more general problem

--

___
Python tracker 

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



[issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved

2020-08-26 Thread Wolfgang Fahl


Wolfgang Fahl  added the comment:

see also 
https://stackoverflow.com/questions/60793224/sqlite3-programmingerror-you-did-not-supply-a-value-for-binding-1

--

___
Python tracker 

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



[issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved

2020-08-26 Thread Wolfgang Fahl


Wolfgang Fahl  added the comment:

see also 
https://stackoverflow.com/questions/46080876/python-sqlite3-you-did-not-supply-a-value-for-binding-6

--

___
Python tracker 

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



[issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved

2020-08-26 Thread Wolfgang Fahl


Wolfgang Fahl  added the comment:

see also 
https://stackoverflow.com/questions/61556472/insert-into-a-table-and-get-the-error-sqlite3-programmingerror-you-did-not-sup

--

___
Python tracker 

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



[issue32313] Wrong inspect.getsource for datetime

2020-08-26 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి

Srinivas  Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) 
 added the comment:

Looks like for `getfile` docs should be updated. On python2.7.17_1, 

  import inspect, datetime
  print(inspect.getfile(datetime.datetime)) outputs, 

/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/datetime.so

It seems a long time overdue?

--
nosy: +thatiparthy

___
Python tracker 

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



[issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved

2020-08-26 Thread Wolfgang Fahl


Wolfgang Fahl  added the comment:

see also 
https://stackoverflow.com/questions/61788055/sqlite3-error-you-did-not-supply-a-value-for-binding-1

--

___
Python tracker 

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



  1   2   >