[issue42682] awaiting a wrapped asyncio.Task multiple times gives long, repeative tracebacks

2020-12-19 Thread lilydjwg


New submission from lilydjwg :

import asyncio

async def crash(key):
  raise Exception('crash!')

async def wait(fu):
  await fu

async def main():
  crasher = asyncio.create_task(crash(()))
  fs = [wait(crasher) for _ in range(10)]
  for fu in asyncio.as_completed(fs):
try:
  await fu
except Exception:
  import traceback
  traceback.print_exc()

if __name__ == '__main__':
  asyncio.run(main())

This code will give a very long traceback 10 times. I expect it to be short.

I'm caching the result of an async function like this:

  async def get(
self,
key: Hashable,
func: Callable[[Hashable], Coroutine[Any, Any, Any]],
  ) -> Any:
async with self.lock:
  cached = self.cache.get(key)
  if cached is None:
coro = func(key)
fu = asyncio.create_task(coro)
self.cache[key] = fu

if asyncio.isfuture(cached): # pending
  return await cached # type: ignore
elif cached is not None: # cached
  return cached
else: # not cached
  r = await fu
  self.cache[key] = r
  return r

It works fine, except that when there is an exception the traceback is very 
long.

--
components: asyncio
messages: 383364
nosy: asvetlov, lilydjwg, yselivanov
priority: normal
severity: normal
status: open
title: awaiting a wrapped asyncio.Task multiple times gives long, repeative 
tracebacks
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



[issue42672] tkinter/__init__.py raises a NameError if NoDefaultRoot()

2020-12-19 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The patch is not correct. Its first part negates the correct behavior, its 
second part does not affect behavior at all, and all this does not have any 
effect on NameError.

This issue looks like a duplication of 42630.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Variable.__init__ raises obscure AttributeError

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3d569fd6dccf9f582bafaca04d3535094cae393e by Serhiy Storchaka in 
branch 'master':
bpo-42630: Improve error reporting in Tkinter for absent default root (GH-23781)
https://github.com/python/cpython/commit/3d569fd6dccf9f582bafaca04d3535094cae393e


--

___
Python tracker 

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



[issue42624] sqlite3 package document mistake

2020-12-19 Thread LIU Qingyuan


LIU Qingyuan  added the comment:

Python 3.9.1 (default, Dec 11 2020, 14:32:07) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> conn = sqlite3.connect("test.db")
>>> conn.execute("CREATE TABLE test (id INTEGER, str TEXT);")

>>> conn.execute("CREATE TABLE test (id INTEGER, str TEXT);")
Traceback (most recent call last):
  File "", line 1, in 
sqlite3.OperationalError: table test already exists
>>> 


I think the reproduction is way too easy and has nothing special so I didn't 
include one at the very beginning. That's a simple reproduction on interactive 
console.

--

___
Python tracker 

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



[issue23522] Misleading note in Statistics module documentation

2020-12-19 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Sorry Raymond, I missed this before closing the task.

> FWIW, Allen Downey also had concerns about this wording.

I don't recognise the name, who is Allen Downey and what concerns does 
he have?

--

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +22718
pull_request: https://github.com/python/cpython/pull/23853

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 87e7a14ee3bd7dc495e51166598453114342d0bf by Serhiy Storchaka in 
branch '3.9':
[3.9] bpo-42630: Improve error reporting in Tkinter for absent default root 
(GH-23781) (GH-23853)
https://github.com/python/cpython/commit/87e7a14ee3bd7dc495e51166598453114342d0bf


--

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +22719
pull_request: https://github.com/python/cpython/pull/23854

___
Python tracker 

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



[issue42683] asyncio should handle keyboard interrupt while the event loop is running

2020-12-19 Thread Paul Moore


New submission from Paul Moore :

See the comment on Discourse here: 
https://discuss.python.org/t/feeding-data-generated-via-asyncio-into-a-synchronous-main-loop/5436/28
 (and the thread leading up to this comment).

In the thread, @njs states that if the user hits Ctrl-C while the asyncio event 
loop is running, it's possible for internal asyncio data structures to end up 
in an inconsistent state. If that's the case, then this would make 
asyncio-based code unreliable in real-world use.

I don't have a way to reproduce this - from the Discourse thread, I had assumed 
that ctrl-C was safe to use on an asyncio-based program, but was told 
otherwise, and I can't find anything definitive either way.

At a minimum, the asyncio documentation should confirm that it is 
exception-safe (specifically against Ctrl-C, but in general I'd assume that 
asyncio is safe in the face of uncaught exceptions in user-written async code).

--
components: asyncio
messages: 383370
nosy: asvetlov, paul.moore, yselivanov
priority: normal
severity: normal
status: open
title: asyncio should handle keyboard interrupt while the event loop is running
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



[issue42683] asyncio should handle keyboard interrupt while the event loop is running

2020-12-19 Thread Paul Moore


Change by Paul Moore :


--
nosy: +njs

___
Python tracker 

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



