[issue39832] Modules with decomposable characters in module name not found on macOS

2020-03-09 Thread Norbert

Norbert  added the comment:

Yes, if the Python runtime caches file names and determines based on the cache 
whether a file exists, then it needs to normalize both the file names in the 
cache and the name of the file it’s looking for. As far as I know, both HFS and 
APFS do this themselves when asked for a file by name, but if you ask for a 
list of available files, they don’t know what you’re comparing against.

I don’t think codecs would be involved here; I’d use unicodedata.normalize with 
either NFC or NFD – doesn’t matter which one.

--

___
Python tracker 

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



Re: How does the super type present itself and do lookups?

2020-03-09 Thread Adam Preble
On Monday, March 9, 2020 at 9:31:45 PM UTC-5, Souvik Dutta wrote:
> This should be what you are looking for.
> https://python-reference.readthedocs.io/en/latest/docs/functions/super.html

I'm not trying to figure out how the super() function works, but rather the 
anatomy of the object is returns.

What I think is happening in my investigation is that some of the missing 
attributes in __dict__ are getting filled in from reserved slots, but it's just 
a theory. I'm trying to mimic the object in my own interpreter project.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39923] Command errored out with exit status 1: while jsonlib

2020-03-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Please stop creating duplicate issues. You have already reported it at 
https://bugs.python.org/issue39921. There is also a stack overflow question on 
this 
https://stackoverflow.com/questions/60610913/json-module-install-error-i-was-use-windows-10-pro-64-bit-pls-give-solutions-re

--
nosy: +xtreak

___
Python tracker 

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



[issue39923] Command errored out with exit status 1: while jsonlib

2020-03-09 Thread Mageshkumar

New submission from Mageshkumar :

hi i have detail issue of while i was install jsonlib, pls kindly provide
the solutions
*Thanks & Regards*

*M.Mageshkumar*

--
files: json error.txt
messages: 363802
nosy: magesh
priority: normal
severity: normal
status: open
title: Command errored out with exit status 1: while jsonlib
Added file: https://bugs.python.org/file48965/json error.txt

___
Python tracker 

___
C:\WINDOWS\system32>pip install jsonlib
Collecting jsonlib
  Using cached jsonlib-1.6.1.tar.gz (43 kB)
Installing collected packages: jsonlib
Running setup.py install for jsonlib ... error
ERROR: Command errored out with exit status 1:
 command: 
'c:\users\mageshkumar\appdata\local\programs\python\python38\python.exe' -u -c 
'import sys, setuptools, tokenize; sys.argv[0] = 
'"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"';
 
