[issue44913] segfault in call to embedded PyModule_New

2021-08-23 Thread hai shi


hai shi  added the comment:

This bpo isn't a bug, so I close it now. If there are some enhancements need to 
be discussed, we can reopen 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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-23 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +26377
pull_request: https://github.com/python/cpython/pull/27926

___
Python tracker 

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



[issue41102] ZipFile.namelist() does not match the actual files in .zip file

2021-08-23 Thread Xiaolong Liu


Xiaolong Liu  added the comment:

Andrei: No multiprocessing or multithreading was used when creating the zip 
file.

--

___
Python tracker 

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



[issue44989] Fix documentation for truth testing

2021-08-23 Thread Steven D'Aprano


New submission from Steven D'Aprano :

Truth testing states that "Any object can be tested for truth value" but from 
3.9 onwards, doing so with NotImplemented is deprecated and will be made a 
TypeError.

https://docs.python.org/3/library/stdtypes.html#truth-value-testing

It is also not true for third-party objects such as numpy arrays (which raise 
ValueError) and pandas dataframes.

I think that truth testing should have been considered a fundamental operation 
that (in the absence of bugs) always succeeds, but #35712 says different. Not 
that I'm bitter *wink*

In any case, at the very least the exception for NotImplemented should be 
documented.

--
assignee: docs@python
components: Documentation
messages: 400196
nosy: docs@python, steven.daprano
priority: normal
severity: normal
status: open
title: Fix documentation for truth testing
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44988] Use the newest tcl/tk support

2021-08-23 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +26376
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27925

___
Python tracker 

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



[issue44988] Use the newest tcl/tk support

2021-08-23 Thread 张峻铭

New submission from 张峻铭 <3180471...@qq.com>:

The newest tcl/tk(8.7) has been released. If python uses the newest tcl/tk, 
tkinter will be better in these respects:
1. progressbar will be added text on it.
2. the scrollbar, text and canvas will be moved more smoothly.
3. tcl/tk8.7 includes tk_sysnotify and tk_systray, which provide users with a 
modern way match OS to show the messages.
Therefore, I suggest that python should use the newest tcl to bring new feature 
to Python GUI.

--
components: Tkinter
messages: 400195
nosy: smart-space
priority: normal
severity: normal
status: open
title: Use the newest tcl/tk support
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue42538] AsyncIO strange behaviour

2021-08-23 Thread Nick Coghlan


Change by Nick Coghlan :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> asyncio.create_task() documentation should mention user needs 
to keep reference to the task

___
Python tracker 

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



[issue42538] AsyncIO strange behaviour

2021-08-23 Thread Nick Coghlan


Nick Coghlan  added the comment:

While filed later, issue44665 correctly describes the problem reported here: 
asyncio is behaving as expected, but the docs don't make it clear that you need 
to save a reference to the result of ensure_future()/create_task() if you don't 
want to risk the task unexpectedly disappearing mid execution.

So marking this as a duplicate of that docs issue.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue44981] wildcard imports should normalise names in `__all__`

2021-08-23 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

On Mon, Aug 23, 2021 at 05:42:59PM +, Serhiy Storchaka wrote:
> 
> Serhiy Storchaka  added the comment:
> 
> Should getattr() normalize attribute name? If no, it will produce 
> surprises further along the way. If yes, it will add significant 
> overhead.

Good point.

In pure Python, normalising the string in getattr does have significant 
cost, about 125% slower on my computer using 3.9:

>>> from functools import partial
>>> import unicodedata
>>> normalise = partial(unicodedata.normalize, "NFKC")
>>> def mygetattr(obj, name, _normalise=normalise, _getattr=getattr):
... return _getattr(obj, _normalise(name))
... 
>>> t1 = Timer('getattr([], "reverse")')
>>> t2 = Timer('mygetattr([], "reverse")', setup='from __main__ import 
mygetattr')
>>> 
>>> min(t1.repeat(repeat=7))
0.08972279605222866
>>> min(t2.repeat(repeat=7))
0.20272555301198736
>>> (0.20272555301198736-0.08972279605222866)/0.08972279605222866
1.2594653971102117

But for ASCII strings at least, I think there is an opportunity to avoid 
that cost entirely. See #44987.

> Even star-import can get significant impact.

I'm less worried about that for three reasons:

1. It only affects star-import, which is not "best practice", so only a 
small number of scripts will be affected.

2. In the most overwhelming common case, you do any star-imports once, 
at the beginning of the module, not repeatedly. Star-imports will not be 
part of a tight, performance critical loop. So it is a one-off cost.

3. The cost of an import is a lot more than just the getattr, so any 
normalisation cost is a correspondingly smaller part of the total.

--

___
Python tracker 

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



[issue44987] Speed up unicode normalization of ASCII strings

2021-08-23 Thread Steven D'Aprano


New submission from Steven D'Aprano :

I think there is an opportunity to speed up some unicode normalisations 
significantly.

In 3.9 at least, the normalisation appears to be dependent on the length of the 
string:

>>> setup="from unicodedata import normalize; s = 'reverse'"
>>> t1 = Timer('normalize("NFKC", s)', setup=setup)
>>> setup="from unicodedata import normalize; s = 'reverse'*1000"
>>> t2 = Timer('normalize("NFKC", s)', setup=setup)
>>> 
>>> min(t1.repeat(repeat=7))
0.04854234401136637
>>> min(t2.repeat(repeat=7))
9.98313440399943

But ASCII strings are always in normalised form, for all four normalisation 
forms. In CPython, with PEP 393 (Flexible String Representation), it should be 
a constant-time operation to detect whether a string is pure ASCII, and avoid 
scanning the string or attempting the normalisation.

--
components: Unicode
messages: 400192
nosy: ezio.melotti, steven.daprano, vstinner
priority: normal
severity: normal
status: open
title: Speed up unicode normalization of ASCII strings
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue41102] ZipFile.namelist() does not match the actual files in .zip file

2021-08-23 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Liu: Thanks for the report!