[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-12-19 Thread FX Coudert


FX Coudert  added the comment:

Hi, Homebrew developer here, we're seeing this with macOS 11.1 and I think it's 
not a python issue but an Apple's Tcl/Tk issue. The backtrace I have is:

0   libsystem_kernel.dylib  0x7fff2031f462 __pthread_kill + 10
1   libsystem_pthread.dylib 0x7fff2034d610 pthread_kill + 263
2   libsystem_c.dylib   0x7fff202a0720 abort + 120
3   Tcl 0x7fff6fe1eb55 Tcl_PanicVA + 398
4   Tcl 0x7fff6fe1ebd5 Tcl_Panic + 128
5   Tk  0x7fff6ff1ead5 TkpInit + 385
6   Tk  0x7fff6fe9e788 0x7fff6fe6d000 + 
202632
7   _tkinter.cpython-39-darwin.so   0x000102d2d701 Tcl_AppInit + 84
8   _tkinter.cpython-39-darwin.so   0x000102d289fa _tkinter_create + 975
9   org.python.python   0x0001027251bb 
cfunction_vectorcall_FASTCALL + 203
10  org.python.python   0x00010279cff3 call_function + 403
11  org.python.python   0x00010279a184 
_PyEval_EvalFrameDefault + 27452
12  org.python.python   0x00010279db3b _PyEval_EvalCode + 
1998
13  org.python.python   0x0001026f55d8 
_PyFunction_Vectorcall + 248
14  org.python.python   0x0001026f4e67 
_PyObject_FastCallDictTstate + 212
15  org.python.python   0x0001026f5891 
_PyObject_Call_Prepend + 139
16  org.python.python   0x00010273de96 slot_tp_init + 87
17  org.python.python   0x0001027376f7 type_call + 150
18  org.python.python   0x0001026f4fa3 _PyObject_MakeTpCall 
+ 266
19  org.python.python   0x00010279d027 call_function + 455
20  org.python.python   0x00010279a184 
_PyEval_EvalFrameDefault + 27452
21  org.python.python   0x00010279db3b _PyEval_EvalCode + 
1998
22  org.python.python   0x00010279356d PyEval_EvalCode + 79
23  org.python.python   0x0001027ce5b5 run_eval_code_obj + 
110
24  org.python.python   0x0001027cd9ad run_mod + 103
25  org.python.python   0x0001027cc9dc PyRun_StringFlags + 
182
26  org.python.python   0x0001027cc8e9 
PyRun_SimpleStringFlags + 69
27  org.python.python   0x0001027e3802 Py_RunMain + 425
28  org.python.python   0x0001027e40c1 pymain_main + 306
29  org.python.python   0x0001027e410f Py_BytesMain + 42

This seems confirmed by the fact that I can reproduce with Apple's own python:

$ /usr/bin/python3 
Python 3.8.2 (default, Nov  4 2020, 21:23:28) 
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> root = tkinter.Tk()
macOS 11 or later required !
zsh: abort  /usr/bin/python3

I will file a bug report with Apple.

--
nosy: +fxcoudert

___
Python tracker 

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



[issue42572] Better path handling with argparse

2020-12-19 Thread Austin Scola


Austin Scola  added the comment:

Thank you Raymond! I learned a few things by reading the proposed documentation 
updates.

--

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread Steve Dower


Steve Dower  added the comment:

> Everything succeeds, then we get an extra successful request for FlsFree then 
> it immediately returns with a fail.

That makes it sound like the CRT is uninitialising itself, so this may be a 
conflict between statically linked vcruntime140.dll and dynamically linked. 
More likely to occur with msvcp140.dll in the mix, since CPython does not 
include it.

I'm not seeing full paths for the dependent DLLs, so I have no way to know 
whether it's mixing and matching versions. CPython installs include 
vcruntime140.dll, which should be the one loaded by python.exe. However, there 
are some extension modules that statically link what is required from it, and 
that should lead to multiple FLS calls when the embedded CRT 
initialises/uninitialises its state. That will happen during DLL load, but 
normally fails with a more obvious error than what you're getting.

However, if you've got a different version msvcp140.dll, it might be managing 
to load a mismatched vcruntime140.dll. Or something that's happening during 
initialisation (which should include C++ stuff) is failing in a way that 
doesn't bubble out properly.

Looking through "C:\Program Files (x86)\Windows 
Kits\10\Source\10.0.19041.0\ucrt\internal\initialization.cpp" (on my machine at 
least, yours may be different), there's *a lot* that could fail.

If you're able to coerce a _jpype build that links to 
vcruntime140d.dll/msvcp140d.dll (the debug versions, typically specified with 
/MDd instead of /MD to the compiler - might require patching setuptools 
though), and use a CPython debug build, you may get a more informative failure. 
If not, I can try and find someone from the C++ libraries team at Microsoft to 
help out, but that's not going to happen until early January at this point of 
the year.

--

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread Steve Dower


Steve Dower  added the comment:

Looking at the winapi_thunks.cpp source file from the CRT, it may be that 
LCIDToLocaleName is failing to be loaded for some reason. That's the one that 
comes after LCMapStringEx, so if it's failing, that could abort the whole 
process.

Alternatively, LCMapStringEx might be being called immediately after loading it 
and failing, which would explain why we don't see a failed LoadLibrary entry 
(which I'd expect if we're just loading lots of entry points here). I don't see 
any calls in the CRT itself, so perhaps during initialization of something in 
the C++ runtime? Might be due to your locale settings?

More ideas than answers, I'm afraid.

--

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread William Pickard


William Pickard  added the comment:

Msvcp140.dll from what I can find is part of the VS 2015 Redstributable package.

--

___
Python tracker 

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