__file__='"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"';f=getattr(tokenize,
 '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install 
--record 
'C:\Users\Mageshkumar\AppData\Local\Temp\pip-record-7a5omup8\install-record.txt'
 --single-version-externally-managed --compile --install-headers 
'c:\users\mageshkumar\appdata\local\programs\python\python38\Include\jsonlib'
 cwd: 
C:\Users\Mageshkumar\AppData\Local\Temp\pip-install-dz8cos59\jsonlib\
Complete output (41 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
copying jsonlib.py -> build\lib.win-amd64-3.8
running build_ext
building '_jsonlib' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe 
/c /nologo /Ox /W3 /GL /DNDEBUG /MD 
-Ic:\users\mageshkumar\appdata\local\programs\python\python38\include 
-Ic:\users\mageshkumar\appdata\local\programs\python\python38\include 
"-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" 
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" 
"-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files 
(x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows 
Kits\8.1\include\winrt" /Tc_jsonlib.c 
/Fobuild\temp.win-amd64-3.8\Release\_jsonlib.obj
_jsonlib.c
_jsonlib.c(99): warning C4996: 'PyUnicode_GetSize': deprecated in 3.3

c:\users\mageshkumar\appdata\local\programs\python\python38\include\unicodeobject.h(177):
 note: see declaration of 'PyUnicode_GetSize'
_jsonlib.c(450): warning C4996: 'PyLong_FromUnicode': deprecated in 3.3

c:\users\mageshkumar\appdata\local\programs\python\python38\include\longobject.h(106):
 note: see declaration of 'PyLong_FromUnicode'
_jsonlib.c(550): warning C4018: '<': signed/unsigned mismatch
_jsonlib.c(643): warning C4020: 'PyFloat_FromString': too many actual 
parameters
_jsonlib.c(655): warning C4996: 'PyLong_FromUnicode': deprecated in 3.3

c:\users\mageshkumar\appdata\local\programs\python\python38\include\longobject.h(106):
 note: see declaration of 'PyLong_FromUnicode'
_jsonlib.c(1186): warning C4013: 'PyString_CheckExact' undefined; assuming 
extern returning int
_jsonlib.c(1188): warning C4013: 'PyString_Check' undefined; assuming 
extern returning int
_jsonlib.c(1208): warning C4013: 'PyObject_Unicode' undefined; assuming 
extern returning int
_jsonlib.c(1208): warning C4047: '=': 'PyObject *' differs in levels of 
indirection from 'int'
_jsonlib.c(1406): warning C4013: 'PyInt_CheckExact' undefined; assuming 
extern returning int
_jsonlib.c(1517): warning C4013: 'PyString_AS_STRING' undefined; assuming 
extern returning int
_jsonlib.c(1517): warning C4047: 'function': 'const char *' differs in 
levels of indirection from 'int'
_jsonlib.c(1517): warning C4024: 'ascii_constant': different types for 
formal and actual parameter 1
_jsonlib.c(1539): warning C4013: 'PyInt_Check' undefined; assuming extern 
returning int
_jsonlib.c(1931): warning C4047: '=': 'const char *' differs in levels of 
indirection from 'int'
_jsonlib.c(1970): warning C4047: 'function': 'const char *' differs in 
levels of indirection from 'int'
_jsonlib.c(1970): warning C4024: 'serializer_append_ascii': different types 
for formal and actual parameter 2
_jsonlib.c(2089): warning C4996: 'PyUnicode_Encode': deprecated in 3.3

c:\users\mageshkumar\appdata\local\programs\python\python38\include\cpython/unicodeobject.h(791):
 note: see declaration of 'PyUnicode_Encode'
_jsonlib.c(2123): warning C4996: 'PyUnicode_Encode': deprecated in 3.3


[issue39922] Remove unused args in Python/compile.c

2020-03-09 Thread Andy Lester


Change by Andy Lester :


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

___
Python tracker 

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



[issue39921] json module install error i was use windows 10 pro 64 bit, pls give solutions to rectify this issue

2020-03-09 Thread Mageshkumar


Mageshkumar  added the comment:

what i do now

*Thanks & Regards*

*M.Mageshkumar*

On Tue, Mar 10, 2020 at 8:37 AM Karthikeyan Singaravelan <
rep...@bugs.python.org> wrote:

>
> Karthikeyan Singaravelan  added the comment:
>
> The tracker is for issues related to CPython. It seems like this is a
> problem with jsonlib. I would suggest following up on their tracker or
> other forums.
>
> --
> nosy: +xtreak
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue39896] Const args and remove unused args in Python/compile.c

2020-03-09 Thread Andy Lester


Andy Lester  added the comment:

Replaced by https://bugs.python.org/issue39922

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



[issue39922] Remove unused args in Python/compile.c

2020-03-09 Thread Andy Lester


New submission from Andy Lester :

These functions have unnecessary args that can be removed:

* binop
* compiler_add_o
* compiler_next_instr
* inplace_binop

--
components: Interpreter Core
messages: 363799
nosy: petdance
priority: normal
severity: normal
status: open
title: Remove unused args in Python/compile.c

___
Python tracker 

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



[issue39921] json module install error i was use windows 10 pro 64 bit, pls give solutions to rectify this issue

2020-03-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The tracker is for issues related to CPython. It seems like this is a problem 
with jsonlib. I would suggest following up on their tracker or other forums.

--
nosy: +xtreak

___
Python tracker 

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



[issue39921] json module install error i was use windows 10 pro 64 bit, pls give solutions to rectify this issue

2020-03-09 Thread Mageshkumar


New submission from Mageshkumar :

C:\WINDOWS\system32>pip install jsonlib
Collecting jsonlib
  Using cached jsonlib-1.6.1.tar.gz (43 kB)
Installing collected packages: jsonlib
Running setup.py install for jsonlib ... error
ERROR: Command errored out with exit status 1:
 command: 
'c:\users\mageshkumar\appdata\local\programs\python\python38\python.exe' -u -c 
'import sys, setuptools, tokenize; sys.argv[0] = 
'"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"';
 
__file__='"'"'C:\\Users\\Mageshkumar\\AppData\\Local\\Temp\\pip-install-dz8cos59\\jsonlib\\setup.py'"'"';f=getattr(tokenize,
 '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install 
--record 
'C:\Users\Mageshkumar\AppData\Local\Temp\pip-record-7a5omup8\install-record.txt'
 --single-version-externally-managed --compile --install-headers 
'c:\users\mageshkumar\appdata\local\programs\python\python38\Include\jsonlib'
 cwd: 
C:\Users\Mageshkumar\AppData\Local\Temp\pip-install-dz8cos59\jsonlib\
Complete output (41 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
copying jsonlib.py -> build\lib.win-amd64-3.8
running build_ext
building '_jsonlib' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe 
/c /nologo /Ox /W3 /GL /DNDEBUG /MD 
-Ic:\users\mageshkumar\appdata\local\programs\python\python38\include 
-Ic:\users\mageshkumar\appdata\local\programs\python\python38\include 
"-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" 
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" 
"-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files 
(x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows 
Kits\8.1\include\winrt" /Tc_jsonlib.c 
/Fobuild\temp.win-amd64-3.8\Release\_jsonlib.obj
_jsonlib.c
_jsonlib.c(99): warning C4996: 'PyUnicode_GetSize': deprecated in 3.3

c:\users\mageshkumar\appdata\local\programs\python\python38\include\unicodeobject.h(177):
 note: see declaration of 'PyUnicode_GetSize'
_jsonlib.c(450): warning C4996: 'PyLong_FromUnicode': deprecated in 3.3

c:\users\mageshkumar\appdata\local\programs\python\python38\include\longobject.h(106):
 note: see declaration of 'PyLong_FromUnicode'
_jsonlib.c(550): warning C4018: '<': signed/unsigned mismatch
_jsonlib.c(643): warning C4020: 'PyFloat_FromString': too many actual 
parameters
_jsonlib.c(655): warning C4996: 'PyLong_FromUnicode': deprecated in 3.3

c:\users\mageshkumar\appdata\local\programs\python\python38\include\longobject.h(106):
 note: see declaration of 'PyLong_FromUnicode'
_jsonlib.c(1186): warning C4013: 'PyString_CheckExact' undefined; assuming 
extern returning int
_jsonlib.c(1188): warning C4013: 'PyString_Check' undefined; assuming 
extern returning int
_jsonlib.c(1208): warning C4013: 'PyObject_Unicode' undefined; assuming 
extern returning int
_jsonlib.c(1208): warning C4047: '=': 'PyObject *' differs in levels of 
indirection from 'int'
_jsonlib.c(1406): warning C4013: 'PyInt_CheckExact' undefined; assuming 
extern returning int
_jsonlib.c(1517): warning C4013: 'PyString_AS_STRING' undefined; assuming 
extern returning int
_jsonlib.c(1517): warning C4047: 'function': 'const char *' differs in 
levels of indirection from 'int'
_jsonlib.c(1517): warning C4024: 'ascii_constant': different types for 
formal and actual parameter 1
_jsonlib.c(1539): warning C4013: 'PyInt_Check' undefined; assuming extern 
returning int
_jsonlib.c(1931): warning C4047: '=': 'const char *' differs in levels of 
indirection from 'int'
_jsonlib.c(1970): warning C4047: 'function': 'const char *' differs in 
levels of indirection from 'int'
_jsonlib.c(1970): warning C4024: 'serializer_append_ascii': different types 
for formal and actual parameter 2
_jsonlib.c(2089): warning C4996: 'PyUnicode_Encode': deprecated in 3.3

c:\users\mageshkumar\appdata\local\programs\python\python38\include\cpython/unicodeobject.h(791):
 note: see declaration of 'PyUnicode_Encode'
_jsonlib.c(2123): warning C4996: 'PyUnicode_Encode': deprecated in 3.3

c:\users\mageshkumar\appdata\local\programs\python\python38\include\cpython/unicodeobject.h(791):
 note: see declaration of 'PyUnicode_Encode'
_jsonlib.c(2161): warning C4013: 'Py_InitModule3' undefined; assuming 
extern returning int
C:\Program Files (x86)\Microsoft Visual Studio 
14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL 
/MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO 
/LIBPATH:c:\users\mageshkumar\appdata\local\programs\python\python38\libs 
/LIBPATH:c:\users\mageshkumar\appdata\local\programs\python\python38\PCbuild\amd64
 

Re: How does the super type present itself and do lookups?

2020-03-09 Thread Souvik Dutta
This should be what you are looking for.
https://python-reference.readthedocs.io/en/latest/docs/functions/super.html

On Tue, 10 Mar, 2020, 5:50 am Adam Preble,  wrote:

> On Wednesday, March 4, 2020 at 11:13:20 AM UTC-6, Adam Preble wrote:
> > Stuff
>
> I'm speculating that the stuff I don't see when poking are reserved slots.
> I figured out how much of a thing that is when I was digging around for how
> classes know how to construct themselves. I managed to figure out __call__
> is like that too. So I guess it's something that doesn't readily reveal
> itself when asked but is there if you try to use it.
>
> (or something)
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Lock acquisition by the same thread - deadlock protection

2020-03-09 Thread Souvik Dutta
Sooyyy it was not meant to you

On Tue, 10 Mar, 2020, 8:00 am Souvik Dutta,  wrote:

> This should be what you need.
> https://python-reference.readthedocs.io/en/latest/docs/functions/super.html
>
> On Tue, 10 Mar, 2020, 7:02 am Yonatan Goldschmidt, <
> yon.goldschm...@gmail.com> wrote:
>
>> I recently debugged a program hang, eventually finding out it's a
>> deadlock of a single thread,
>> resulting from my usage of 2 libraries. One of them - call it library A -
>> is reentrant & runs code in
>> GC finalizers, while the other - library B - is not reentrant at all.
>> Library B held one of its `threading.Lock` locks, and during this period,
>> GC was invoked, running
>> finalizers of library A which call back into library B, now attempting to
>> take the lock again,
>> locking the thread forever.
>>
>> Considering how relatively common this scenario might be (Python, by
>> design, can preempt any user code
>> to run some other user code, due to GC finalizers), I was surprised
>> Python code is not protected
>> from this simple type of deadlock. It makes sense that while
>> `threading.RLock` allows for recursive
>> locking, `threading.Lock` will prevent it - raising an exception if you
>> attempt it.
>>
>> I might be missing something, but why isn't it the status? Why taking a
>> `threading.Lock` twice from
>> the same thread just hangs, instead of raising a friendly exception?
>> I ran a quick search in bpo but found nothing about this topic. I also
>> tried to
>> search this mailing list but couldn't find how to, so I grepped a few
>> random archives
>> but found nothing about it.
>>
>> Would be happy if anyone could shed some light on it...
>>
>> Thanks,
>> Yonatan
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Lock acquisition by the same thread - deadlock protection

2020-03-09 Thread Souvik Dutta
This should be what you need.
https://python-reference.readthedocs.io/en/latest/docs/functions/super.html

On Tue, 10 Mar, 2020, 7:02 am Yonatan Goldschmidt, <
yon.goldschm...@gmail.com> wrote:

> I recently debugged a program hang, eventually finding out it's a deadlock
> of a single thread,
> resulting from my usage of 2 libraries. One of them - call it library A -
> is reentrant & runs code in
> GC finalizers, while the other - library B - is not reentrant at all.
> Library B held one of its `threading.Lock` locks, and during this period,
> GC was invoked, running
> finalizers of library A which call back into library B, now attempting to
> take the lock again,
> locking the thread forever.
>
> Considering how relatively common this scenario might be (Python, by
> design, can preempt any user code
> to run some other user code, due to GC finalizers), I was surprised Python
> code is not protected
> from this simple type of deadlock. It makes sense that while
> `threading.RLock` allows for recursive
> locking, `threading.Lock` will prevent it - raising an exception if you
> attempt it.
>
> I might be missing something, but why isn't it the status? Why taking a
> `threading.Lock` twice from
> the same thread just hangs, instead of raising a friendly exception?
> I ran a quick search in bpo but found nothing about this topic. I also
> tried to
> search this mailing list but couldn't find how to, so I grepped a few
> random archives
> but found nothing about it.
>
> Would be happy if anyone could shed some light on it...
>
> Thanks,
> Yonatan
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Lock acquisition by the same thread - deadlock protection

2020-03-09 Thread Yonatan Goldschmidt
I recently debugged a program hang, eventually finding out it's a deadlock of a 
single thread,
resulting from my usage of 2 libraries. One of them - call it library A - is 
reentrant & runs code in
GC finalizers, while the other - library B - is not reentrant at all.
Library B held one of its `threading.Lock` locks, and during this period, GC 
was invoked, running
finalizers of library A which call back into library B, now attempting to take 
the lock again,
locking the thread forever.

Considering how relatively common this scenario might be (Python, by design, 
can preempt any user code
to run some other user code, due to GC finalizers), I was surprised Python code 
is not protected
from this simple type of deadlock. It makes sense that while `threading.RLock` 
allows for recursive
locking, `threading.Lock` will prevent it - raising an exception if you attempt 
it.

I might be missing something, but why isn't it the status? Why taking a 
`threading.Lock` twice from
the same thread just hangs, instead of raising a friendly exception?
I ran a quick search in bpo but found nothing about this topic. I also tried to
search this mailing list but couldn't find how to, so I grepped a few random 
archives
but found nothing about it.

Would be happy if anyone could shed some light on it...

Thanks,
Yonatan
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue39920] Pathlib path methods do not work with Window Dos devices

2020-03-09 Thread Charles Machalow


New submission from Charles Machalow :

I ran the following as admin in the Python interpreter (on Windows):


>>> d = pathlib.Path(r'\\.\PHYSICALDRIVE0')
>>> print(d)
\\.\PHYSICALDRIVE0\
>>> d.exists()
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python37\lib\pathlib.py", line 1318, in exists
self.stat()
  File "C:\Python37\lib\pathlib.py", line 1140, in stat
return self._accessor.stat(self)
PermissionError: [WinError 31] A device attached to the system is not 
functioning: '.\\PHYSICALDRIVE0\\'
>>> d.is_char_device()
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python37\lib\pathlib.py", line 1403, in is_char_device
return S_ISCHR(self.stat().st_mode)
  File "C:\Python37\lib\pathlib.py", line 1140, in stat
return self._accessor.stat(self)
PermissionError: [WinError 31] A device attached to the system is not 
functioning: '.\\PHYSICALDRIVE0\\'
>>> d.is_block_device()
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python37\lib\pathlib.py", line 1390, in is_block_device
return S_ISBLK(self.stat().st_mode)
  File "C:\Python37\lib\pathlib.py", line 1140, in stat
return self._accessor.stat(self)
PermissionError: [WinError 31] A device attached to the system is not 
functioning: '.\\PHYSICALDRIVE0\\'

I think that exists(), is_char_device(), and is_block_device() should be able 
to work on Windows in some form or fashion. At least without a traceback.

--
messages: 363796
nosy: Charles Machalow
priority: normal
severity: normal
status: open
title: Pathlib path methods do not work with Window Dos devices
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b4698ecfdb526e0a9f5fa6ef0f8e1d8cca500203 by Victor Stinner in 
branch 'master':
bpo-39877: Deprecate PyEval_InitThreads() (GH-18892)
https://github.com/python/cpython/commit/b4698ecfdb526e0a9f5fa6ef0f8e1d8cca500203


--

___
Python tracker 

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



Re: How does the super type present itself and do lookups?

2020-03-09 Thread Adam Preble
On Wednesday, March 4, 2020 at 11:13:20 AM UTC-6, Adam Preble wrote:
> Stuff

I'm speculating that the stuff I don't see when poking are reserved slots. I 
figured out how much of a thing that is when I was digging around for how 
classes know how to construct themselves. I managed to figure out __call__ is 
like that too. So I guess it's something that doesn't readily reveal itself 
when asked but is there if you try to use it.

(or something)
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18249
pull_request: https://github.com/python/cpython/pull/18892

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread miss-islington


miss-islington  added the comment:


New changeset f8345358bcdd276eb470778daf05d343da9f1290 by Miss Islington (bot) 
in branch '3.7':
bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871)
https://github.com/python/cpython/commit/f8345358bcdd276eb470778daf05d343da9f1290


--

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread miss-islington


miss-islington  added the comment:


New changeset cadfe52a006abb46ea0948c6ae2e006064b4a091 by Miss Islington (bot) 
in branch '3.8':
bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871)
https://github.com/python/cpython/commit/cadfe52a006abb46ea0948c6ae2e006064b4a091


--

___
Python tracker 

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



[issue37127] Handling pending calls during runtime finalization may cause problems.

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 175a704abfcb3400aaeb66d4f098d92ca7e30892 by Victor Stinner in 
branch 'master':
bpo-39877: PyGILState_Ensure() don't call PyEval_InitThreads() (GH-18891)
https://github.com/python/cpython/commit/175a704abfcb3400aaeb66d4f098d92ca7e30892


--

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

I tested (run multiple times) daemon_threads_exit.py with slow_exit.patch: no 
crash.

I also tested (run multiple times) stress.py + sleep_at_exit.patch of 
bpo-37135: no crash.

And I tested  asyncio_gc.py of bpo-19466: no crash neither.

Python finalization now looks reliable. I'm not sure if it's "more" reliable 
than previously, but at least, I cannot get a crash anymore, even after 
bpo-19466 has been fixed (clear Python thread states of daemon threads earlier).

--

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

> The problem is that Python already freed the memory of all PyThreadState 
> structures, whereas PyEval_RestoreThread(tstate) dereferences tstate to get 
> the _PyRuntimeState structure:

Funny/not funny, bpo-36818 added a similar bug with commit 
396e0a8d9dc65453cb9d53500d0a620602656cfe in June 2019: bpo-37135. I reverted 
the change to fix the issue.

Hopefully, it should now be fixed and the rationale for accessing directly 
_PyRuntime should now be better documented.

--

___
Python tracker 

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



[issue36818] Add PyInterpreterState.runtime.

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

I added PyInterpreterState.runtime in bpo-36710:

commit 01b1cc12e7c6a3d6a3d27ba7c731687d57aae92a
Author: Victor Stinner 
Date:   Wed Nov 20 02:27:56 2019 +0100

bpo-36710: Add PyInterpreterState.runtime field (GH-17270)

Add PyInterpreterState.runtime field: reference to the _PyRuntime
global variable. This field exists to not have to pass runtime in
addition to tstate to a function.  Get runtime from tstate:
tstate->interp->runtime.

Remove "_PyRuntimeState *runtime" parameter from functions already
taking a "PyThreadState *tstate" parameter.

_PyGC_Init() first parameter becomes "PyThreadState *tstate".

--

> This change introduced a regression:
> https://bugs.python.org/issue37135#msg344511

Funny/not funny, I introduced the same bug and I fixed it in bpo-39877.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue30654] signal module always overwrites SIGINT on interpreter shutdown

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-24415 as duplicate of this issue.

--

___
Python tracker 

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



[issue24415] SIGINT always reset to SIG_DFL by Py_Finalize()

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

I mark this issue as a duplicate of bpo-30654. If it's not the case, please add 
a comment/reopen the issue.

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



[issue37776] Test Py_Finalize() from a subinterpreter

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-38865.

--
nosy: +vstinner

___
Python tracker 

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



[issue39919] C extension code reliant on static flags/behavior with PY_DEBUG (Py_SAFE_DOWNCAST, method flags) could potentially leverage _Static_assert

2020-03-09 Thread Enji Cooper


New submission from Enji Cooper :

Looking at Py_SAFE_DOWNCAST, it seems that the code could (in theory) leverage 
_Static_assert on C11 capable compilers [1].

Looking at some other code APIs, like module initialization with METH_VARARGS, 
etc, there are ways to determine whether or not the values are valid at 
compile-time with C11 capable compilers, instead of figuring out the issues on 
the tail end at runtime and having to play whackamole figuring out which 
offending methods are triggering issues (see also: bpo-39884).

1. https://en.cppreference.com/w/c/language/_Static_assert

--
components: C API
messages: 363785
nosy: ngie
priority: normal
severity: normal
status: open
title: C extension code reliant on static flags/behavior with PY_DEBUG 
(Py_SAFE_DOWNCAST, method flags) could potentially leverage _Static_assert

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18248
pull_request: https://github.com/python/cpython/pull/18891

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

> At least a build will proceed, and I can look into this new, perhaps 
> unrelated issue re: socket later.
> *** WARNING: renaming "_asyncio" since importing it failed: No module named 
> '_socket'

Do you see any error when the _socket module is built? Please open a new issue 
with full logs.

--

___
Python tracker 

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



[issue39199] Improve the AST documentation

2020-03-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The first one looks on first inspection "cleaner" but then I tried to look at a 
random closed bracket/parenthesis like the ones in


value=Constant(value=Ellipsis))])])],