By the way on re-reading my message, of course by opening and closing archive 
on each file using the `with` block, you take care of the first issue I 
mentioned (although it's not very efficient).

And I assume there was no multiprocessing / multithreading involved in creating 
the zip files? (I know it's not in the code you posted, but just to be sure?)

I agree with closing this until someone else runs into it and is able to 
reproduce reliably.

--

___
Python tracker 

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



[issue44892] [configparser] Module configparser fails when the config file contains a "%" inside a commentary

2021-08-23 Thread Diego Ramirez


Change by Diego Ramirez :


--
nosy: +uranusjr
title: [configparser] Module configparser fails when the file contains a "%" 
inside a commentary -> [configparser] Module configparser fails when the config 
file contains a "%" inside a commentary

___
Python tracker 

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



[issue41102] ZipFile.namelist() does not match the actual files in .zip file

2021-08-23 Thread Xiaolong Liu


Xiaolong Liu  added the comment:

Andrei: Never mind. 

Yes. It is hardly impossible to sort out a problem when it cannot be 
reproduced. Just close it plz.

Anyway, many thanks for your suggestions.

--

___
Python tracker 

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



[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

2021-08-23 Thread Diego Ramirez


Change by Diego Ramirez :


--
nosy: +DiddiLeija

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-23 Thread Mark Roseman

Mark Roseman  added the comment:

Łukasz, thank you very much for your help with getting these changes merged in!

I hope others will chime in with suggestions and/or edits to the newer or 
substantially revised sections. There is most definitely lots of room for 
improvement. 

One specific request... does anyone have solid recommendations for other 
resources (including books, paid video courses, etc.) that extensively cover 
Tkinter and use current best practices (grid, ttk, etc.)? This would be for the 
"see also" section. While I think the two free tutorial/reference resources on 
tkdocs.com make the most sense, I'm a bit queasy about the self-promotion 
optics of also highlighting Modern Tkinter as prominently as it is now in the 
books section.

That still leaves the "handy reference" section to deal with, which currently 
consists of a mish-mash of material. When I have a chance, I'll work on a PR 
with a list of classes and common methods (but not arguments or explanations) 
as suggested before. While the pieces that were already merged in were probably 
low on the controversy scale, it's still unclear what the right way forward is 
with the actual reference part and I expect some more discussion on that.

--

___
Python tracker 

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



[issue44985] Inconsistent returned value of inspect.getfullargspec(object.__init__).

2021-08-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

Well, as you note, technically object.__init__ does take args and kwargs. It 
just raises an exception if if finds any. What are you proposing to change here?

--
components:  -Distutils, Parser
nosy: +eric.smith

___
Python tracker 

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



[issue44934] Windows installer: Append Python to PATH instead of prepending it

2021-08-23 Thread Bastian Neuburger


Bastian Neuburger  added the comment:

Update: .NET 3.5 installation worked out fine via VS 2019 installer, I also 
added the VS2017 build tools as a precaution since the VM builds take some time.

Afterwards build.bat still failed during wix steps, complaining about missing 
python.exe in PCBuild/win32, not sure if the 32bit interpreter should be 
fetched/built automagically. Then I tried build.bat -x64, which ran succesfully 
and provided attached installer.

To test it (in administrative shell):
1. git clone https://github.com/bneuburg/python_msi_appendpath
2. cd python_appendpath_installer
3. .\python-3.11.0.7539-amd64.exe /quiet InstallAllUsers=1 AppendPath=1 
Include_test=0

Running this in an administrative shell appended InstallDir and 
Installdir/Scripts to the sytem PATH and created the PATHEXT entries for PY and 
PYC as well. So far so good!

I only noticed the following problem:
The first uninstall also succesfully removed all environment variables, however 
after reinstalling and re-uninstalling, only the PATHEXT were removed, the 
Python entries in PATH were not removed. This was also independent of the order 
of software removal (Python Launcher first or second). 

Thus I had a look at it with orca.exe [1]:
1. Install with appendpath=1
2. Get list of installed msis with: wmic product get /format:csv > software.csv
3. Search for appendpath in software.csv which will return the location of the 
msi somewhere in c:\windows\installer
4. Right click that file and select 'Edit with Orca'

In the environment table it has entries in the following form for a Local 
Machine install (c.f. for attached screenshot):

Environment  | Name| Value  | Component 
PATH_LM  | =-*PATH | [~]:[InstallDirectory] | AppendPath_LM

which according to Microsoft documentation [2] seems to be as intended (add on 
install, remove on uninstall). But it just doesn't, also see Sascha's comment 
above. When looking at Orca I also noticed that I forgot to change the position 
of InstallDirectory in PATH for the CU install from first to last, I updated 
the PR accordingly.

Since you have a Microsoft e-mail address: Any chances you could ask the MSI 
pros there what is going on?
I'll be busy with offline stuff for a few weeks, but if you have any ideas how 
to troubleshoot this, let me know. I found a discussion where the order of the 
prefixes for names was slightly changed [3], i.e. *=- instead of =-* but I 
don't know if this matters at all or how to test it.

Sorry for the text book, things like that really keep me digging.

[1] https://docs.microsoft.com/de-de/windows/win32/msi/orca-exe
[2] https://docs.microsoft.com/en-us/windows/win32/msi/environment-table
[3] https://www.itninja.com/question/add-to-path-envronment-variable

--
Added file: https://bugs.python.org/file50233/orca.png

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Here's pure python code for experimentation:

from marshal import dumps, loads

def marshal_set(s):
return dumps(sorted(s, key=dumps))

def unmarshal_set(m):
return frozenset(loads(m))

def test(s):
assert unmarshal_set(marshal_set(s)) == s

test({("string", 1), ("string", 2), ("string", 3)})

--

___
Python tracker 

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



[issue44690] Adopt binacii.a2b_base64's strict mode in base64.b64decode

2021-08-23 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[issue44690] Adopt binacii.a2b_base64's strict mode in base64.b64decode

2021-08-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset fa6304a5225787054067bb56089632146d288b20 by Idan Moral in branch 
'main':
bpo-44690: Adopt binacii.a2b_base64's strict mode in base64.b64decode (GH-27272)
https://github.com/python/cpython/commit/fa6304a5225787054067bb56089632146d288b20


--

___
Python tracker 

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



[issue44690] Adopt binacii.a2b_base64's strict mode in base64.b64decode

2021-08-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I'm not worried about the regex vs binascii C implementation performance at all.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue44986] Date formats in help messages of argparse

2021-08-23 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +26375
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27923

___
Python tracker 

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



[issue44986] Date formats in help messages of argparse

2021-08-23 Thread Matías Senger

New submission from Matías Senger :

If the help message of an argument in argparse contains a date format, e.g. 
%Y-%m-%d, it crashes when printing the help after being invoked with the -h 
option. Uploaded an example.

--
components: Library (Lib)
files: deleteme.py
messages: 400183
nosy: mail.de.senger
priority: normal
severity: normal
status: open
title: Date formats in help messages of argparse
type: crash
versions: Python 3.11
Added file: https://bugs.python.org/file50232/deleteme.py

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Here's pure python code for expirmentation:

from marshal import dumps, loads

def marshal_set(s):
return dumps(sorted((dumps(value), value) for value in s))

def unmarshal_set(m):
return {value for dump, value in loads(m)}

def test(s):
assert unmarshal_set(marshal_set(s)) == s

test({("string", 1), ("string", 2), ("string", 3)})

--

___
Python tracker 

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



[issue44984] Rewrite test_null_strings in _testcapi

2021-08-23 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Serhiy! ✨ 🍰 ✨

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I can clean it up and convert it to a PR if we decide 
> we want to go this route.

+1 This is by far the smallest intervention that has been discussed.

--

___
Python tracker 

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



[issue44934] Windows installer: Append Python to PATH instead of prepending it

2021-08-23 Thread Steve Dower


Steve Dower  added the comment:

I don't think we upload the artifact from the MSI builds, sorry.

If Visual Studio has an option for the older version of .NET, then yeah, 
that'll do it. But because it was an OS component, you may have to do it 
through the OS dialog in the link I posted.

GitHub will get the CLA update soon enough. It's always a little slower - bpo 
is the canonical source.

--

___
Python tracker 

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



[issue44934] Windows installer: Append Python to PATH instead of prepending it

2021-08-23 Thread Bastian Neuburger


Bastian Neuburger  added the comment:

Ah ok. Do you know if VS 2019 will do the job at all? I encountered a few 
(unrelated) projects on github that state they will only build with VS 2017.

I will install .NET 3.5 via the VS 2019 installer (should do the trick, right?) 
and see how it turns out. 

Could you attach the msi installer build artifact from the build you kicked off 
so I can test if the appendpath stuff works as expected? Or did you already 
have a look at it?

P.S.: bpo now recognizes that I signed the CLA, github not yet.

--

___
Python tracker 

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



[issue44934] Windows installer: Append Python to PATH instead of prepending it

2021-08-23 Thread Steve Dower


Steve Dower  added the comment:

Oh I remember this one. The Wix toolset still requires .NET 3.5, which you have 
to install manually these days. Because it's being launched as a console app, 
the UI never gets triggered.

I thought we had this in the devguide already... but maybe not (or not 
prominently enough). Might be worth trying to add some detection for it - 
hopefully a new version of Wix will move to newer .NET too.

See 
https://docs.microsoft.com/en-us/dotnet/framework/install/dotnet-35-windows-10 
for install instructions. It should work after that. The CI build succeeded, 
but it'll need manual testing.

--

___
Python tracker 

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



[issue41102] ZipFile.namelist() does not match the actual files in .zip file

2021-08-23 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Liu: apologies for the confusion, I missed that when coming back to the thread 
for the 2nd time.

I took a look at the code and one potential issue I see is that you are opening 
the file in 'w' mode if stat size is 0 (or if file isn't valid), and in 'a' 
mode otherwise. It's better to just use the 'a' mode as then the file will be 
created if it doesn't exist.

This may lead to file being opened in 'w' mode after some files already were 
meant to be written, - due to buffering.

A second issue is that you're closing and reopening the archive for each file 
written. I'm not sure if you had a reason for that but it's better to open the 
archive and write all of the files if you have them ready.

It's hard to say exactly what lead to this incomplete archive without a 
reproducible way to create it.

--

___
Python tracker 

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



[issue44962] asyncio.create_task weakrefset race condition

2021-08-23 Thread Thomas Grainger


Thomas Grainger  added the comment:

> weakref.WeakSet is not thread-safe,  which means concurrent create_task's in 
> different threads (even on separate event loops) is not safe.

actually it looks like WeakSet is *supposed* to be thread-safe


```
import patchy

patchy.patch(
"weakref:WeakSet._commit_removals",
"""\
@@ -1,5 +1,10 @@
 def _commit_removals(self):
-l = self._pending_removals
+pop = self._pending_removals.pop
 discard = self.data.discard
-while l:
-discard(l.pop())
+while True:
+try:
+item = pop()
+except IndexError:
+return
+else:
+discard(item)
"""
)

import itertools
import asyncio
import concurrent.futures
import sys
import threading

threads = 200

def test_all_tasks_threading() -> None:
async def foo() -> None:
await asyncio.sleep(0)

async def create_tasks() -> None:
for i in range(1000):
asyncio.create_task(foo())

await asyncio.sleep(0)

results = []
with concurrent.futures.ThreadPoolExecutor(threads) as tpe:
for f in concurrent.futures.as_completed(
tpe.submit(asyncio.run, create_tasks()) for i in range(threads)
):
results.append(f.result())
assert results == [None] * threads


def main():
for i in itertools.count():
test_all_tasks_threading()
print(f"worked {i}")
return 0


if __name__ == "__main__":
sys.exit(main())
```

--

___
Python tracker 

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



[issue43853] [sqlite3] Improve sqlite3_value_text() error handling

2021-08-23 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> What about new tests and NEWS update?

See PR 27642 for the expanded tests, and PR 27922 for amending news entries. I 
didn't combine the two, as I figured you might have more comments on the former 
PR.

--

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset e4795103025aeef295a8c5f75cc7c33801f93a24 by Miss Islington (bot) 
in branch '3.10':
bpo-42560: simplify/merge architecture info in Tkinter docs (GH-27839)
https://github.com/python/cpython/commit/e4795103025aeef295a8c5f75cc7c33801f93a24


--

___
Python tracker 

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



[issue44934] Windows installer: Append Python to PATH instead of prepending it

2021-08-23 Thread Bastian Neuburger


Bastian Neuburger  added the comment:

Attached is the full output of:

- msbuild.exe -version
- get_externals.bat
- build.bat

For the first few build tasks there are git related errors, which make sense 
since I ran the build from a downloaded zip release of the source instead of a 
git clone. I assume the first "real" error occurs when building the wix 
targets, just grep for MSB4062, this is when things go downhill.

--
Added file: https://bugs.python.org/file50231/buildout.txt

___
Python tracker 

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



[issue43853] [sqlite3] Improve sqlite3_value_text() error handling

2021-08-23 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue43853] [sqlite3] Improve sqlite3_value_text() error handling

2021-08-23 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +26374
pull_request: https://github.com/python/cpython/pull/27922

___
Python tracker 

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



[issue44962] asyncio.create_task weakrefset race condition

2021-08-23 Thread Thomas Grainger


Change by Thomas Grainger :


--
pull_requests: +26373
pull_request: https://github.com/python/cpython/pull/27921

___
Python tracker 

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



[issue44984] Rewrite test_null_strings in _testcapi

2021-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset 6ff7fefc914541ec5afdd3c8193da80818cb0817 by Miss Islington (bot) 
in branch '3.10':
bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904)
https://github.com/python/cpython/commit/6ff7fefc914541ec5afdd3c8193da80818cb0817


--

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26372
pull_request: https://github.com/python/cpython/pull/27920

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e41912c6348362489d2514565a70782591f23902 by Mark Roseman in 
branch 'main':
bpo-42560: simplify/merge architecture info in Tkinter docs (GH-27839)
https://github.com/python/cpython/commit/e41912c6348362489d2514565a70782591f23902


--

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset 8351df6e3652a41ffc720066a68b666bbef1df67 by Miss Islington (bot) 
in branch '3.10':
bpo-42560: add warning to Tkinter docs about outdated pre-8.5 documentation 
online (GH-27836)
https://github.com/python/cpython/commit/8351df6e3652a41ffc720066a68b666bbef1df67


--

___
Python tracker 

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



[issue44980] Clean up tests that return a value that isn't None

2021-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset 10955353ce25a52741e8f72fdbb6f4b150ee4dc7 by Miss Islington (bot) 
in branch '3.10':
bpo-44980: fix test_constructor to return None value (GH-27898)
https://github.com/python/cpython/commit/10955353ce25a52741e8f72fdbb6f4b150ee4dc7


--

___
Python tracker 

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



[issue44980] Clean up tests that return a value that isn't None

2021-08-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset de49eacee85dbd56bfa261200604766ca6042d66 by Miss Islington (bot) 
in branch '3.9':
bpo-44980: fix test_constructor to return None value (GH-27898) (GH-27914)
https://github.com/python/cpython/commit/de49eacee85dbd56bfa261200604766ca6042d66


--

___
Python tracker 

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



[issue32397] textwrap output may change if you wrap a paragraph twice

2021-08-23 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
type: behavior -> enhancement
versions: +Python 3.11 -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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-23 Thread Brandt Bucher


Brandt Bucher  added the comment:

This rough proof-of-concept seems to have the desired effect:

diff --git a/Python/marshal.c b/Python/marshal.c
index 1260704c74..70f9c4b109 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -503,9 +503,23 @@ w_complex_object(PyObject *v, char flag, WFILE *p)
 W_TYPE(TYPE_SET, p);
 n = PySet_GET_SIZE(v);
 W_SIZE(n, p);
-while (_PySet_NextEntry(v, &pos, &value, &hash)) {
+PyObject *pairs = PyList_New(0);
+for (Py_ssize_t i = 0; _PySet_NextEntry(v, &pos, &value, &hash); i++) {
+PyObject *pair = PyTuple_New(2);
+PyObject *dump = PyMarshal_WriteObjectToString(value, p->version);
+PyTuple_SET_ITEM(pair, 0, dump);
+Py_INCREF(value);
+PyTuple_SET_ITEM(pair, 1, value);
+PyList_Append(pairs, pair);
+Py_DECREF(pair);
+}
+PyList_Sort(pairs);
+for (Py_ssize_t i = 0; i < n; i++) {
+PyObject *pair = PyList_GET_ITEM(pairs, i);
+PyObject *value = PyTuple_GET_ITEM(pair, 1);
 w_object(value, p);
 }
+Py_DECREF(pairs);
 }
 else if (PyCode_Check(v)) {
 PyCodeObject *co = (PyCodeObject *)v;

I can clean it up and convert it to a PR if we decide we want to go this route.

--

___
Python tracker 

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



[issue44972] Add workflow_dispatch trigger for GitHub Actions jobs

2021-08-23 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> first-time contributors need a maintainer to approve the workflows for their 
> PRs

How is manually dispatched workflows different from just opening a PR to your 
own fork? I do that from time to time in order to run the CI before opening a 
PR against the CPython repo.

--
nosy: +erlendaasland

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26371
pull_request: https://github.com/python/cpython/pull/27915

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 1eb451031a64b4f28d737ee7f394252ae9a76118 by Mark Roseman in 
branch 'main':
bpo-42560: add warning to Tkinter docs about outdated pre-8.5 documentation 
online (GH-27836)
https://github.com/python/cpython/commit/1eb451031a64b4f28d737ee7f394252ae9a76118


--

___
Python tracker 

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



[issue44980] Clean up tests that return a value that isn't None

2021-08-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26369
pull_request: https://github.com/python/cpython/pull/27913

___
Python tracker 

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



[issue44980] Clean up tests that return a value that isn't None

2021-08-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 27b761a11a14521617a01257eb3767150bec3a74 by andrei kulakov in 
branch 'main':
bpo-44980: fix test_constructor to return None value (GH-27898)
https://github.com/python/cpython/commit/27b761a11a14521617a01257eb3767150bec3a74


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44980] Clean up tests that return a value that isn't None

2021-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26370
pull_request: https://github.com/python/cpython/pull/27914

___
Python tracker 

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



[issue44984] Rewrite test_null_strings in _testcapi

2021-08-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset b0df288c946143352237f28c78481d935ba1502c by Łukasz Langa in 
branch '3.9':
[3.9] bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904) (GH-27910)
https://github.com/python/cpython/commit/b0df288c946143352237f28c78481d935ba1502c


--

___
Python tracker 

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



[issue43306] Error in multiprocessing.Pool's initializer doesn't stop execution

2021-08-23 Thread Aaron


Aaron  added the comment:

What should the behavior be if an exception is raised in a pool worker during 
bootstrapping / initialization function execution? I think an exception should 
be raised in the process owning the Pool, and in the fix I'm tinkering around 
with I just raise a RuntimeError currently. I can see an argument also for 
raising different exceptions (or having different behavior) for bootstrapping 
error vs init function, but implementation is more complicated. My current 
implementation simply creates a lock in _repopulate_pool_static, acquires it, 
and waits for the worker function to release it. By polling every 100ms I also 
detect if the process exited before releasing the lock in which case I raise a 
Runtime error. I just started testing this implementation, but I'll provide it 
for anyone else who wants to test / comment.

--
Added file: https://bugs.python.org/file50230/pool.py

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26367
pull_request: https://github.com/python/cpython/pull/27911

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26368
pull_request: https://github.com/python/cpython/pull/27912

___
Python tracker 

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



[issue42560] Improve Tkinter Documentation

2021-08-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 08830a4f75553682e8d1ea6cdabd4c3472c59e28 by Mark Roseman in 
branch 'main':
bpo-42560: rewrite of Tkinter docs "life preserver" (GH-27842)
https://github.com/python/cpython/commit/08830a4f75553682e8d1ea6cdabd4c3472c59e28


--

___
Python tracker 

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



[issue44984] Rewrite test_null_strings in _testcapi

2021-08-23 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +26366
pull_request: https://github.com/python/cpython/pull/27910

___
Python tracker 

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



[issue44962] asyncio.create_task weakrefset race condition

2021-08-23 Thread Thomas Grainger


Change by Thomas Grainger :


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

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-23 Thread Brandt Bucher


Brandt Bucher  added the comment:

Ah, yeah.

Could we add a flag to disable the reference mechanism, just for frozenset 
elements? It would make marshalled frozensets a bit bigger (unless we 
re-marshalled each one after sorting)... but I still prefer that to adding more 
logic/subclasses to frozenset.

--

___
Python tracker 

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



[issue44984] Rewrite test_null_strings in _testcapi

2021-08-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 4d689173861257c69adc6dc1dca4171946ddb57f by Serhiy Storchaka in 
branch 'main':
bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904)
https://github.com/python/cpython/commit/4d689173861257c69adc6dc1dca4171946ddb57f


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44984] Rewrite test_null_strings in _testcapi