[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-12-19 Thread FX Coudert


FX Coudert  added the comment:

Reported to Apple as FB8945560

--

___
Python tracker 

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



[issue42672] tkinter/__init__.py raises a NameError if NoDefaultRoot()

2020-12-19 Thread Ivo Shipkaliev


Ivo Shipkaliev  added the comment:

Thank you!

--

___
Python tracker 

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



[issue42684] Improvements to documentation for PyUnicode_FS{Converter, Decoder}

2020-12-19 Thread Antony Lee


New submission from Antony Lee :

The docs for PyUnicode_FSConverter and PyUnicode_FSDecoder could be improved on 
two points:

- The functions also reject str/bytes that contain null bytes (one can easily 
verify that there's a specific check for them in the C implementations).  
Currently the docs only say that the converters use 
PyUnicode_EncodeFSDefault/PyUnicode_DecodeFSDefaultAndSize, but those don't 
check for null bytes.

- The functions only ever return 1 or 0 (indicating success or failures), which 
means that one can just use e.g. `if (!PyUnicode_FSConverter(foo, &bar)) { goto 
error; } ...` (this pattern occurs repeatedly in the CPython codebase).  In 
theory, given that the functions are only documented as being "O&"-converters, 
they could also be returning Py_CLEANUP_SUPPORTED in which case they'd need to 
be called a second time on failure to release allocated memory.

--
assignee: docs@python
components: C API, Documentation
messages: 383378
nosy: Antony.Lee, docs@python
priority: normal
severity: normal
status: open
title: Improvements to documentation for PyUnicode_FS{Converter,Decoder}

___
Python tracker 

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



[issue42122] macOS complains about how fonts are accessed

2020-12-19 Thread Christopher A. Chavez


Christopher A. Chavez  added the comment:

This was already reported to Tcl/Tk: 
https://core.tcl-lang.org/tk/info/855049e799 . They determined it was caused by 
a bug in macOS 10.15.1. There are workarounds implemented for this in Tcl/Tk 
8.6.10 and the upcoming 8.6.11 releases.

--
nosy: +chrstphrchvz

___
Python tracker 

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



[issue42655] Fix subprocess extra_groups gid conversion

2020-12-19 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

This bug would have been caught at compile time if `_Py_Gid_Converter()` used 
`gid_t *` instead of `void *`. I couldn't find any call sites where `void *` 
would be needed, so probably `_Py_Gid_Converter()` should be fixed too (in a 
separate PR/issue?). The same applies to `_Py_Uid_Converter()`.

--
nosy: +gregory.p.smith, izbyshev

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 80c445cafbdfb16c4a882e3ff6fe28b471aacdfc by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-42630: Improve error reporting in Tkinter for absent default root 
(GH-23781) (GH-23854)
https://github.com/python/cpython/commit/80c445cafbdfb16c4a882e3ff6fe28b471aacdfc


--

___
Python tracker 

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



[issue41724] SQLite returns "str" instead of "datetime.datetime" with aggregate queries.

2020-12-19 Thread Stéphane Blondon

Change by Stéphane Blondon :


--
keywords: +patch
nosy: +sblondon
nosy_count: 5.0 -> 6.0
pull_requests: +22720
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23855

___
Python tracker 

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



[issue42685] Improve placing of simple query windows.

2020-12-19 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently simple query windows in Tkinter (such as 
tkinter.simpledialog.askinteger()) are placed at position 50 pixels right and 
50 pixels below of the top left corner of the parent widget (even if it is not 
visible). If the parent is not specified, the initial position was determined 
by a windows manager before issue1538878, after issue1538878 it was placed at 
position 50 pixels right and 50 pixels below the default root widget (even if 
it is not visible).

Issue42630 restored the pre-issue1538878 behavior, but it is still has many 
quirks.

The proposed patch makes the placing algorithm similar to native Tk dialogs.

* If parent is specified and mapped, the query widget is centered at the center 
of parent. Its position and size can be corrected so that it fits in the 
virtual root window.
* Otherwise it is centered at the center of the screen.

--
components: Tkinter
messages: 383382
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve placing of simple query windows.
type: enhancement
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



[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2020-12-19 Thread Big Stone


New submission from Big Stone :

SQlite-3.35.0 of mach 2021 will have Built-In Math Functions option.

https://sqlite.org/draft/releaselog/3_35_0.html

Would it be possible to have it activated in the following versions update of 
Python ? It's pretty usefull for some basic statistics

--
messages: 383383
nosy: Big Stone
priority: normal
severity: normal
status: open
title: include built-in Math functions in SQLite to 3.35.0 of march 2021
type: enhancement

___
Python tracker 

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



[issue42685] Improve placing of simple query windows.

2020-12-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue42687] tokenize module does not recognize Barry as FLUFL

2020-12-19 Thread Erik Soma


New submission from Erik Soma :

'<>' is not recognized by the tokenize module as a single token, instead it is 
two tokens.

```
$ python -c "import tokenize; import io; import pprint; 
pprint.pprint(list(tokenize.tokenize(io.BytesIO(b'<>').readline)))"
[TokenInfo(type=62 (ENCODING), string='utf-8', start=(0, 0), end=(0, 0), 
line=''),
 TokenInfo(type=54 (OP), string='<', start=(1, 0), end=(1, 1), line='<>'),
 TokenInfo(type=54 (OP), string='>', start=(1, 1), end=(1, 2), line='<>'),
 TokenInfo(type=4 (NEWLINE), string='', start=(1, 2), end=(1, 3), line=''),
 TokenInfo(type=0 (ENDMARKER), string='', start=(2, 0), end=(2, 0), line='')]
```


I would expect:
```
[TokenInfo(type=62 (ENCODING), string='utf-8', start=(0, 0), end=(0, 0), 
line=''),
 TokenInfo(type=54 (OP), string='<>', start=(1, 0), end=(1, 2), line='<>'),
 TokenInfo(type=4 (NEWLINE), string='', start=(1, 2), end=(1, 3), line=''),
 TokenInfo(type=0 (ENDMARKER), string='', start=(2, 0), end=(2, 0), line='')]
```

This is the behavior of the CPython tokenizer which the tokenizer module tries 
"to match the working of".

--
messages: 383384
nosy: esoma
priority: normal
severity: normal
status: open
title: tokenize module does not recognize Barry as FLUFL
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



[issue42687] tokenize module does not recognize Barry as FLUFL

2020-12-19 Thread Erik Soma


Change by Erik Soma :


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

___
Python tracker 

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



[issue42681] mistake in curses documentation

2020-12-19 Thread Zackery Spytz


Zackery Spytz  added the comment:

Please explain why you believe this is a mistake.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2020-12-19 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

As far as I can tell, every one of those are already available in Python.

https://docs.python.org/3/library/math.html

--
nosy: +steven.daprano

___
Python tracker 

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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2020-12-19 Thread mattip


mattip  added the comment:

The linked PR 23708 is meant to fix the failures. Any chance you can take a 
look?

--

___
Python tracker 

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



[issue42683] asyncio should handle keyboard interrupt while the event loop is running

2020-12-19 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue40219] ttk LabeledScale: label covered by hidden element

2020-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6ad5fd14825fc6039a9684dfdc14f5d12b86e25f by Miss Islington (bot) 
in branch '3.9':
bpo-40219: Lowered ttk LabeledScale dummy (GH-21467) (GH-23788)
https://github.com/python/cpython/commit/6ad5fd14825fc6039a9684dfdc14f5d12b86e25f


--

___
Python tracker 

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



[issue40219] ttk LabeledScale: label covered by hidden element

2020-12-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread Karl Nelson


Karl Nelson  added the comment:

Eryk,

Unfortunately, this particular bug is resistant to attaching the debugger.  
Whenever the debugger is attached the bug disappears.   Fortunately the 
suggestion to use Detours by WildCard65 appears to offer a way to diagnose the 
issue.

--

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread Karl Nelson


Karl Nelson  added the comment:

I looked more at the logs to see if I can find out what to instrument next.   
The log files unfortunately don't diff well because every line contains a 
timestamp so I can't a proper alignment as well as all the real addresses.  So 
I wrote a short program to convert all the numbers into an "X".

After doing so I find there is a single difference in the process between 
loading from a py file and a pyc file.


# import _jpype
## Only if loaded from a Py file
trclnk64: 001 GetProcAddress(7ffc4c71,FlsGetValue)
X X X trclnk64: 001 GetProcAddress(,) -> X
## All
X X X trclnk64: 001 
LoadLibraryExW(C:\Users\nelson85\AppData\Local\Programs\Python\Python39\python3,0,1000)
X X X trclnk64: 001 LoadLibraryExW(,,) -> X
X X X trclnk64: ### X 
C:\Users\nelson85\AppData\Local\Programs\Python\Python39\python3.DLL 000140bc
  So here is the call that fails
X X X trclnk64: 001 
LoadLibraryExW(c:\users\nelson85\documents\devel\open\jpype\_jpype.cp39-win_amd64.pyd,0,1100)
X X X trclnk64: 001 LoadLibraryExW(api-ms-win-core-synch-l1-2-0,0,800)
X X X trclnk64: 001 LoadLibraryExW(,,) -> X
X X X trclnk64: ### X C:\WINDOWS\System32\KERNELBASE.dll 002b306b
X X X trclnk64: ntdll.dll [7ffc4c974138 X

So the problem is something that happened before the LoadLibraryExW call when 
python3.dll was accessed.  The correct path called FlsGetValue  while the 
incorrect one skipped it which lead to a failure.

Thus my conclusion is that the vehicle left the edge of the cliff just prior to 
LoadLibraryExW(_jpype) and hit the ocean when C++ runtime library was requested.

Does that point to anything we can use to solve this?

--

___
Python tracker 

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



[issue39171] Missing default root in tkinter simpledialog.py

2020-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is addressed in issue42630. Now a RuntimeError with relevant error message 
is raised when call askinteger() without explicit parent if there is no default 
root widget.

Autocreating a top-level root window is not good idea. It pops up an empty 
window with default size and title and left it open after closing the dialog 
window. If withdraw it right after creation, it would look less weird, but it 
may break the following code which calls Tk() and expects it to be set as a 
default root window.

--

___
Python tracker 

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



[issue38661] Changes to tkinter result in (unexpected) widget map call return changes wrt. 3.7

2020-12-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue19733] Setting image parameter of a button crashes with Cocoa Tk

2020-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for tracking it Ronald. Could this issue be closed now?

--
status: pending -> open

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread William Pickard


William Pickard  added the comment:

I recommend first doing a capture of these functions first, incase Windows is 
routing some through them:

LoadLibrary(Ex)(W|A)

W is the Unicode variant while A is the Ascii variant.

--

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread Steve Dower


Steve Dower  added the comment:

> I recommend first doing a capture of these functions first

I don't think that'll be necessary - the logging output ought to be enough. 
Capturing or redirecting those functions would be great if the debugger was 
working, but since that spoils it, it's not.

> Does that point to anything we can use to solve this?

It would be great to know what's calling FlsGetValue there. Obviously something 
within the CRT, since CPython doesn't use fibers anywhere. I guess it's 
probably some kind of locale settings that are only necessary when opening a 
file in text mode? But I don't know that we do that specially here.

Is there an option to capture full stack traces?

--

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread Karl Nelson


Karl Nelson  added the comment:

I will look through the list of samples in Detours to see if there is something 
that can give us better stacktrace information.   If we really need a stack 
trace I can make Detours bust by creating an intentional segfault and see if we 
can attach the debugger after the source of the problem has been triggered.  
Unfortunately as my windows programming knowledge is all from 1994 I may be 
missing something obvious.

In the meantime I am upgrading the sample with some more hooks for any other 
potential LoadLibrary variants and FlsGetValue.  Though given the 
GetProcAddress calls I think that it must be something in the chain leading up 
so the variants are likely not envolved.

The other thing I can do is look at instrumenting SetErrorMode so that I can 
give myself a marker of when we are entering and leaving the dyload code.

```

/* Don't display a message box when Python can't load a DLL */
old_mode = SetErrorMode(SEM_FAILCRITICALERRORS);

/* bpo-36085: We use LoadLibraryEx with restricted search paths
   to avoid DLL preloading attacks and enable use of the
   AddDllDirectory function. We add SEARCH_DLL_LOAD_DIR to
   ensure DLLs adjacent to the PYD are preferred. */
Py_BEGIN_ALLOW_THREADS
hDLL = LoadLibraryExW(wpathname, NULL,
  LOAD_LIBRARY_SEARCH_DEFAULT_DIRS |
  LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
Py_END_ALLOW_THREADS
#if !USE_UNICODE_WCHAR_CACHE
PyMem_Free(wpathname);
#endif /* USE_UNICODE_WCHAR_CACHE */

/* restore old error mode settings */
SetErrorMode(old_mode);
```

I will post back once I get some results.

--

___
Python tracker 

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



[issue3722] print followed by exception eats print with doctest

2020-12-19 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy -patch
versions: +Python 3.10 -Python 3.3

___
Python tracker 

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



[issue42681] mistake in curses documentation

2020-12-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42677] Support comments in argparse fromfile_prefix_chars files