and trying to guess where that closes and is confusing to say the least so I 
think I would prefer the second one as is less "dense".

Additionally, I was curious and I have asked several people with different 
examples and almost everyone prefers the second one, being
the only reason someone preferred the first the fact that "fits vertically in 
the screen and you need less scrolling to read it all".

--

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset add946855ad59c8f5c698aa0891d7e44f018 by Victor Stinner in 
branch 'master':
bpo-39763: Add _bootsubprocess to build Python on AIX (GH-18872)
https://github.com/python/cpython/commit/add946855ad59c8f5c698aa0891d7e44f018


--

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

I merged more changes in bpo-39877 which made possible to finally fix this 
issue.

--
components: +Interpreter Core
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9 -Python 3.4

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-09 Thread Michael Felt


Michael Felt  added the comment:

Comes further. The build finishes, but socket and asyncio are missing...

At least a build will proceed, and I can look into this new, perhaps unrelated 
issue re: socket later.

*** WARNING: renaming "_asyncio" since importing it failed: No module named 
'_socket'

--

___
Python tracker 

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



[issue19466] Clear state of threads earlier in Python shutdown

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9ad58acbe8b90b4d0f2d2e139e38bb5aa32b7fb6 by Victor Stinner in 
branch 'master':
bpo-19466: Py_Finalize() clears daemon threads earlier (GH-18848)
https://github.com/python/cpython/commit/9ad58acbe8b90b4d0f2d2e139e38bb5aa32b7fb6