2021-08-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26364
pull_request: https://github.com/python/cpython/pull/27908

___
Python tracker 

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



[issue44972] Add workflow_dispatch trigger for GitHub Actions jobs

2021-08-23 Thread Steve Dower


Steve Dower  added the comment:

> I think you could also test this out by going to my fork ...

Good point, and I can't trigger a build on your fork.

This seems okay to me.

--

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

No, it cannot be fixed in marshal itself.

s = {("string", 1), ("string", 2), ("string", 3)}

All tuples contain references to the same string. The first serialized tuple 
will contain serialization of the string, all other will contain references to 
it. So the binary representation of the tuple depends on whether it is 
serialized first on not first.

--

___
Python tracker 

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



[issue44981] wildcard imports should normalise names in `__all__`

2021-08-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

How about making it an error to have non-NFKC normalized names in __all__?

--

___
Python tracker 

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



[issue44981] wildcard imports should normalise names in `__all__`

2021-08-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Should getattr() normalize attribute name? If no, it will produce surprises 
further along the way. If yes, it will add significant overhead.

Even star-import can get significant impact.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-23 Thread Brandt Bucher


Brandt Bucher  added the comment:

Could this issue be fixed in marshal itself? Off the top of my head, one 
possible option could be to use the marshalled bytes of each elements as a sort 
key, rather than the elements themselves. So serialize, *then* sort?