2020-12-19 Thread Thomas Nabelek


Thomas Nabelek  added the comment:

While overloading convert_arg_line_to_args may work, I think that @file reading 
is kind of the odd ball out in not recognizing '#' as the beginning of a 
comment.

Besides, I'm not sure that overloading just convert_arg_line_to_args is 
sufficient. Here is what I have:


import argparse
import re


class ArgumentParserCustom(argparse.ArgumentParser):

def convert_arg_line_to_args(self, arg_line):

if re.match(r'(\s+)?#', arg_line):  # Look for any number of whitespace 
characters up to a `#` character
return ['']
else:
return [arg_line]


If I return [''], I get:
  "error: unrecognized arguments:".

If I return [None], I get:
  File 
"C:\Users\tnabelek\AppData\Local\Programs\Python\Python38-32\lib\argparse.py", 
line 1771, in parse_args
self.error(msg % ' '.join(argv))
TypeError: sequence item 0: expected str instance, NoneType found


Is there a better solution?

--

___
Python tracker 

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



[issue42677] Support comments in argparse fromfile_prefix_chars files

2020-12-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

Have you tried returning an empty list?

--

___
Python tracker 

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



[issue9694] argparse required arguments displayed under "optional arguments"

2020-12-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue9694] argparse required arguments displayed under "optional arguments"