--

___
Python tracker 

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



[issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32

2020-03-09 Thread Ethan Furman


Change by Ethan Furman :


--
versions: +Python 3.7

___
Python tracker 

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



[issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32

2020-03-09 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 8e9c47a947954c997d4b725f4551d50a1d896722 by Pete Wicken in branch 
'master':
bpo-28577: Special case added to IP v4 and v6 hosts for /32 and /128 networks 
(GH-18757)
https://github.com/python/cpython/commit/8e9c47a947954c997d4b725f4551d50a1d896722


--

___
Python tracker 

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



[issue39199] Improve the AST documentation

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

As you worked much with ast.dump(), what multi-line formatting do you prefer, 
the current

Module(
body=[
If(
test=Name(id='x', ctx=Load()),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
If(
test=Name(id='y', ctx=Load()),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
Expr(
value=Constant(value=Ellipsis))])])],
type_ignores=[])

or with closing brackets on separate lines?

Module(
body=[
If(
test=Name(id='x', ctx=Load()),
body=[
Expr(
value=Constant(value=Ellipsis)
)
],
orelse=[
If(
test=Name(id='y', ctx=Load()),
body=[
Expr(
value=Constant(value=Ellipsis)
)
],
orelse=[
Expr(
value=Constant(value=Ellipsis)
)
]
)
]
)
],
type_ignores=[]
)

The latter make contain long stairs of closing brackets.

--

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9229105f19705f72e553cf066751ac47c7b7 by Victor Stinner in 
branch 'master':
bpo-39877: take_gil() checks tstate_must_exit() twice (GH-18890)
https://github.com/python/cpython/commit/9229105f19705f72e553cf066751ac47c7b7


--

___
Python tracker 

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



[issue36287] Make ast.dump() not output optional default fields

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b7e9525f9c7ef02a1d2ad8253afdeb733b0951d4 by Serhiy Storchaka in 
branch 'master':
bpo-36287: Make ast.dump() not output optional fields and attributes with 
default values. (GH-18843)
https://github.com/python/cpython/commit/b7e9525f9c7ef02a1d2ad8253afdeb733b0951d4


--

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18247
pull_request: https://github.com/python/cpython/pull/18890

___
Python tracker 

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



[issue36287] Make ast.dump() not output optional default fields

2020-03-09 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue39832] Modules with decomposable characters in module name not found on macOS

2020-03-09 Thread Brett Cannon


Brett Cannon  added the comment:

The import system makes no attempt at normalizing Unicode strings for path 
comparisons. One would have to probably update FileFinder 
(https://github.com/python/cpython/blob/master/Lib/importlib/_bootstrap_external.py#L1392)
 somehow (assuming the appropriate codec support is available to importlib 
during start-up).

--

___
Python tracker 

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



[issue39869] Improve Instance Objects tutorial documentation

2020-03-09 Thread Antoine Wecxsteen


Change by Antoine Wecxsteen :


--
keywords: +patch
nosy: +awecx
nosy_count: 2.0 -> 3.0
pull_requests: +18246
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18889

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18245
pull_request: https://github.com/python/cpython/pull/1

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 85f5a69ae1541271286bb0f0e0303aabf792dd5c by Victor Stinner in 
branch 'master':
bpo-39877: Refactor take_gil() function (GH-18885)
https://github.com/python/cpython/commit/85f5a69ae1541271286bb0f0e0303aabf792dd5c


--

___
Python tracker 

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



[issue39918] random.Random(False) weird error

2020-03-09 Thread Mark Dickinson


Mark Dickinson  added the comment:

The lines here look odd to me: 
https://github.com/python/cpython/blob/363fab83b8a0e6d924c7a7c577feec6a2812bb8c/Modules/_randommodule.c#L290-L291

args[0] = arg;
n = PyObject_Vectorcall(_randomstate_global->Long___abs__, args, 0,
 NULL);

Should that 0 in the PyObject_Vectorcall be a 1 instead?

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18243
pull_request: https://github.com/python/cpython/pull/18886

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18244
pull_request: https://github.com/python/cpython/pull/18887

___
Python tracker 

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



[issue27115] IDLE goto should use query.Query subclass

2020-03-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 363fab83b8a0e6d924c7a7c577feec6a2812bb8c by Terry Jan Reedy in 
branch 'master':
bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871)
https://github.com/python/cpython/commit/363fab83b8a0e6d924c7a7c577feec6a2812bb8c


--

___
Python tracker 

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



[issue39852] IDLE: Goto should remove selection and update the status bar

2020-03-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

https://github.com/python/devguide/issues/577

--

___
Python tracker 

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



[issue39918] random.Random(False) weird error

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +rhettinger

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18242
pull_request: https://github.com/python/cpython/pull/18885

___
Python tracker 

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



[issue39918] random.Random(False) weird error

2020-03-09 Thread Miro Hrončok

Miro Hrončok  added the comment:

Possibly related to https://bugs.python.org/issue32554 
https://github.com/python/cpython/pull/15382 Deprecate hashing arbitrary types 
in random.seed()

--
nosy: +hroncok, vstinner

___
Python tracker 

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



[issue39917] new_compiler() called 2nd time causes error

2020-03-09 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-03-09 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset e7cab7f780ac253999512ee86374fc3454342811 by Batuhan Taşkaya in 
branch 'master':
bpo-38870: Simplify sequence interleaves in ast.unparse (GH-17892)
https://github.com/python/cpython/commit/e7cab7f780ac253999512ee86374fc3454342811


--

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 111e4ee52a1739e7c7221adde2fc364ef4954af2 by Victor Stinner in 
branch 'master':
bpo-39877: Py_Initialize() pass tstate to PyEval_InitThreads() (GH-18884)
https://github.com/python/cpython/commit/111e4ee52a1739e7c7221adde2fc364ef4954af2


--

___
Python tracker 

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



[issue39918] random.Random(False) weird error

2020-03-09 Thread Jerry James


New submission from Jerry James :

Python 3.8:

>>> import random
>>> r = random.Random(False)
>>> r


Python 3.9 alpha 4:

>>> import random
>>> r = random.Random(False)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.9/random.py", line 100, in __init__
self.seed(x)
  File "/usr/lib64/python3.9/random.py", line 163, in seed
super().seed(a)
TypeError: descriptor '__abs__' of 'int' object needs an argument

This arose in the context of Fedora builds with python 3.9.  The networkx 
project reversed two arguments, resulting in False being passed to 
random.Random instead of the intended seed value.  I'm glad we noticed the 
problem with 3.9 so the intended value will now be used, but that TypeError 
message doesn't really indicate the nature of the problem.  Could you arrange 
for a better message?

--
components: Library (Lib)
messages: 363766
nosy: loganjerry
priority: normal
severity: normal
status: open
title: random.Random(False) weird error
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



[issue39917] new_compiler() called 2nd time causes error

2020-03-09 Thread Todd Levi


New submission from Todd Levi :

Action:
Run the following command in py36, py37, and py3 for package uvloop

python setup.py build_ext --inline bdist_wheel

Expected behavior:

The package is built and bundled as a wheel.

Observed behavior:

The build fails at the bdist_wheel stage with the following error:

error: don't know how to compile C/C++ code on platform 'posix' with 
'' compiler

Additional Notes:

If I split the two commands (build_ext and bdist_wheel) into separate 
invocations (e.g. python setup.py build_ext --inline && python setup.py 
bdist_wheel) then the wheel is successfully built.  It only (and always) fails 
when build_ext and bdist_wheel are on the same command line.

What "seems" to be happening is that bdist_wheel is somehow inheriting the 
existing CCompiler object that was used by build_ext and is then passing that 
back to distutils.compiler.new_compiler().  The new_compiler() function simply 
checks to see if compiler is None and, if not, uses its value as a key to the 
compiler_class dict.

The distutils/command/build_ext build_ext object initially sets self.compiler 
to None so the first invocation of new_compiler() in build_ext.run() will work 
as expected.  In build_ext.run() at around line 306 (in master), however, it 
simply does self.compiler = new_compiler(compiler=self.compiler,...) so any 
subsequent invocation of run() seems like it will fail and produce the error 
message I'm seeing.  new_compiler() is the only place I see that error message 
being emitted.

The package I'm building (uvloop) is being built with Cython but all the object 
paths I've been able to track come back to distutils.ccompiler.py.  That 
packages setup.py file doesn't seem to do anything weird that I can see (which 
doesn't mean it isn't doing something weird).  It sets the sdist and build_ext 
cmdclass entries to their own methods (that don't seem to set compiler - just 
compiler options) and also registers an extension via ext_modules.  The 
setup.py code is here: https://github.com/MagicStack/uvloop/blob/master/setup.py

Possible Fix:

Two simple possibilities come to mind.  1) In run, see if self.compiler is not 
None and alter the call to new_compiler() to use self.compiler.compiler_type.  
2) In new_compiler(), check the type of compiler and simply return if its a 
CCompiler object.

--
components: Distutils
messages: 363765
nosy: dstufft, eric.araujo, televi
priority: normal
severity: normal
status: open
title: new_compiler() called 2nd time causes error
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18241
pull_request: https://github.com/python/cpython/pull/18884

___
Python tracker 

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



[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3225b9f9739cd4bcca372d0fa939cea1ae5c6402 by Victor Stinner in 
branch 'master':
bpo-39877: Remove useless PyEval_InitThreads() calls (GH-18883)
https://github.com/python/cpython/commit/3225b9f9739cd4bcca372d0fa939cea1ae5c6402


--

___
Python tracker 

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



Re: Error while installing a python code

2020-03-09 Thread Barry Scott



> On 9 Mar 2020, at 14:18, Tim Ko  wrote:
> 
> Hello,
> 
> I am trying to install a custom Python code but ran into an error. The error 
> presumably associated with cython. I tried a different compiler since Intel 
> compiler often crashes when using cython, but couldn't get it working.
> 
> Attached is the installation error log. I have installed and updated all 
> essential packages such as numpy and scipy. Could someone please give me 
> advice to resolve this issue? Many thanks in advance.
> 
> Sincerely,
> TK

My guess is that this is code that only supports python 2.
Check with the author that python 3 is supported.

Barry



> 
> 
> ===
> $ python setup.py build_ext -b PoissonSolver/
> running build_ext
> skipping 'PoissonSolver/MV_2D_cy/matvec2D.c' Cython extension (up-to-date)
> skipping 'PoissonSolver/MV_1D_cy/matvec1D.c' Cython extension (up-to-date)
> skipping 'PoissonSolver/PS_3D_cy/ps3d.c' Cython extension (up-to-date)
> building 'matvec2D' extension
> icc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC 
> -I/home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include
>  -I/home01/r782a03/.conda/envs/hko_env/include/python3.7m -c 
> PoissonSolver/MV_2D_cy/matvec2D.c -o 
> build/temp.linux-x86_64-3.7/PoissonSolver/MV_2D_cy/matvec2D.o -ffast-math
> icc: command line warning #10006: ignoring unknown option '-ffast-math'
> In file included from 
> /home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h(1830),
> from 
> /home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h(12),
> from 
> /home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h(4),
> from PoissonSolver/MV_2D_cy/matvec2D.c(232):
> /home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h(17):
>  warning #1224: #warning directive: "Using deprecated NumPy API, disable it 
> with "  "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
>  #warning "Using deprecated NumPy API, disable it with " \
>   ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17500): error: struct "_ts" has no field 
> "exc_type"
>  *type = tstate->exc_type;
>  ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17501): error: struct "_ts" has no field 
> "exc_value"
>  *value = tstate->exc_value;
>   ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17502): error: struct "_ts" has no field 
> "exc_traceback"
>  *tb = tstate->exc_traceback;
>^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17514): error: struct "_ts" has no field 
> "exc_type"
>  tmp_type = tstate->exc_type;
> ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17515): error: struct "_ts" has no field 
> "exc_value"
>  tmp_value = tstate->exc_value;
>  ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17516): error: struct "_ts" has no field 
> "exc_traceback"
>  tmp_tb = tstate->exc_traceback;
>   ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17517): error: struct "_ts" has no field 
> "exc_type"
>  tstate->exc_type = type;
>  ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17518): error: struct "_ts" has no field 
> "exc_value"
>  tstate->exc_value = value;
>  ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17519): error: struct "_ts" has no field 
> "exc_traceback"
>  tstate->exc_traceback = tb;
>  ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17562): error: struct "_ts" has no field 
> "exc_type"
>  tmp_type = tstate->exc_type;
> ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17563): error: struct "_ts" has no field 
> "exc_value"
>  tmp_value = tstate->exc_value;
>  ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17564): error: struct "_ts" has no field 
> "exc_traceback"
>  tmp_tb = tstate->exc_traceback;
>   ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17565): error: struct "_ts" has no field 
> "exc_type"
>  tstate->exc_type = local_type;
>  ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17566): error: struct "_ts" has no field 
> "exc_value"
>  tstate->exc_value = local_value;
>  ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17567): error: struct "_ts" has no field 
> "exc_traceback"
>  tstate->exc_traceback = local_tb;
>  ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17589): error: struct "_ts" has no field 
> "exc_type"
>  tmp_type = tstate->exc_type;
> ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17590): error: struct "_ts" has no field 
> "exc_value"
>  tmp_value = tstate->exc_value;
>  ^
> 
> PoissonSolver/MV_2D_cy/matvec2D.c(17591): error: struct "_ts" has no field 
> "exc_traceback"
>  tmp_tb = 