--

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset 27f2f62ad490afc8e4dd6d80351916a9d06b97e3 by Miss Islington (bot) 
in branch '3.10':
bpo-38291: Update 3.10 WhatsNew with typing.{io|re} DeprecationWarning 
(GH-27872)
https://github.com/python/cpython/commit/27f2f62ad490afc8e4dd6d80351916a9d06b97e3


--

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-08-23 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-08-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 1a995b0ceefdf7eb59963f3ab395c47d8da226e3 by Ken Jin in branch 
'main':
bpo-38291: Update 3.10 WhatsNew with typing.{io|re} DeprecationWarning 
(GH-27872)
https://github.com/python/cpython/commit/1a995b0ceefdf7eb59963f3ab395c47d8da226e3


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue43306] Error in multiprocessing.Pool's initializer doesn't stop execution

2021-08-23 Thread Aaron


Aaron  added the comment:

I ran into this bug answering this question on Stack Overflow: 
https://stackoverflow.com/questions/68890437/cannot-use-result-from-multiprocess-pool-directly

I have minimized the code required to replicate the behavior, but it boils down 
to: when using "spawn" to create a multiprocessing pool, if an exception occurs 
during the bootstrapping phase of the new child or during the initialization 
function with any start method, it is just cleaned up, and another takes its 
place (which will also fail). This creates an infinite loop of creating child 
workers, workers exiting due to an exception, and re-populating the pool with 
new workers.