2020-12-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


Added file: https://bugs.python.org/file49692/argparse_optional.txt

___
Python tracker 

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



[issue42677] Support comments in argparse fromfile_prefix_chars files

2020-12-19 Thread Thomas Nabelek


Thomas Nabelek  added the comment:

Oh, yes, returning [] does work. Thanks guys.

--

___
Python tracker 

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



[issue9694] argparse required arguments displayed under "optional arguments"

2020-12-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Based on the attached survey of practices, I propose a minimal edit to the help 
display.  Instead of "optional arguments:", we say "the options are as 
follows:".

The use of the word "option" is dominant is in the CLI world, followed by 
"action" and "switch".  The noun form "option" doesn't seem to cause the same 
confusion that arises in the adjective form "optional arguments" which strongly 
implies "not required".

For the documentation, I suggest adding a sentence or two in the introduction 
to explain the terminology used throughout the rest of the argparse docs.

--

___
Python tracker 

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



[issue9694] argparse required arguments displayed under "optional arguments"

2020-12-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
components: +Documentation
type: enhancement -> behavior

___
Python tracker 

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



[issue29030] argparse: choices override metavar

2020-12-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
components: +Documentation -Library (Lib)
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.5

___
Python tracker 

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



[issue26003] Issues with PyEval_InitThreads and PyGILState_Ensure

2020-12-19 Thread Irit Katriel


Irit Katriel  added the comment:

Since PyEval_InitThreads is now an empty function and to be removed, this issue 
seems out of date. A I right?

--
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

___
Python tracker 

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



[issue42677] Support comments in argparse fromfile_prefix_chars files

2020-12-19 Thread Thomas Nabelek