[issue39877] Daemon thread is crashing in PyEval_RestoreThread() while the main thread is exiting the process

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18240
pull_request: https://github.com/python/cpython/pull/18883

___
Python tracker 

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



Re: Python download for windows

2020-03-09 Thread Terry Reedy

On 3/9/2020 6:16 AM, Mike Dewhirst wrote:

Python isn't an ordinary program as understood by (most) Windows users.
It needs a command-prompt in which to run interactively.


Or, one can click the lower left Windows Start icon, find and click 
'Python 3.8' (for instance) under 'P', and select either 'IDLE (Python 
3.8)', which I recommend for beginners*, or 'Python 3.8'.  Still, one 
should eventually learn to use Command-Prompt, but some schools do not 
teach it and one can work for years without it.


* On the IDLE menu, select Help and IDLE Help for the doc.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Barney Gale

Barney Gale  added the comment:

Thanks Rémi and Serhiy! Closing this ticket as the patch doesn't provide any 
sort of improvement.

--

___
Python tracker 

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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Barney Gale


Change by Barney Gale :


--
resolution:  -> not a bug
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



[issue36184] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread STINNER Victor


Change by STINNER Victor :


--
keywords:  -easy
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on 
FreeBSD -> test_gdb.test_threads() is specific to _POSIX_THREADS, fail on 
FreeBSD

___
Python tracker 

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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington


miss-islington  added the comment:


New changeset 5854d451cb35ac38bc07b95afeb077e8a35d5c7d by Miss Islington (bot) 
in branch '3.8':
bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)
https://github.com/python/cpython/commit/5854d451cb35ac38bc07b95afeb077e8a35d5c7d


--

___
Python tracker 

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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington


miss-islington  added the comment:


New changeset 1695836123609a8ae97f2cfbe180a028dcd650a3 by Miss Islington (bot) 
in branch '3.7':
bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)
https://github.com/python/cpython/commit/1695836123609a8ae97f2cfbe180a028dcd650a3


--

___
Python tracker 

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