```
import multiprocessing
multiprocessing.set_start_method("spawn")
# bootstraping only problem with spawn

def task():
print("task")

if __name__ == "__main__":
with multiprocessing.Pool() as p:
p.apply(task)
else:
raise Exception("raise in child during bootstraping phase")

#
# or
#

import multiprocessing
# multiprocessing.set_start_method("fork")
# fork or spawn doesn't matter

def task():
print("task")

def init():
raise Exception("raise in child during initialization function")

if __name__ == "__main__":
with multiprocessing.Pool(initializer=init) as p:
p.apply(task)
```

If Pool._join_exited_workers could determine if a worker exited before 
bootstrapping, or the initialization function completed, It would indicate a 
likely significant problem. I'm fine with exceptions in the worker target 
function not being re-raised in the parent, however it seems the Pool should 
stop trying if it's failing to create new workers.

--
nosy: +athompson6735
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue44972] Add workflow_dispatch trigger for GitHub Actions jobs

2021-08-23 Thread Ryan Mast (nightlark)


Ryan Mast (nightlark)  added the comment:

> On the main request, provided the workflow_dispatch is only triggerable by 
> non-contributors in their own fork (without any of our tokens/etc.) then it's 
> fine by me. If it allows anyone to trigger CI builds against the main repo, 
> I'd rather not.