Thomas Nabelek  added the comment:

For anyone else, here is my implementation. I decided not to do anything to 
support comments on the same lines as arguments.


import argparse
import re

# Override argparse's convert_arg_line_to_args method to allow for comments and 
empty lines

class ArgumentParserCustom(argparse.ArgumentParser):

def convert_arg_line_to_args(self, arg_line):

if (re.match(r'^[\s]*#', arg_line) or   # Look for any number of 
whitespace characters up to a `#` character
re.match(r'^[\s]*$', arg_line)):  # Look for lines containing 
nothing or just whitespace
return []
else:
return [arg_line]

--

___
Python tracker 

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



[issue9694] argparse required arguments displayed under "optional arguments"

2020-12-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +22723
pull_request: https://github.com/python/cpython/pull/23858

___
Python tracker 

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



[issue9694] argparse required arguments displayed under "optional arguments"

2020-12-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Since any chance to the help output will likely break tests, marking this as 
3.10 only.

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



[issue42681] mistake in curses documentation

2020-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Good catch! And it is not only documentation issue now. Since color numbers and 
pair numbers use different range checks, this prevents using this function with 
pair numbers larger that COLORS (should be accepted up to COLOR_PAIRS-1).

Seems there is also other bug which prevents using pair number 0 (constant 
white on black).

--
assignee: docs@python -> serhiy.storchaka
components: +Library (Lib)
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



[issue9694] argparse required arguments displayed under "optional arguments"

2020-12-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I also like Eric'c suggestion of just using "options:" instead of "optional 
arguments".

--

___
Python tracker 

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



[issue9694] argparse required arguments displayed under "optional arguments"

2020-12-19 Thread Martin Burger


Change by Martin Burger :


--
nosy:  -mburger

___
Python tracker 

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



[issue30480] samefile and sameopenfile fail for WebDAV mapped drives

2020-12-19 Thread Steven Geerts


Steven Geerts  added the comment:

still an issue with Python 3.8 and 3.9.
A copy between 2 files on webdave mapped drives can't be done, although src and 
dst are different.

--
nosy: +steven.geerts
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



[issue42675] Document changes made in bpo-42195