[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset eebaa9bfc593d5a46b293c1abd929fbfbfd28199 by Serhiy Storchaka in 
branch 'master':
bpo-38249: Expand Py_UNREACHABLE() to __builtin_unreachable() in the release 
mode. (GH-16329)
https://github.com/python/cpython/commit/eebaa9bfc593d5a46b293c1abd929fbfbfd28199


--

___
Python tracker 

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



Re: Error while installing a python code

2020-03-09 Thread Dieter Maurer
Tim Ko wrote at 2020-3-9 07:18 -0700:
>I am trying to install a custom Python code but ran into an error. The error 
>presumably associated with cython. I tried a different compiler since Intel 
>compiler often crashes when using cython, but couldn't get it working.

Almost surely, the compiler is not to blame.
>Attached is the installation error log. I have installed and updated all 
>essential packages such as numpy and scipy. Could someone please give me 
>advice to resolve this issue? Many thanks in advance.
>
>Sincerely,
>TK
>
>
>===
>$ python setup.py build_ext -b PoissonSolver/
> ...
>skipping 'PoissonSolver/PS_3D_cy/ps3d.c' Cython extension (up-to-date)
>building 'matvec2D' extension
>icc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC 
>-I/home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include
> -I/home01/r782a03/.conda/envs/hko_env/include/python3.7m -c 
>PoissonSolver/MV_2D_cy/matvec2D.c -o 
>build/temp.linux-x86_64-3.7/PoissonSolver/MV_2D_cy/matvec2D.o -ffast-math
> ...
>PoissonSolver/MV_2D_cy/matvec2D.c(17500): error: struct "_ts" has no field 
>"exc_type"
>  *type = tstate->exc_type;

Errors like this often indicate some version conflict.

The "matvec2D" source obviously expects "_ts" to have a field "exc_type"
but the compiler knows nothing about it.

I know at least 2 reasons for such a situation:

 * the source expects a different (newer or older) version of a dependency

 * the available headers (for a dependency) are out of date.


I have also seen similar errors in a case, when "cython" was
not installed. In this case, the distribution came with
pre-"cythonized" C sources, inadequate for my system. Installing
"cython" solved this problem. You might face a similar
situation: while "cython" is (likely) installed, the C source might
wrongly seem up-to-date. You could try to delete it and retry.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-09 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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18239
pull_request: https://github.com/python/cpython/pull/18882

___
Python tracker 

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



[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6d0ee60740f2862a878f009671b1aaa75aeb0c2a by Victor Stinner in 
branch 'master':
bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)
https://github.com/python/cpython/commit/6d0ee60740f2862a878f009671b1aaa75aeb0c2a


--

___
Python tracker 

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



[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

2020-03-09 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



Re: Please solve this problem

2020-03-09 Thread Grant Edwards
On 2020-03-09, David Raymond  wrote:
>> It was a problem and it was solved.
>> Check the second or third e-mail in the thread.
>> 
>> Thank you.
>
> The first email was blank,
>
> The second email was from the same person and just said "Rply if solved"
>
> The third was a sarcastic reply to the blank emails with just: "Solved, 
> answer is:"
>
> The fourth was Wildman trying to helpfully let them know nothing came through.
>
> And the fifth was you saying there was both a problem and a solution.

It's always September _somewhere_.

-- 
Grant Edwards   grant.b.edwardsYow! I'm GLAD I
  at   remembered to XEROX all
  gmail.commy UNDERSHIRTS!!

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e5ccc94bbb153431698b2391df625e8d47a93276 by Serhiy Storchaka in 
branch 'master':
bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called 
with invalid base. (GH-18863)
https://github.com/python/cpython/commit/e5ccc94bbb153431698b2391df625e8d47a93276


--

___
Python tracker 

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



Re: Please solve this problem

2020-03-09 Thread Igor Korot
Hi,

On Mon, Mar 9, 2020 at 11:56 AM David Raymond  wrote:
>
> > It was a problem and it was solved.
> > Check the second or third e-mail in the thread.
> >
> > Thank you.
>
> The first email was blank,
>
> The second email was from the same person and just said "Rply if solved"
>
> The third was a sarcastic reply to the blank emails with just: "Solved, 
> answer is:"

I was talking about this one.
And just bcause I didn't put a smiley, doesn't mean it is not sarcastic either.

;-)

Thank you.

>
> The fourth was Wildman trying to helpfully let them know nothing came through.
>
> And the fifth was you saying there was both a problem and a solution.
>
> So where is either the problem or solution you speak of?
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 413f01352a8268fb62bb47bde965462d7b82a06a by Serhiy Storchaka in 
branch 'master':
bpo-39904: Move handling of one-argument call of type() from type.__new__() to 
type.__call__(). (GH-18852)
https://github.com/python/cpython/commit/413f01352a8268fb62bb47bde965462d7b82a06a


--

___
Python tracker 

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



[issue34822] Simplify AST for slices

2020-03-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm going to review the actual code next.

Regarding the omission of parentheses in various contexts, I am all for that, 
but I consider it a separate issue (as it only pertains to ast.unparse()). The 
fix in https://github.com/python/cpython/pull/17892 should go in regardless.

--

___
Python tracker 

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



[issue39915] AsyncMock doesn't work with asyncio.gather

2020-03-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +lisroach, xtreak

___
Python tracker 

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



Re: Error while installing a python code

2020-03-09 Thread Dieter Maurer
Tim Ko wrote at 2020-3-9 07:18 -0700:
>I am trying to install a custom Python code but ran into an error. The error 
>presumably associated with cython. I tried a different compiler since Intel 
>compiler often crashes when using cython, but couldn't get it working.

Almost surely, the compiler is not to blame.
>Attached is the installation error log. I have installed and updated all 
>essential packages such as numpy and scipy. Could someone please give me 
>advice to resolve this issue? Many thanks in advance.
>
>Sincerely,
>TK
>
>
>===
>$ python setup.py build_ext -b PoissonSolver/
> ...
>skipping 'PoissonSolver/PS_3D_cy/ps3d.c' Cython extension (up-to-date)
>building 'matvec2D' extension
>icc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC 
>-I/home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include
> -I/home01/r782a03/.conda/envs/hko_env/include/python3.7m -c 
>PoissonSolver/MV_2D_cy/matvec2D.c -o 
>build/temp.linux-x86_64-3.7/PoissonSolver/MV_2D_cy/matvec2D.o -ffast-math
> ...
>PoissonSolver/MV_2D_cy/matvec2D.c(17500): error: struct "_ts" has no field 
>"exc_type"
>  *type = tstate->exc_type;

Errors like this often indicate some version conflict.

The "matvec2D" source obviously expects "_ts" to have a field "exc_type"
but the compiler knows nothing about it.

I know at least 2 reasons for such a situation:

 * the source expects a different (newer or older) version of a dependency

 * the available headers (for a dependency) are out of date.


I have also seen similar errors in a case, when "cython" was
not installed. In this case, the distribution came with
pre-"cythonized" C sources, inadequate for my system. Installing
"cython" solved this problem. You might face a similar
situation: while "cython" is (likely) installed, the C source might
wrongly seem up-to-date. You could try to delete it and retry.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-03-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

If we introduce a PEG-based parser, we can do this without hacking the 
tokenizer. See https://github.com/gvanrossum/pegen/issues/229

I'd propose to aim for Python 3.10 (if the PEG parser happens).

--
nosy: +gvanrossum

___
Python tracker 

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



[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-03-09 Thread Guido van Rossum


Change by Guido van Rossum :


--
versions:  -Python 3.8

___
Python tracker 

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



[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

> AttributeError: 'str' object has no attribute 'decode'

Oops, it should now be fixed by my second commit. Please retry PR 18872.

--

___
Python tracker 

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



[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> Less reliable how?

See issue39916.

> so it looks like scandir as a small overhead when accumulating all results 
> and not using the extra info it returns.

Try with larger directories. The difference may be not so small.

$ python3 -m timeit -s 'from os import scandir' "list(scandir('/usr/include'))"
1 loops, best of 3: 176 usec per loop
$ python3 -m timeit -s 'from os import listdir' "listdir('/usr/include')"
1 loops, best of 3: 114 usec per loop

--

___
Python tracker 

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



[issue39911] "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore

2020-03-09 Thread STINNER Victor


STINNER Victor  added the comment:

Ah, "x86 Windows7 3.x" worker has the same issue: 
https://buildbot.python.org/all/#/builders/150/builds/434

--

___
Python tracker 

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



[issue39911] "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore

2020-03-09 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

Well, it only doesn't build on 3.9+ (master) due to not being supported going 
forward.  The *buildmaster* needs to be fixed to stop submitting those jobs to 
unsupported platforms.

We need to continue testing 3.7 and 3.8 on Win7 until they go EOL to ensure 
that no platform breaking changes get backported.  This same issue will come up 
again (on different builders) as Win8 becomes unsupported (3.10, I believe).

As to this builder directly, I am working on a replacement machine that will 
have the latest tooling installed which should be done before before 3.9 goes 
gold (real-life permitting, of course).

--
nosy: +jkloth

___
Python tracker 

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



[issue39916] More reliable use of scandir in Path.glob()

2020-03-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39916] More reliable use of scandir in Path.glob()

2020-03-09 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Path.glob() uses os.scandir() in the following code.

entries = list(scandir(parent_path))

It properly closes the internal file descriptor opened by scandir() if success 
because it is automatically closed closed when the iterator is exhausted. But 
if it was interrupted (by KeyboardInterrupt, MemoryError or OSError), the file 
descriptor will be closed only when the iterator be collected by the garbage 
collector. It is unreliable on implementations like PyPy and emits a 
ResourceWarning.

The proposed code uses more reliable code

with scandir(parent_path) as scandir_it:
entries = list(scandir_it)

which is used in other sites (in the shutil module). I have no idea why I did 
not write it in this form at first place.

--
components: Library (Lib)
messages: 363750
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: More reliable use of scandir in Path.glob()
type: resource usage
versions: 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



RE: Please solve this problem

2020-03-09 Thread David Raymond
> It was a problem and it was solved.
> Check the second or third e-mail in the thread.
> 
> Thank you.

The first email was blank,

The second email was from the same person and just said "Rply if solved"

The third was a sarcastic reply to the blank emails with just: "Solved, answer 
is:"

The fourth was Wildman trying to helpfully let them know nothing came through.

And the fifth was you saying there was both a problem and a solution.

So where is either the problem or solution you speak of?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-09 Thread Michael Felt


Michael Felt  added the comment:

Almost. The command is run, but not enough of the bootstrap is finished - it 
seems.

  File "/data/prj/python/git/python3-3.9/Lib/_aix_support.py", line 54, in 
_aix_bosmp64
out = out.decode("utf-8").strip().split(":")  # type: ignore
AttributeError: 'str' object has no attribute 'decode'

Just skipping the subprocess bit (which is what the original does, waiting for 
better moments) is sufficient for the bootstrap phase.

--

___
Python tracker 

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



Re: [Python-ideas] Re: Possible Addition to Python Language: Marked Sub-condition

2020-03-09 Thread David Mertz
This isn't a terrible use of the walrus operator either.

if blue_20 := (color==BLUE and count==20) or red_5 := (color==RED and
count%5==0)
rotate_the_wheel() # Common to the two sub-conditions
if blue_20: # First sub-condition
set_signal()
if red_5: # Second sub-condition
clear_signal()
proc_post_rotate() # Common to the two sub-conditions



On Sun, Mar 8, 2020 at 12:02 PM Paul Moore  wrote:

> On Sun, 8 Mar 2020 at 15:02, Shrinivas Kulkarni 
> wrote:
> >
> > Hello Everyone
> >
> > While writing python code, I frequently come across the need to do
> > certain tasks based on combined conditions.
> >
> > Much of the task for all the sub-conditions are common but some are
> > specific to one or more of these sub-conditions.
> >
> > A simplified example:
> >
> > ## Code ##
> > if (color == BLUE and count == 20) or (color == RED and count % 5 == 0):
> > rotate_the_wheel() # Common to the two sub-conditions
> > if(color == BLUE and count == 20): # First sub-condition
> > set_signal()
> > if(color == RED and count % 5 == 0): # Second sub-condition
> > clear_signal()
> > proc_post_rotate() # Common to the two sub-conditions
> >
> > I am not sure if there is a better way to do this. If not, maybe there
> > can be an extension to the language, which would allow marking a
> > sub-condition just like we mark a sub-expression in a regular
> > expression.
>
> I would have thought that simply naming the sub-conditions would be
> sufficient.
>
> blue_20 = (color == BLUE and count == 20)
> red_5 = (color == RED and count % 5 == 0)
> if blue_20 or red_5:
> rotate_the_wheel() # Common to the two sub-conditions
> if blue_20: # First sub-condition
> set_signal()
> if red_5: # Second sub-condition
> clear_signal()
> proc_post_rotate() # Common to the two sub-conditions
>
> I don't know how experienced you are with Python programming, but if
> you had framed your question as "how do I modify this code to avoid
> repeating the conditions?" you would likely have been given this
> advice on the python-list mailinglist, or other similar Python
> programming help resources.
>
> Starting with a proposed language change before you've explored the
> existing options isn't likely to be the best approach (and would
> likely have meant you could resolve your issue without needing to
> bring it to python-ideas at all).
>
> Paul
> ___
> Python-ideas mailing list -- python-id...@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-id...@python.org/message/3M2BOILT7FBGGJBFECZZKDSTHRKDANCA/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Python download for windows

2020-03-09 Thread Mike Dewhirst
HilaryPython isn't an ordinary program as understood by (most) Windows users.It 
needs a command-prompt in which to run interactively. In other words, after 
successful installation, open a command prompt (aka DOS prompt) and type 
"python". It should open, announce itself and display its characteristic prompt 
>>>Your daughter will write programs in files with names. If a file has an 
extension .py and it is double-clicked (when seen in its directory/folder in 
Windows explorer) it will be executed by Windows using the installed Python. 
You don't have to worry. That is your daughter's problem.You really should 
adjust Windows explorer so it doesn't hide file extensions. Hope this 
helpsCheersMike
 Original message From: Hilary Ilsley 
 Date: 9/3/20  20:08  (GMT+10:00) To: 
python-list@python.org Subject: Python download for windows HelloWe have been 
asked to download python so our daughter can complete her homework, only once 
we have down loaded it keeps going to "set up" and even after completing 
"modify" or "repair" it goes back to set 
up.https://www.python.org/downloads/release/python-382/ -this is what we have 
downloaded.Any advice?Hilary IlsleyBSc (Jnt Hons) MSc CBiol MSB SiLCAssociate 
(Geo-environmental Scientist)[A close up of a sign  Description automatically 
generated]Brighouse * Chesham * Glasgow * 
Hartlepool * Leamington Spa * SheffieldMarlborough House, 48 Holly Walk, 
Leamington Spa, CV32 4XPt: 01926 889955  w: 
jnpgroup.co.uk[cid:image002.jpg@01D5F540.BF6B4CD0][cid:image003.png@01D5F540.BF6B4CD0][cid:image004.png@01D5F540.BF6B4CD0][twitter]
   [cid:image006.jpg@01D5F540.BF6B4CD0] 
This message, including 
any attachments, is strictly confidential, protected by law, and is intended 
solely for the use of the individual or entity to whom it is addressed. If you 
are not the intended recipient, be advised that you have received this message 
in error, and that any use, dissemination, forwarding, printing, alteration or 
copying of this e-mail and any attachments is strictly prohibited and we will 
not be liable for any direct, special, indirect or consequential loss/damages 
arising from any action taken or omitted to be taken in reliance on it or any 
alteration of the contents of this message by you or any third party. If you 
have received this e-mail in error, please contact the sender immediately. The 
views expressed in this email are not necessarily the views of JNP Group, its 
owners or employees and makes no representation or accepts any liability for 
its accuracy or completeness unless expressly stated to the contrary.We have 
made every effort to ensure that emails and any attachments generated are free 
from viruses. However, we cannot accept any responsibility for any viruses 
which are transmitted. We recommend that you scan all attachments.Use of your 
personal information: JNP Group takes data protection very seriously and the 
privacy notice that will apply to our use of your personal information can be 
found at 
http://www.jnpgroup.co.uk/wp-content/uploads/2018/06/JNP-Group-Data-Privacy-Notice.pdf--
 https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39915] AsyncMock doesn't work with asyncio.gather

2020-03-09 Thread Mads Sejersen


New submission from Mads Sejersen :

When calling asyncio.gather the await_args_list is not correct. In the attached 
minimal example it contains only the latest call and not each of the three 
actual calls.

Expected output:
[call(0), call(1), call(2)]
[call(1), call(2), call(3)]  # or any permutation hereof

Actual output:
[call(0), call(1), call(2)]
[call(3), call(3), call(3)]

--
components: asyncio
files: fail.py
messages: 363748
nosy: Mads Sejersen, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: AsyncMock doesn't work with asyncio.gather
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48963/fail.py

___
Python tracker 

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



Re: Error while installing a python code

2020-03-09 Thread Souvik Dutta
I dont know if this will work.
But still something is better than nothing.
https://stackoverflow.com/questions/11094718/error-command-gcc-failed-with-exit-status-1-while-installing-eventlet

I am not a "spoofer" in case you get any warning.

On Mon, Mar 9, 2020, 7:54 PM Tim Ko  wrote:

> Hello,
>
> I am trying to install a custom Python code but ran into an error. The
> error presumably associated with cython. I tried a different compiler since
> Intel compiler often crashes when using cython, but couldn't get it working.
>
> Attached is the installation error log. I have installed and updated all
> essential packages such as numpy and scipy. Could someone please give me
> advice to resolve this issue? Many thanks in advance.
>
> Sincerely,
> TK
>
>
> ===
> $ python setup.py build_ext -b PoissonSolver/
> running build_ext
> skipping 'PoissonSolver/MV_2D_cy/matvec2D.c' Cython extension (up-to-date)
> skipping 'PoissonSolver/MV_1D_cy/matvec1D.c' Cython extension (up-to-date)
> skipping 'PoissonSolver/PS_3D_cy/ps3d.c' Cython extension (up-to-date)
> building 'matvec2D' extension
> icc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC
> -I/home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include
> -I/home01/r782a03/.conda/envs/hko_env/include/python3.7m -c
> PoissonSolver/MV_2D_cy/matvec2D.c -o
> build/temp.linux-x86_64-3.7/PoissonSolver/MV_2D_cy/matvec2D.o -ffast-math
> icc: command line warning #10006: ignoring unknown option '-ffast-math'
> In file included from
> /home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h(1830),
>  from
> /home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h(12),
>  from
> /home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h(4),
>  from PoissonSolver/MV_2D_cy/matvec2D.c(232):
> /home01/r782a03/.conda/envs/hko_env/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h(17):
> warning #1224: #warning directive: "Using deprecated NumPy API, disable it
> with "  "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
>   #warning "Using deprecated NumPy API, disable it with " \
>^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17500): error: struct "_ts" has no field
> "exc_type"
>   *type = tstate->exc_type;
>   ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17501): error: struct "_ts" has no field
> "exc_value"
>   *value = tstate->exc_value;
>^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17502): error: struct "_ts" has no field
> "exc_traceback"
>   *tb = tstate->exc_traceback;
> ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17514): error: struct "_ts" has no field
> "exc_type"
>   tmp_type = tstate->exc_type;
>  ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17515): error: struct "_ts" has no field
> "exc_value"
>   tmp_value = tstate->exc_value;
>   ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17516): error: struct "_ts" has no field
> "exc_traceback"
>   tmp_tb = tstate->exc_traceback;
>^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17517): error: struct "_ts" has no field
> "exc_type"
>   tstate->exc_type = type;
>   ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17518): error: struct "_ts" has no field
> "exc_value"
>   tstate->exc_value = value;
>   ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17519): error: struct "_ts" has no field
> "exc_traceback"
>   tstate->exc_traceback = tb;
>   ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17562): error: struct "_ts" has no field
> "exc_type"
>   tmp_type = tstate->exc_type;
>  ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17563): error: struct "_ts" has no field
> "exc_value"
>   tmp_value = tstate->exc_value;
>   ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17564): error: struct "_ts" has no field
> "exc_traceback"
>   tmp_tb = tstate->exc_traceback;
>^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17565): error: struct "_ts" has no field
> "exc_type"
>   tstate->exc_type = local_type;
>   ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17566): error: struct "_ts" has no field
> "exc_value"
>   tstate->exc_value = local_value;
>   ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17567): error: struct "_ts" has no field
> "exc_traceback"
>   tstate->exc_traceback = local_tb;
>   ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17589): error: struct "_ts" has no field
> "exc_type"
>   tmp_type = tstate->exc_type;
>  ^
>
> PoissonSolver/MV_2D_cy/matvec2D.c(17590): error: struct "_ts" has no field
> "exc_value"
>   tmp_value = tstate->exc_value;
>   ^
>
> 

[issue39829] __len__ called twice in the list() constructor

2020-03-09 Thread Eric Snow


Eric Snow  added the comment:

I'm not opposed. :)  I just don't want to impose on your time.

--
assignee:  -> pablogsal
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



  1   2   >