It should require write permissions in a repository to use the trigger, so 
they'll only be able to run workflows in the context of their fork: 
https://github.community/t/who-can-manually-trigger-a-workflow-using-workflow-dispatch/128592/4

I think you could also test this out by going to my fork and seeing if it lets 
you trigger the workflow: 
https://github.com/nightlark/cpython/actions/workflows/build.yml

--

___
Python tracker 

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



[issue44934] Windows installer: Append Python to PATH instead of prepending it

2021-08-23 Thread Steve Dower


Steve Dower  added the comment:

I kicked off the build on the PR so we can see what errors it finds. Nothing 
jumps out as obviously wrong in the changes, but it only takes one missing 
reference to a file to break it all.

If you want to share the errors from your test machine, copy-pasting all the 
output into a text file and attaching it here is best.

--

___
Python tracker 

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



[issue44972] Add workflow_dispatch trigger for GitHub Actions jobs

2021-08-23 Thread Steve Dower


Steve Dower  added the comment:

> first-time contributors need a maintainer to approve the workflows for their 
> PRs

This is an important security consideration, so I'd rather not go and change it.

On the main request, provided the workflow_dispatch is only triggerable by 
non-contributors in their own fork (without any of our tokens/etc.) then it's 
fine by me. If it allows anyone to trigger CI builds against the main repo, I'd 
rather not.

--

___
Python tracker 

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



[issue44972] Add workflow_dispatch trigger for GitHub Actions jobs

2021-08-23 Thread Ryan Mast (nightlark)


Ryan Mast (nightlark)  added the comment:

Another observation, first-time contributors need a maintainer to approve the 
workflows for their PRs -- from the looks of it that isn't an instant process 
and could take a few days, so this also gives first-time contributors a way to 
check their changes against the jobs that will run as part of the required CI 
checks.

--

___
Python tracker 

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



[issue44972] Add workflow_dispatch trigger for GitHub Actions jobs

2021-08-23 Thread Brett Cannon


Brett Cannon  added the comment:

Add Lukasz to get his opinion on this idea.

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44985] Inconsistent returned value of inspect.getfullargspec(object.__init__).

2021-08-23 Thread Mehrzad


New submission from Mehrzad :

The inspection `inspect.getfullargspec(object.__init__)` shows that 
`object.__init__` takes both varargs (starred) and varkw (double-starred) 
arguments.* However, it is impossible to call `object.__init__` with varargs or 
varkw arguments.

If one tries to call `object.__init__(SomeClass(), ...)` with either of those 
arguments, the following error is raised:

`TypeError: SomeClass.__init__() takes exactly one argument (the instance to 
initialize)`.

This error is not raised if `SomeClass()` is replaced with some literal, e.g. a 
number.



* I can not certify whether it is intended behavior or a bug, because the 
signature of `obj.__init__` takes those arguments.

--
components: Distutils, Interpreter Core, Parser
files: object_init.py
messages: 400144
nosy: Mehrzad, dstufft, eric.araujo, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Inconsistent returned value of inspect.getfullargspec(object.__init__).
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file50229/object_init.py

___
Python tracker 

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



[issue44981] wildcard imports should normalise names in `__all__`

2021-08-23 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Okay, reopening the ticket with a new description.

`from module import *` should use the same NFKC normalisation on the names in 
`__all__`.

To be clear, I don't propose that `__all__` should be modified.

--
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open
title: `module has no attribute` when `__all__` includes certain unicode 
characters -> wildcard imports should normalise names in `__all__`
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.9

___
Python tracker 

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



[issue41102] ZipFile.namelist() does not match the actual files in .zip file

2021-08-23 Thread Xiaolong Liu


Xiaolong Liu  added the comment:

It seems the indents were automatically removed in the message box. I shared 
the code snippet formmated here:

https://www.online-python.com/cDojvl2CMS

--

___
Python tracker 

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



[issue44982] Add vendor information

2021-08-23 Thread Filipe Laíns

Filipe Laíns  added the comment:

> I am unsure if having two different interpreters is a good solution, and it 
> certainly requires some cooperation with distros.

That is not the goal with this!

I think both this issue and the PEP are parallel. My goal here is to streamline 
the vendor patching of CPython, not propose parallel interpreters as an 
alternative.

Having discussed with you about your motivations and approach on packaging 
Python in Debian, I would definitely not expect you to adopt multiple 
interpreters in Debian.
The way this proposal mostly functionally impacts Debian is by isolating its 
namespace from the normal one, allowing you to drop changes like the 
dist-packages renaming -- because pip install will write to 
/usr/local/lib/python3.9-debian/site-packages and /usr/local Python installs 
will be looking at /usr/local/lib/python3.9/site-packages) -- and if I am not 
missing anything, unblocking bpo-43976.

--

___
Python tracker 

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



[issue41102] ZipFile.namelist() does not match the actual files in .zip file

2021-08-23 Thread Xiaolong Liu


Xiaolong Liu  added the comment:

Serhiy: Thanks for your explanation. 

The file was created by zipfile module. I used the script hundreds of times, 
while only once (the uploaded zipped file) was abnormal. 