2020-12-19 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 597ebc8cf604de49eabbc7b83be2debd005d7819 by kj in branch '3.9':
[3.9] bpo-42675: Document collections.abc.Callable changes (GH-23839) (#23852)
https://github.com/python/cpython/commit/597ebc8cf604de49eabbc7b83be2debd005d7819


--

___
Python tracker 

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



[issue42675] Document changes made in bpo-42195

2020-12-19 Thread Guido van Rossum


Guido van Rossum  added the comment:

Can this be closed now?

--

___
Python tracker 

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



[issue41724] SQLite returns "str" instead of "datetime.datetime" with aggregate queries.

2020-12-19 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 09a36cdfb7c22f44df45b44e5561776206bcedfb by sblondon in branch 
'master':
bpo-41724: Explain when the conversion is not possible with detect_types 
enabled (GH-23855)
https://github.com/python/cpython/commit/09a36cdfb7c22f44df45b44e5561776206bcedfb


--

___
Python tracker 

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



[issue41724] SQLite returns "str" instead of "datetime.datetime" with aggregate queries.

2020-12-19 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +22724
pull_request: https://github.com/python/cpython/pull/23862

___
Python tracker 

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



[issue41724] SQLite returns "str" instead of "datetime.datetime" with aggregate queries.

2020-12-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22725
pull_request: https://github.com/python/cpython/pull/23863

___
Python tracker 

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



[issue37717] argparse subcommand docs has non-existent parameter "action"

2020-12-19 Thread paul j3


paul j3  added the comment:

I'm closing the is as a duplicate of https://bugs.python.org/issue23487, which 
is already closed.

--
resolution:  -> duplicate
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



[issue41724] SQLite returns "str" instead of "datetime.datetime" with aggregate queries.

2020-12-19 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset a34ab8188e0352e4066da4f79ed3cc24d1b61a63 by Miss Islington (bot) 
in branch '3.9':
bpo-41724: Explain when the conversion is not possible with detect_types 
enabled (GH-23855) (GH-23862)
https://github.com/python/cpython/commit/a34ab8188e0352e4066da4f79ed3cc24d1b61a63


--

___
Python tracker 

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



[issue41724] SQLite returns "str" instead of "datetime.datetime" with aggregate queries.

2020-12-19 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 24862b02dfd1e2843727f28fa2ba05828fdfa8de by Miss Islington (bot) 
in branch '3.8':
bpo-41724: Explain when the conversion is not possible with detect_types 
enabled (GH-23855) (GH-23863)
https://github.com/python/cpython/commit/24862b02dfd1e2843727f28fa2ba05828fdfa8de


--

___
Python tracker 

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



[issue41724] SQLite returns "str" instead of "datetime.datetime" with aggregate queries.

2020-12-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks for the PR!

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



[issue29595] Expose max_queue_size in ThreadPoolExecutor

2020-12-19 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 8.0 -> 9.0
pull_requests: +22726
pull_request: https://github.com/python/cpython/pull/23864

___
Python tracker 

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



[issue29595] Expose max_queue_size in ThreadPoolExecutor

2020-12-19 Thread tianc777


Change by tianc777 <18702287...@163.com>:


--
nosy: +tianc777
nosy_count: 9.0 -> 10.0
pull_requests: +22727
pull_request: https://github.com/python/cpython/pull/23865

___
Python tracker 

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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2020-12-19 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset a44ce6c9f725d336aea51a946b42769f29fed613 by Matti Picus in branch 
'master':
bpo-42604: always set EXT_SUFFIX=${SOABI}${SHLIB_SUFFIX} when using configure 
(GH-23708)
https://github.com/python/cpython/commit/a44ce6c9f725d336aea51a946b42769f29fed613


--
nosy: +pablogsal

___
Python tracker 

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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2020-12-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22729
pull_request: https://github.com/python/cpython/pull/23867

___
Python tracker 

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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2020-12-19 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2020-12-19 Thread miss-islington


miss-islington  added the comment:


New changeset b01091a3e71e6636d2df4db45920e820cdf7df3b by Miss Islington (bot) 
in branch '3.8':
bpo-42604: always set EXT_SUFFIX=${SOABI}${SHLIB_SUFFIX} when using configure 
(GH-23708)
https://github.com/python/cpython/commit/b01091a3e71e6636d2df4db45920e820cdf7df3b


--

___
Python tracker 

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



[issue42675] Document changes made in bpo-42195

2020-12-19 Thread Ken Jin


Change by Ken Jin :


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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2020-12-19 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 4b155967b3e743cbdc31600f13f1bfcf07f7b6ce by Miss Islington (bot) 
in branch '3.9':
bpo-42604: always set EXT_SUFFIX=${SOABI}${SHLIB_SUFFIX} when using configure 
(GH-23708) (GH-23866)
https://github.com/python/cpython/commit/4b155967b3e743cbdc31600f13f1bfcf07f7b6ce


--

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread Karl Nelson


Karl Nelson  added the comment:

Gave another series of shots at the problem.  So the reason that attaching the 
debugger fixes the issue is that it calls LoadLibraryExW for a bunch libraries 
when it attaches.  

I was also able to unconditionally trigger the bug even when loading without 
the pyc.   It appears that calling "import _ssh"  will cause whatever conflict 
is happening to trigger immediately.

Other than than progress was minimal.  Attaching the debugger causes so many 
changes to the control flow that I can't get the bad path to trigger and I 
can't get the debugger to attach once you start down the path.   I tried 
creating a segfault but again I can't get the debugger to attach because 
Detours is interfering with the attachment process.

I also tried disabling some of the flags that JPype was adding to the python 
build process to see if any are related.   "/DEBUG" on the linker does not do 
anything to the problem.  The other options were '/Zi', '/EHsc', '/std:c++14'.  
 Nothing here is out of the ordinary.  

I do not see anything in the link line that shows evidence of static linkage or 
likely to cause a conflict.  The exact same line is being used with Python 3.8.

link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 
/MANIFESTUAC:NO 
/LIBPATH:C:\Users\nelson85\AppData\Local\Programs\Python\Python39\libs 
/LIBPATH:C:\Users\nelson85\AppData\Local\Programs\Python\Python39\PCbuild\amd64 
/LIBPATH:C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64 
/LIBPATH:C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.28.29333\lib\x64 /LIBPATH:C:\Program 
Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64 /LIBPATH:C:\Program Files 
(x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64 /LIBPATH:C:\Program Files 
(x86)\Windows Kits\10\lib\10.0.18362.0\um\x64 /LIBPATH:C:\Program Files 
(x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64 
/LIBPATH:C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Tools\MSVC\14.28.29333\lib\x64 /LIBPATH:C:\Program 
Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64 /LIBPATH:C:\Program Files 
(x86)\Windows Kits\10\
 lib\10.0.18362.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows 
Kits\10\lib\10.0.18362.0\um\x64 /EXPORT:PyInit__jpype 
$(OBJECTS) /OUT:build\lib.win-amd64-3.9\_jpype.cp39-win_amd64.pyd 
/IMPLIB:build\temp.win-amd64-3.9\Release\native\common\_jpype.cp39-win_amd64.lib

So I remain at a loss how to proceed forward.  Nothing has changed in JPype or 
its symbols since Python 3.8 so this is clearly taking place in Python or at 
the OS level.  Is it possible that Python shipped with bad dlls for the 3.9.0 
build?  If so then looking at the source code may be the wrong approach.   
After all depending on the order of libraries I trigger or don't trigger the 
bug.

I should note that the difference between loading successfully py and pyc seems 
to have been triggered in PC/getpathc.c  could it be the change to remove 
loading api-ms-win-core-path?


```
 static void
 join(wchar_t *buffer, const wchar_t *stuff)
 {
-if (_PathCchCombineEx_Initialized == 0) {
-HMODULE pathapi = LoadLibraryExW(L"api-ms-win-core-path-l1-1-0.dll", 
NULL,
- LOAD_LIBRARY_SEARCH_SYSTEM32);
-if (pathapi) {
-_PathCchCombineEx = (PPathCchCombineEx)GetProcAddress(pathapi, 
"PathCchCombineEx");
-}
-else {
-_PathCchCombineEx = NULL;
-}
-_PathCchCombineEx_Initialized = 1;
-}
-
-if (_PathCchCombineEx) {
-if (FAILED(_PathCchCombineEx(buffer, MAXPATHLEN+1, buffer, stuff, 0))) 
{
-Py_FatalError("buffer overflow in getpathp.c's join()");
-}
-} else {
-if (!PathCombineW(buffer, buffer, stuff)) {
-Py_FatalError("buffer overflow in getpathp.c's join()");
-}
+if (FAILED(PathCchCombineEx(buffer, MAXPATHLEN+1, buffer, stuff, 0))) {
+Py_FatalError("buffer overflow in getpathp.c's join()");
 }
 }
```

Also given JPype is really a generic C++ CPython module (with no special 
options other than /Zi /EHsc why hasn't anyone else triggered this?

--

___
Python tracker 

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



[issue42604] EXT_SUFFIX too short on FreeBSD and AIX

2020-12-19 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks for the PR, mattip!

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread Eryk Sun


Eryk Sun  added the comment:

I built JPype normally in release mode and was able to analyze the problem 
using the platform debugger (cdb or WinDbg). I think the issue is pretty 
straight forward. The static initializer for classMagic in 
"native\python\pyjp_class.cpp" is calling PyDict_New(). That's not kosher 
because the GIL isn't held during the LoadLibraryExW call. It seems to be okay 
without a cached PYC because the new_dict() call has an available dict on the 
freelist in this case. In the PYC case, new_dict() happens to instead call 
PyObject_GC_New, which fails with an access violation. I modified 
"pyjp_class.cpp" to set the static value of classMagic to NULL and moved the 
initialization to PyJPClass_new. This resolved the problem. So I think this 
issue should be closed as a third-party bug.

--

___
Python tracker 

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



[issue42688] ctypes memory error on Apple Silicon with external libffi

2020-12-19 Thread Eli Rykoff


New submission from Eli Rykoff :

Building python 3.9.1 on Apple Silicon compiled against a external 
(non-os-provided) libffi makes the following code return a MemoryError:

Test:

import ctypes

@ctypes.CFUNCTYPE(None, ctypes.c_int, ctypes.c_char_p)
def error_handler(fif, message):
pass

I have tracked this down to the following code in malloc_closure.c:

#if USING_APPLE_OS_LIBFFI && HAVE_FFI_CLOSURE_ALLOC
if (__builtin_available(macos 10.15, ios 13, watchos 6, tvos 13, *)) {
ffi_closure_free(p);
return;
}
#endif

and

#if USING_APPLE_OS_LIBFFI && HAVE_FFI_CLOSURE_ALLOC
if (__builtin_available(macos 10.15, ios 13, watchos 6, tvos 13, *)) {
return ffi_closure_alloc(size, codeloc);
}
#endif

In fact, while the __builtin_available() call should be guarded by 
USING_APPLE_OS_LIBFFI, the call to ffi_closure_alloc() should only be guarded 
by HAVE_FFI_CLOSURE_ALLOC, as this is set as the result of an independent check 
in setup.py and should be used with external libffi when supported.

The following code does work instead:

#if HAVE_FFI_CLOSURE_ALLOC
#if USING_APPLE_OS_LIBFFI
if (__builtin_available(macos 10.15, ios 13, watchos 6, tvos 13, *)) {
#endif
ffi_closure_free(p);
return;
#if USING_APPLE_OS_LIBFFI
}
#endif
#endif


#if HAVE_FFI_CLOSURE_ALLOC
#if USING_APPLE_OS_LIBFFI
if (__builtin_available(macos 10.15, ios 13, watchos 6, tvos 13, *)) {
#endif
return ffi_closure_alloc(size, codeloc);
return;
#if USING_APPLE_OS_LIBFFI
}
#endif
#endif

--
components: ctypes
messages: 383419
nosy: erykoff
priority: normal
severity: normal
status: open
title: ctypes memory error on Apple Silicon with external libffi
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



[issue42688] ctypes memory error on Apple Silicon with external libffi

2020-12-19 Thread Eli Rykoff


Change by Eli Rykoff :


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

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread Karl Nelson


Karl Nelson  added the comment:

Drat I missed that one when I was scanning for statics because I was focusing 
C++ resource rather than looking for Python resources.  I also wouldn't have 
expected this to happen on only one platform, but that was my bad.  

Is it possible to improve the error reporting for this?  This was a horrible 
error to trace down at least for a non-windows programmer.  At least a mention 
in the doc as to the symptoms so someone else can google it.

--

___
Python tracker 

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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-19 Thread Karl Nelson


Karl Nelson  added the comment:

I found it.  The change that hit JPype is https://bugs.python.org/issue33895

Thanks, Eryk Sun for figuring this out.  I would never have gotten myself.

--

___
Python tracker 

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



[issue42689] Installation

2020-12-19 Thread Rafael


New submission from Rafael :

I'm very new to python. I went to download 3.9.1 and it said "There was an 
error creating a temporary file that is needed to complete this installation." 
I was wondering how I can fix this problem so I can start learning

--
components: Windows
messages: 383422
nosy: Gimmesomo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Installation
type: crash
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



[issue42689] Installation

2020-12-19 Thread Rafael


Rafael  added the comment:

I'm very new to python. I went to download 3.9.1 and it said "There was an 
error creating a temporary file that is needed to complete this installation." 
I was wondering how I can fix this problem so I can start learning

--

___
Python tracker 

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



[issue42689] Installation

2020-12-19 Thread Rafael


Rafael  added the comment:

I'm very new to python. I went to download 3.9.1 and it said "There was an 
error creating a temporary file that is needed to complete this installation." 
I was wondering how I can fix this problem so I can start learning. Error code 
is 2502

--

___
Python tracker 

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