Since the project ended a long time ago, I cannot reproduce the error right 
now. I will post the related code snippet I used.

import zipfile
import pathlib

def fileIsValid(filename):
filename = pathlib.Path(filename)
return True if filename.is_file() and filename.stat().st_size > 0 else False

def compress2zip(sourceFile,zipFile,destinationFile):
if not fileIsValid(zipFile):
pathlib.Path(zipFile).parent.mkdir(parents=True, exist_ok=True)
with zipfile.ZipFile(zipFile,'w',compression=zipfile.ZIP_DEFLATED) as myzip:
myzip.write(sourceFile,destinationFile)
dest_size = myzip.getinfo(destinationFile).file_size
else:
with zipfile.ZipFile(zipFile,'a',compression=zipfile.ZIP_DEFLATED) as myzip:
if not destinationFile in myzip.namelist():
myzip.write(sourceFile,destinationFile)
dest_size = myzip.getinfo(destinationFile).file_size
source_size = pathlib.Path(sourceFile).stat().st_size
if source_size == dest_size:
print('Succeeded -- compress -- %s' % str(destinationFile))
return True
else:
print('Failed -- compress -- %s' %str(destinationFile))
return False

files = list(pathlib.Path('000-original').glob('*.geojson'))
zipFile = pathlib.Path('.zip')
for file in files:
comp_re = compress2zip(file, zipFile, file.name)

--

___
Python tracker 

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



[issue44984] Rewrite test_null_strings in _testcapi

2021-08-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue44984] Rewrite test_null_strings in _testcapi

2021-08-23 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

test_null_strings in Modules/_testcapimodule.c was initially added in 
7580146b5c7025976f0907a9893e01dc3d3d3457 for testing PyObject_Str(NULL) and 
PyObject_Unicode(NULL). PyObject_Unicode() was removed in 3.0, so now the test 
calls PyObject_Str(NULL) twice that does not make sense. On other hand, 
PyObject_Bytes(NULL) and PyObject_Repr(NULL) are not tested. Additionally, 
there are now problems with unittest tests returning non-None.

So this test should be completely rewritten.

--
components: Tests
messages: 400139
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Rewrite test_null_strings in _testcapi
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44982] Add vendor information

2021-08-23 Thread Matthias Klose


Matthias Klose  added the comment:

A bunch of people, consisting of Filipe Lains himself, Geoffrey Thomas, Donald 
Stufft, Tzu-Ping Chung, Pradyun Gedam, Stefano Rivera, Elana Hashman, and 
myself (Matthias Klose), and with feedback from Carol Willing and Christian 
Heimes were preparing a PEP to address issues with vendored or system Python 
versions.  It looks like Filipe was unable to give feedback or follow-up after 
the initial meetings at PyCon.

I am unsure if having two different interpreters is a good solution, and it 
certainly requires some cooperation with distros.

--
nosy: +Marcus.Smith, dstufft, ncoghlan, paul.moore, pradyunsg

___
Python tracker 

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



[issue40951] csv skipinitialspace no longer working

2021-08-23 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I cannot reproduce with 3.7.7, when run with the linked example, the output 
looks fine:

['country_id', 'country_name', 'region_id']
['AR', 'Argentina', '2']
['AU', 'Australia', '3']
['BE', 'Belgium', '1']
['BR', 'Brazil', '2']
['CA', 'Canada', '2']

I think this can be closed as not a bug unless more detail is provided.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44983] Wrong definition of a starred expression in the Language Reference

2021-08-23 Thread Takuo Matsuoka


New submission from Takuo Matsuoka :

Being unaware of the processes here, I have posted the issue to the python-idea 
mailing list. Please refer to it.

https://mail.python.org/archives/list/python-id...@python.org/message/TCWYZIIRZWIR7CDJWDAUBCAMU2CBFB3Y/

Thank you.

--
assignee: docs@python
components: Documentation
messages: 400136
nosy: Takuo Matsuoka, docs@python
priority: normal
severity: normal
status: open
title: Wrong definition of a starred expression in the Language Reference
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue44982] Add vendor information

2021-08-23 Thread Filipe Laíns

New submission from Filipe Laíns :

In the effort of making the UX better with vendored Python versions, I think it 
would make sense to track and expose vendor information.

Initially, the vendor information would be comprised of two fields, the vendor 
string (eg. `Debian`) and the vendor name (eg. `debian`).

If specified, it would change the interpreter/installation in the following 
ways:
  - The vendor string would be shown in places like the IDLE shell (eg. [1])
  - The vendor name would be added to the installation paths 
(/usr/lib/python3.9 would become /usr/lib/python3.9-debian)
- This would include scripts, so the interpreter would be called 
python3-debian, the vendors can then rename or symlink it to python3 if they 
want to have that be the default Python on the system

Additionally, I think we should add two new functions to the platform module, 
platform.vendor() and platform.vendor_name().

Overall, I think this would help out users identify the Python installation and 
avoid clashes between Python installations, even allowing parallel 
installations.
If I remember everything correctly, this should fix Matthias issues with 
bpo-43976. Matthias, could you confirm?

Any thoughts?


[1] new IDLE shell output

Debian Python 3.9.6 (default, Jun 30 2021, 10:22:16)
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

--
messages: 400135
nosy: FFY00, christian.heimes, doko, jaraco, steve.dower, willingc
priority: normal
severity: normal
status: open
title: Add vendor information
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue28474] WinError(): Python int too large to convert to C long

2021-08-23 Thread Adam Meily


Adam Meily  added the comment:

I can potentially take a stab at writing up a PR for this. I've also seen this 
affecting other locations that eventually call FormatMessage, including:

- ctypes.format_error() - this original issue
- os.strerror()
- OSError(winerror=X)

I will most likely look into fixing all three.

--
nosy: +meilyadam

___
Python tracker 

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



[issue44913] segfault in call to embedded PyModule_New

2021-08-23 Thread hai shi


hai shi  added the comment:

> Or are you saying something can be done in Python's components to
handle this use case transparently? so the user won't have to put GIL
locks in his code.

Sorry, I don't explain it good enough. You have said what I wanted to say:)

> Yes, but if the extension is loaded into a C program (i.e. not from
python then the extension (libfoo1.so) has to call Py_Initialize at
that point.

You are right. I just only saw your dload.py, so I don't know how you start the 
python prcoess in your env;).
I haven't the experience of the pam-python:(.

--

___
Python tracker 

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



[issue39232] asyncio crashes when tearing down the proactor event loop

2021-08-23 Thread Shane Mai


Shane Mai  added the comment:

I added some code to wait for all tasks completion before exit: 
currentTask = asyncio.current_task()
for t in asyncio.all_tasks():
if currentTask != t:
await t
and still got the exception


Then I think it created additional thread somewhere and created an event_loop 
inside it. To dig it out I sub-classed threading.Thread. I also wait for all 
tasks in all threads before exiting:

loops: list[asyncio.AbstractEventLoop] = []

class MyThread(threading.Thread):
def start(self):
global loops
loops.append(asyncio.get_event_loop())
super().start()

async def func1():
async with aiohttp.ClientSession() as session:
async with session.get('https://www.okex.com/api/v5/public/time') as 
resp:
print(resp.status)
print(await resp.json())

threading.Thread = MyThread
import aiohttp

async def main():
global loops
loops.append(asyncio.get_running_loop())
print(sys.argv)
task = asyncio.create_task(func1())
await task
print('done.')

currentTask = asyncio.current_task()
for loop in loops:
for t in asyncio.all_tasks(loop):
if currentTask != t:
await t

print('done2.')
#await asyncio.sleep(1)

#if __file__ == '__main__':
asyncio.run(main())


Then I found out the thread is created inside _loop.getaddrinfo: (files are 
from python 3.9.6)
File aiohttp\resolver.py, line 31, in ThreadedResolver.resolve
FILE asyncio\base_events.py, line 856, in 
BaseEventLoop(ProactorEventLoop).getaddrinfo

And it is strange that another thread is created when program exit:
FILE asyncio\base_events.py, line 563, in 
BaseEventLoop(ProactorEventLoop).shutdown_default_executor

But sad it seems vscode cannot break a __del__ call. If I break somewhere  else 
first then it would not crash:(

--
nosy: +machine.gw

___
Python tracker 

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



[issue44913] segfault in call to embedded PyModule_New

2021-08-23 Thread Madhu


Madhu  added the comment:

*  hai shi  
<1629695372.88.0.481350414879.issue44...@roundup.psfhosted.org>
Wrote on Mon, 23 Aug 2021 05:09:32 +

> hai shi  added the comment:
>> which can be wrapped within the calls to PyGILState_Ensure/Release.
> OK, it's a good idea. But I think this enhancement will break the back
> compatibility.

I don't understand.

Wherever I make a Py C call from the extension (libfoo1.so), I have to
wrap it up within calls to PyGILState_Ensure/Release to avoid
segfaults right?

That's how I understood your comment.

So this is on the user to avoid the segfaults, right?

And you saying my extension will not be backward compatible, i.e. it
will not work on older versions of python? (pam-python still supports
py27, I think)

Or are you saying something can be done in Python's components to
handle this use case transparently? so the user won't have to put GIL
locks in his code

(They aren't required in the normal extension case AFAICT)

>> python is initialized within that entrypoint
> python is initialized when you run python :)
[Yes, but if the extension is loaded into a C program (i.e. not from
python then the extension (libfoo1.so) has to call Py_Initialize at
that point.]

--

___
Python tracker 

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



[issue43075] ReDoS in urllib.request

2021-08-23 Thread Gianluca Gabrielli


Gianluca Gabrielli  added the comment:

RedHat has now assigned CVE-2021-3733 to this security bug.

--
nosy: +crazybyte

___
Python tracker 

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



[issue44981] `module has no attribute` when `__all__` includes certain unicode characters

2021-08-23 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00

___
Python tracker 

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



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

2021-08-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

We've got some buildbot failures; GH-27902 should fix them. Apologies for not 
catching this while reviewing GH-27901.

--

___
Python tracker 

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



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

2021-08-23 Thread Mark Dickinson


Change by Mark Dickinson :


--
pull_requests: +26360
pull_request: https://github.com/python/cpython/pull/27902

___
Python tracker 

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



[issue44979] pathlib: support relative path construction

2021-08-23 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I am rejecting this for the reasons explained in the Github PR:

"""This seems like an extremely specific API. Perhaps you want to propose it 
for inclusion in pytest, but I don't think it belongs in pathlib.

(also, it's not difficult to spell out `Path(__file__)`)"""

--
nosy: +pitrou
resolution:  -> rejected
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



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

2021-08-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

> If SupportsComplex and SupportsBytes are just for "has __complex__/__bytes__ 
> method", they are virtually useless.

I agree that "SupportsComplex" isn't directly useful in user-land. I think its 
main value is as a building block in things like `Union[SupportsComplex, 
SupportsFloat, SupportsIndex]`.

For me, the gain from implementing complex.__complex__ is that the test "can be 
used as a complex number" can now be expressed purely in terms of the protocols 
offered, without reference to concrete types.

--

___
Python tracker 

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



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

2021-08-23 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 24b63c695ae0a95b06379eaadace66735abac1e2 by Dong-hee Na in branch 
'main':
bpo-24234: Implement bytes.__bytes__ (GH-27901)
https://github.com/python/cpython/commit/24b63c695ae0a95b06379eaadace66735abac1e2


--

___
Python tracker 

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



[issue44019] operator.call/operator.__call__

2021-08-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

This seems like a reasonable addition to me. Victor: any thoughts?

--
nosy: +mark.dickinson, vstinner

___
Python tracker 

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



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

2021-08-23 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 6082bb5addab93755ab6e2bd2ed6021b391e10d1 by Mark Dickinson in 
branch 'main':
bpo-24234: implement complex.__complex__ (GH-27887)
https://github.com/python/cpython/commit/6082bb5addab93755ab6e2bd2ed6021b391e10d1


--

___
Python tracker 

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



  1   2   >