[issue39937] Suggest the usage of Element.iter() instead of iter() in whatsnew

2020-03-13 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue39937] Suggest the usage of Element.iter() instead of iter() in whatsnew

2020-03-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:


New changeset 7a5cbc72988aee668816be9d1ef44c0cb4081ff6 by Rahul Kumaresan in 
branch 'master':
bpo-39937: Improve suggestions for removal of getchildren and getiterator in 
changelog (GH-18937)
https://github.com/python/cpython/commit/7a5cbc72988aee668816be9d1ef44c0cb4081ff6


--

___
Python tracker 

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



[issue39959] (Possible) bug on multiprocessing.shared_memory

2020-03-13 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different

2020-03-13 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

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



[issue39963] Subclassing slice objects

2020-03-13 Thread Mario de OOurtzborun


New submission from Mario de OOurtzborun :

Is there any reason why slice objects aren't subclassable? I want a mutable 
slice object, but there is no way to create one that will work with lists or 
tuples. And __index__ method requires to return int. I want to prepare a git 
merge request about this issue if there is no specific reason to forbid them 
becoming a base class.

--
messages: 364143
nosy: mariode1
priority: normal
severity: normal
status: open
title: Subclassing slice objects

___
Python tracker 

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



[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2020-03-13 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +18333
pull_request: https://github.com/python/cpython/pull/18985

___
Python tracker 

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



[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2020-03-13 Thread Inada Naoki


Inada Naoki  added the comment:

I'm sorry about merging PR 18327, but I can not find enough usage example of 
the _PyUnicode_GetUTF8Buffer.

PyUnicode_AsUTF8AndSize is optimized, and utf8_cache is not so bad in most 
case.  So _PyUnicode_GetUTF8Buffer seems not worth enough.

I will revert PR 18327.

--

___
Python tracker 

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



[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2020-03-13 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +18332
pull_request: https://github.com/python/cpython/pull/18984

___
Python tracker 

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



[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2020-03-13 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset c7ad974d341d3edb6b9d2a2dcae4d3d4794ada6b by Inada Naoki in branch 
'master':
bpo-39087: Add _PyUnicode_GetUTF8Buffer() (GH-17659)
https://github.com/python/cpython/commit/c7ad974d341d3edb6b9d2a2dcae4d3d4794ada6b


--

___
Python tracker 

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



[issue39948] Python 3.8 unconditionally uses functions not available on OS X 10.4 and 10.5

2020-03-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

For current releases, which only provide 64-bit binaries, 10.9 is the lated 
supported version.  See 
https://www.python.org/downloads/release/python-377/
for example.  I believe this should be closed.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue39883] Use BSD0 license for code in docs

2020-03-13 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

What is the complication?  The Python license is already rather permissive.  
Anyway, there is a n...@mail.python.org address for trademark issues, listed on 
the site, and it might be appropriate for license legal questions also.  Or 
this might be a question for discuss.python.org.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-13 Thread Tim Peters


Tim Peters  added the comment:

Good to know, Eryk - thanks!

--

___
Python tracker 

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



[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-13 Thread Eryk Sun


Eryk Sun  added the comment:

> Sorry, but there is no documented relationship between byte 
> offsets and tell() results for text-mode files in Windows:

The I/O stack in Python 3 does not use C FILE streams, and this issue is not 
related to Windows. TextIOWrapper.tell returns a "cookie" based on the decoder 
state:

https://github.com/python/cpython/blob/3.8/Modules/_io/textio.c#L2589

--
nosy: +eryksun

___
Python tracker 

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



[issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x

2020-03-13 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

Updated FreeBSD CURRENT base, which removed libncurses. The bash port 
installation needed to be rebuilt. 

@Victor Can tests be skipped on the basis of required dependencies failing to 
load/run?

--
status: open -> pending

___
Python tracker 

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



[issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict

2020-03-13 Thread Inada Naoki


Inada Naoki  added the comment:

Would you create a pull request?

--

___
Python tracker 

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



[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-13 Thread Tim Peters


Tim Peters  added the comment:

Sorry, but there is no documented relationship between byte offsets and tell() 
results for text-mode files in Windows:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/ftell-ftelli64?view=vs-2019

--

___
Python tracker 

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



[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-13 Thread Cezary Wagner


Cezary Wagner  added the comment:

Thank you for very good explanation. It was hard to understand.

I am programming a lot (++10 years) in many language but I still learning new 
things.

--

___
Python tracker 

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



[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-13 Thread Cezary Wagner


Cezary Wagner  added the comment:

Really really strange but it works :)
"an opaque number when in text mode." -> so it is Windows C libraries.

I use it in production code too so my heart speed up when I see number but it 
works as you said.

It looks complicated/slow if I have to open file in binary mode. 
I can do it but it is ugly workaround to get position?

It looks some decide that speed is better than functionality so binary files is 
only option to get for example estimate progress in some speedometer.

I think that should some function to convert this .tell() for text files into 
real .tell().

with open('../s01_parser_eval/data/out-6976.txt') as pgn:
pgn.seek(1008915299)
t = None
while True:
if t:
pgn.seek(t)
pgn.readline()
pt = t
t = pgn.tell()
if pt:
if pt > t:
print('Strange %s!', t)
pgn.seek(t)

print(pgn.tell())

--

___
Python tracker 

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



[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-13 Thread Tim Peters


Tim Peters  added the comment:

This is very well known on Windows, and the behavior is inherited from the 
Windows C libraries.  If you need a byte count instead, then - as the docs 
already say - you need to open the file in binary mode instead.

--
nosy: +tim.peters

___
Python tracker 

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



[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-13 Thread Cezary Wagner


Cezary Wagner  added the comment:

Let's test it now.

--

___
Python tracker 

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



[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-13 Thread Eric V. Smith

Eric V. Smith  added the comment:

tell() is opaque when opening a text file: you can't interpret the output, its 
only use is for input to seek().

>From the docs 
>https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects:

"f.tell() returns an integer giving the file object’s current position in the 
file represented as number of bytes from the beginning of the file when in 
binary mode and an opaque number when in text mode."

Does the value returned from tell() not work in seek()? That would be the only 
bug here.

--
nosy: +eric.smith

___
Python tracker 

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



[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-13 Thread Cezary Wagner


Change by Cezary Wagner :


--
components: +IO, Interpreter Core, Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
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



[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

2020-03-13 Thread Cezary Wagner


Cezary Wagner  added the comment:

I do some test and bu exist in 3.8/3.7 but not in no bug in PyPy3.6/Python2.7.

--
title: Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no 
bug in PyPy2.6/Python2.7) -> Wrong file.tell() function results (Windows 
10/Python 64 3.8.2/3.7 - no bug in PyPy3.6/Python2.7)

___
Python tracker 

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



[issue39962] Wrong file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in PyPy2.6/Python2.7)

2020-03-13 Thread Cezary Wagner


Change by Cezary Wagner :


--
title: Wrong tell function results (Windows 10/Python 64 3.8.2) -> Wrong 
file.tell() function results (Windows 10/Python 64 3.8.2/3.7 - no bug in 
PyPy2.6/Python2.7)

___
Python tracker 

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



[issue39962] Wrong tell function results (Windows 10/Python 64 3.8.2)

2020-03-13 Thread Cezary Wagner


Change by Cezary Wagner :


--
title: Wrong tell function results. -> Wrong tell function results (Windows 
10/Python 64 3.8.2)

___
Python tracker 

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



[issue39962] Wrong tell function results.

2020-03-13 Thread Cezary Wagner


Cezary Wagner  added the comment:

Some good snippet for testing very short.

with open('../s01_parser_eval/data/out-6976.txt') as pgn:
pgn.seek(1008915299)
while True:
pgn.readline()
print(pgn.tell())

1008915327
1008915366
1008915387
1008915409
1008915425
1008915449
1008915471
1008915490
1008915509
1008915534
1008915559
1008915572
1008915631
1008915654
1008915678
1008915680
1008917597
1008917599
1008917631
1008917670
1008917696
1008917718
1008917734
1008917758
1008917780
1008917799
1008917818
1008917843
1008917868
1008917881
1008917942
1008917965
1008917989
1008917991
1008920549
1008920551
1008920583
1008920622
1008920643
1008920663
1008920679
1008920703
1008920725
1008920744
1008920763
1008920788
1008920813
1008920826
1008920877
1008920900
1008920924
1008920926
18446744074718477807 <- ???
1008926192
1008926220
1008926259
1008926276
1008926304
1008926320
1008926344
1008926366
1008926385
1008926404
1008926428
1008926452
1008926465
1008926521
1008926544
1008926568
1008926570
1008928371
1008928373
1008928401
1008928440
1008928460
1008928491
1008928507
1008928531
1008928553
1008928572
1008928591
1008928615
1008928640
1008928653
1008928690
1008928713
1008928737
1008928739
1008931145
1008931147
1008931175
1008931214
1008931233
1008931253
1008931269
1008931293
1008931315
1008931334
1008931353
1008931377
1008931401
1008931414
1008931463
1008931486
1008931516
1008931518
1008937220
1008937222
1008937254
1008937293
1008937315
1008937340
1008937356
1008937380
1008937402
1008937421
1008937440
1008937465
1008937490
1008937503
1008937536
1008937559
18446744074718489200 <- ???

--

___
Python tracker 

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



[issue39962] Wrong tell function results.

2020-03-13 Thread Cezary Wagner


New submission from Cezary Wagner :

I wrote code which scan very large file PGN (chess games database).

But I found that tell() function is buggy see results.

Here is some code:
with open('../s01_parser_eval/data/out-6976.txt') as pgn:

is_game_parsed = parser.parse_game(visitor=visitor)

# if processing_statistics.games % 100 == 0:
print(processing_statistics.games,
  processing_statistics.positions,
  processing_statistics.moves,
  '%.2f' % processing_statistics.get_games_to_moves(),
  '%.2f' % processing_statistics.get_positions_to_moves(),
  '%.2f' % speed if speed else speed,
  pgn.tell())
print(pgn.tell())

This code can be simplified to this:
with open('../s01_parser_eval/data/out-6976.txt') as pgn:
while True:
pgn.readline()
print(pgn.tell())



1 1 0 0.00 0.00 318.64 1008917597
1008917597
2 47 46 23.00 1.02 343.64 1008917599
1008917599
3 47 46 15.33 1.02 291.08 1008920549
1008920549
4 107 107 26.75 1.00 292.03 1008920551
1008920551
5 107 107 21.40 1.00 185.41 18446744074718477807 <- ???
18446744074718477807
6 234 235 39.17 1.00 157.63 1008926192
1008926192
7 234 235 33.57 1.00 167.75 1008928371
1008928371
8 276 278 34.75 0.99 180.48 1008928373
1008928373
9 276 278 30.89 0.99 185.30 1008931145
1008931145
10 334 336 33.60 0.99 192.58 1008931147
1008931147
11 334 336 30.55 0.99 164.90 1008937220
1008937220
12 468 472 39.33 0.99 149.00 1008937222
1008937222
13 468 472 36.31 0.99 157.58 1008938833
1008938833
14 495 502 35.86 0.99 165.96 1008938835
1008938835
15 495 502 33.47 0.99 167.89 1008941875
1008941875
16 556 567 35.44 0.98 172.10 1008941877
1008941877
17 556 567 33.35 0.98 177.84 1008943769
1008943769
18 591 604 33.56 0.98 184.09 1008943771
1008943771
19 591 604 31.79 0.98 185.38 1008946692
1008946692
20 653 666 33.30 0.98 188.68 1008946694
1008946694
21 653 666 31.71 0.98 192.90 18446744074718500485  <- ???
18446744074718500485

--
messages: 364126
nosy: Cezary.Wagner
priority: normal
severity: normal
status: open
title: Wrong tell function results.
type: crash
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



[issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different

2020-03-13 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 3.0 -> 4.0
pull_requests: +18331
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18983

___
Python tracker 

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



[issue39961] warning: this use of "defined" may not be portable (Mac OS)

2020-03-13 Thread Clem Wang


New submission from Clem Wang :

pyenv install 3.8.2
results in:

BUILD FAILED (OS X 10.15.3 using python-build 20180424)

Inspect or clean up the working tree at 
/var/folders/jy/10md97xn3mz_x_b42l1r2r8cgp/T/python-build.20200313154805.37448
Results logged to 
/var/folders/jy/10md97xn3mz_x_b42l1r2r8cgp/T/python-build.20200313154805.37448.log

Last 10 log lines:
  331 | #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT
  |  ^~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h:331:6:
 warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h:540:6:
 warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
  540 | #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT
  |  ^~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h:540:6:
 warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
cc1: some warnings being treated as errors
make: *** [Objects/floatobject.o] Error 1
make: *** Waiting for unfinished jobs


The real problem is on line 199 of
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h

/*  */
#define _PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT \
defined(SWIFT_CLASS_EXTRA) && 
(!defined(SWIFT_SDK_OVERLAY_PTHREAD_EPOCH) || (SWIFT_SDK_OVERLAY_PTHREAD_EPOCH 
< 1))


I'm not sure if this is a problem for Apple to fix or whether the Python build 
needs to be more tolerant of warnings.

--
components: macOS
messages: 364125
nosy: clem.wang, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: warning: this use of "defined" may not be portable (Mac OS)
type: compile error
versions: 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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8fb02b6e1942811c8d81041e7df3f5f1f4b1d410 by Victor Stinner in 
branch 'master':
bpo-39947: Add PyThreadState_GetInterpreter() (GH-18981)
https://github.com/python/cpython/commit/8fb02b6e1942811c8d81041e7df3f5f1f4b1d410


--

___
Python tracker 

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



[issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS)

2020-03-13 Thread szb512


Change by szb512 :


--
keywords: +patch
nosy: +sdcards
nosy_count: 9.0 -> 10.0
pull_requests: +18330
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18982

___
Python tracker 

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



[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-03-13 Thread Matthias Braun


New submission from Matthias Braun :

This is about an extension type created via `PyType_FromSpec` that overrides 
`tp_setattro` (minimal example attached). In this case cpython does not let me 
grab and use the `__setattr__` function "manually". Example:

```
>>> import demo
>>> mytype_setattr = demo.MyType.__setattr__
>>> i = demo.MyType()
>>> mytype_setattr(i, "foo", "bar")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can't apply this __setattr__ to object object
```

I suspect this is related to the loop at the beginning of typeobject.c / 
hackcheck() that skips over types with Py_TPFLAGS_HEAPOBJECT. (Though removing 
the loop breaks things like the enum module).

--
components: C API
files: demomodule.zip
messages: 364123
nosy: Matthias Braun
priority: normal
severity: normal
status: open
title: Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is 
broken (hackcheck too eager?)
versions: Python 3.7
Added file: https://bugs.python.org/file48974/demomodule.zip

___
Python tracker 

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



[issue39958] Deadlock in _PyInterpreterState_DeleteExceptMain with HEAD_LOCK(runtime)

2020-03-13 Thread Atle Solbakken


Atle Solbakken  added the comment:

By "manually" clearing/deleting any interpreter states from non-main thread 
states prior to running (PyOS_AfterForkChild()), the deadlock does not occur.

// With tstate_orig being a PyThreadState which is not main:
PyInterpreterState *istate = tstate_orig->interp; 
PyInterpreterState_Clear(istate);
PyInterpreterState_Delete(istate);

// Then run PyOS_AfterFork_Child();

--

___
Python tracker 

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



[issue39959] (Possible) bug on multiprocessing.shared_memory

2020-03-13 Thread Diogo Flores


New submission from Diogo Flores :

Hello,

I came across with what seems like a bug (or at least a disagreement with the 
current documentation).

Discussion:

I expected that after creating a numpy-array (on terminal 1), which is backed 
by shared memory, I would be able to use it in other terminals until I would 
call `shm.unlink()` (on terminal 1), at which point, the memory block would be 
released and no longer accessible.

What happened is that after accessing the numpy-array from terminal 2, I called 
'close()' on the local 'existing_shm' instance and exited the interpreter, 
which displayed the `warning` seen below. 

After, I tried to access the same shared memory block from terminal 3, and a 
FileNotFoundError was raised. (The same error was also raised when I tried to 
call 'shm.unlink()' on terminal 1, after calling 'close()' on terminal 2.)

It seems that calling `close()` on an instance, destroys further access to the 
shared memory block from any point, while what I expected was to be able to 
access the array (i.e. on terminal 2), modify it, "close" my access to it, and 
after be able to access the modified array on i.e. terminal 3.

If the error is on my side I apologize for raising this issue and I would 
appreciate for clarification on what I am doing wrong.

Thank you.
Diogo


Please check below for the commands issued:

## Terminal 1

>>> from multiprocessing import shared_memory
>>> import numpy as np
>>> 
>>> a = np.array([x for x in range(10)])
>>> shm = shared_memory.SharedMemory(create=True, size=a.nbytes)
>>> b = np.ndarray(a.shape, dtype=a.dtype, buffer=shm.buf)
>>> b[:] = a[:]
>>> 
>>> shm.name
'psm_592ec635'


## Terminal 2

>>> from multiprocessing import shared_memory
>>> import numpy as np
>>> 
>>> existing_shm = shared_memory.SharedMemory('psm_592ec635')
>>> c = np.ndarray((10,), dtype=np.int64, buffer=existing_shm.buf)
>>> 
>>> c
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> 
>>> del c
>>> existing_shm.close()
>>> 
>>> exit()
~: /usr/lib/python3.8/multiprocessing/resource_tracker.py:203: UserWarning: 
resource_tracker: There appear to be 1 leaked shared_memory objects to clean up 
at shutdown
  warnings.warn('resource_tracker: There appear to be %d '


## Finally, on terminal 3

>>> from multiprocessing import shared_memory
>>> import numpy as np
>>> 
>>> existing_shm = shared_memory.SharedMemory('psm_592ec635')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/multiprocessing/shared_memory.py", line 100, in 
__init__
self._fd = _posixshmem.shm_open(
FileNotFoundError: [Errno 2] No such file or directory: '/psm_592ec635'

--
components: Library (Lib)
messages: 364121
nosy: dxflores
priority: normal
severity: normal
status: open
title: (Possible) bug on multiprocessing.shared_memory
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



[issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict

2020-03-13 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue39958] Deadlock in _PyInterpreterState_DeleteExceptMain with HEAD_LOCK(runtime)

2020-03-13 Thread Atle Solbakken


New submission from Atle Solbakken :

In _PyInterpreterState_DeleteExceptMain() aqcuires lock with 
HEAD_LOCK(runtime). With the lock still held and if a interpreter state is to 
be cleared, _PyInterpreterState_Clear() is called. HEAD_LOCK(runtime) is then 
called again (from within Clear()), causing deadlock.

Backtrace is from 3.8.2-1. Looks like this is also present in Python-3.8.2rc2 
and Python-3.9.0a4.

#0  futex_abstimed_wait_cancelable (private=0, abstime=0x0, clockid=0, 
expected=0, futex_word=0x55619cc0) at 
../sysdeps/unix/sysv/linux/futex-internal.h:208
#1  do_futex_wait (sem=sem@entry=0x55619cc0, abstime=0x0, clockid=0) at 
sem_waitcommon.c:112
#2  0x77f08488 in __new_sem_wait_slow (sem=sem@entry=0x55619cc0, 
abstime=0x0, clockid=0) at sem_waitcommon.c:184
#3  0x77f08501 in __new_sem_wait (sem=sem@entry=0x55619cc0) at 
sem_wait.c:42
#4  0x76ee6cf3 in PyThread_acquire_lock_timed (lock=0x55619cc0, 
microseconds=, intr_flag=0) at ../Python/thread_pthread.h:471
#5  0x76ef6789 in _PyInterpreterState_Clear (interp=0x55630310, 
runtime=, runtime=) at ../Python/pystate.c:261
#6  0x76ef8018 in _PyInterpreterState_DeleteExceptMain 
(runtime=0x77297a80 <_PyRuntime>) at ../Python/pystate.c:380
#7  0x76e49912 in PyOS_AfterFork_Child () at 
../Modules/posixmodule.c:472
#8  0x77f9681c in __fork_main_tstate_callback (arg=) at 
python3.c:626
#9  0x77f989d1 in rrr_py_with_global_tstate_do (callback=0x77f96800 
<__fork_main_tstate_callback>, arg=0x0) at python3.c:1222
#10 0x77f8b563 in rrr_socket_with_lock_do 
(callback=callback@entry=0x77f98a00 <__fork_callback>, arg=arg@entry=0x0) 
at rrr_socket.c:169
#11 0x77f96d07 in __rrr_py_fork_intermediate 
(function=function@entry=0x7632a700, 
fork_data=fork_data@entry=0x55639e40, 
child_method=child_method@entry=0x77f965f0 
<__rrr_py_start_persistent_thread_rw_child>) at python3.c:653
#12 0x77f97075 in __rrr_py_start_persistent_rw_thread_intermediate 
(function=function@entry=0x7632a700, fork=fork@entry=0x55639e40) at 
python3.c:749
#13 0x77f972bd in __rrr_py_start_thread (result_fork=0x555d2dd8, 
rrr_objects=0x555d2de8, module_name=0x556a70e0 "testing", 
function_name=0x555fb6d0 "process", start_method=0x77f97040 
<__rrr_py_start_persistent_rw_thread_intermediate>) at python3.c:855
#14 0x765dc3a0 in ?? ()
#15 0x in ?? ()

--
components: C API
messages: 364120
nosy: Atle Solbakken
priority: normal
severity: normal
status: open
title: Deadlock in _PyInterpreterState_DeleteExceptMain with HEAD_LOCK(runtime)
type: crash
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



[issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict

2020-03-13 Thread Jens Reidel


Jens Reidel  added the comment:

Just to show the types are inequal:

Without patch file:

>>> inspect.signature(lambda x: None).parameters
mappingproxy({'x': })

With patch file:

>>> inspect.signature(lambda x: None).parameters
mappingproxy(OrderedDict([('x', )]))

--

___
Python tracker 

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



[issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict

2020-03-13 Thread Jens Reidel


Change by Jens Reidel :


--
title: bpo39775 not fixed - inspect.Signature.parameters still 
dict/mappingproxy -> bpo39775 not fixed - inspect.Signature.parameters still 
dict/mappingproxy around dict

___
Python tracker 

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



[issue39957] bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy

2020-03-13 Thread Jens Reidel


New submission from Jens Reidel :

Hi guys,

compiling CPython from the master branch will result in a git history with the 
commit 
https://github.com/python/cpython/commit/211055176157545ce98e6c02b09d624719e6dd30
 included and in Lib/inspect.py, however the return type is still like before 
and behaviour has not changed.

Python 3.9.0a4+ (heads/master:be79373a78, Mar 11 2020, 16:36:27) 
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> inspect.signature(lambda x, y: None).parameters == 
inspect.signature(lambda y, x: None).parameters
True
>>> 

I have been able to confirm this on all builds I've done. To get it to do 
expected behaviour and return False on above code, I need to patch back the 
commit that changed OrderedDict to dict 
(https://raw.githubusercontent.com/Gelbpunkt/python-image/master/inspect.patch 
is the file I am using to patch). I have compiled against the codebase of 
https://github.com/python/cpython/commit/be79373a78c0d75fc715ab64253c9b757987a848
 and believe this is some issue with the Lib/inspect.py code internally if the 
patch file can fix it.

--
components: Library (Lib)
messages: 364118
nosy: gelbpunkt
priority: normal
severity: normal
status: open
title: bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy
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



[issue39956] Numeric Literals vs string "1_1" on input int() or float() or literal_eval

2020-03-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

You can validate the input before using it.

if '_' in s: raise ValueError

or

if not re.fullmatch('[0-9]+', s): raise ValueError

Do you want to accept "۱۲۳۴" or "   12   "? If not then validate the 
input before using int().

Also, do not use ast.literal_eval() with untrusted input without validation. It 
is not a "safe eval" and may even crash the interpreter.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2020-03-13 Thread Steve Dower


Steve Dower  added the comment:

I think PyUnicode_DecodeMBCS(name, strlen(name), "surrogatepass") captures the 
intention better, and is less likely to break in the future (apart from all the 
ways it's currently broken :) )

You should be right about the workaround too.

--

___
Python tracker 

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



[issue39956] Numeric Literals vs string "1_1" on input int() or float() or literal_eval

2020-03-13 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I prefer what we have now.  The language is consistent across script input, 
int(), and literal_eval().  

In my courses, I haven't encountered any issues with Python allowing "1_1".  
The actual problem my learners encounter is the need to strip commas from input.

--
nosy: +rhettinger

___
Python tracker 

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



[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

sock_decode_hostname() of socketmodule.c currently uses 
PyUnicode_DecodeFSDefault() on Windows. PyUnicode_DecodeFSDefault() uses UTF-8 
by default (PEP 529).

I understand that the ANSI code page should be used instead of UTF-8.

Would it work to use PyUnicode_DecodeLocale(name, "surrogatepass")? It's 
implemented with mbstowcs(), but I don't recall which encoding it uses on 
Windows.

Or can we use PyUnicode_DecodeMBCS(name, strlen(name), "surrogatepass")?

--

I understand that setting PYTHONLEGACYWINDOWSFSENCODING environment variable to 
1 should work around the issue.

--

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset be79373a78c0d75fc715ab64253c9b757987a848 by Victor Stinner in 
branch 'master':
bpo-39947: Add PyInterpreterState_Get() function (GH-18979)
https://github.com/python/cpython/commit/be79373a78c0d75fc715ab64253c9b757987a848


--

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18329
pull_request: https://github.com/python/cpython/pull/18981

___
Python tracker 

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



[issue39956] Numeric Literals vs string "1_1" on input int() or float() or literal_eval

2020-03-13 Thread zd nex


New submission from zd nex :

So currently if python code contains 1_1 it is handled as number 11. When user 
uses int("1_1") it also creates 11 and when ast.literal_eval is used it is also 
created instead of string. How can user get SyntaxError input on int or 
literal_eval with obviously wrong input (some keyboards have . next to _) like 
int(input()) in REPL? In python2.7 this was checked, but now even string is 
handled as number. Is there some reason? 

I understand reasoning behind PEP515, that int(1_1) can create 11, but why 
int("1_1") creates it also? Previously users used literal_eval for safe check 
of values, but now user can put 1_1 and it is transferred as number. Is there 
some plan to be able control behavior of these functions? I was now with some 
students, which used python2.7 and they find it also confusing. Most funny 
thing is that when they do same thing in JavaScript parseInt("1_1") they get 1, 
in old python this was error and now we give them 11. 

I would suggest that it would be possible to strictly check strings, as it was 
in old Python2.7. This way user would be able to use _ in code to arrange 
numbers, but it would also allow checks on wrong inputs of users which were 
meant something else, for example if you use it in try/except in console.

--
messages: 364112
nosy: zd nex
priority: normal
severity: normal
status: open
title: Numeric Literals vs string "1_1" on input int() or float() or 
literal_eval
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ff4584caca04cb3da0dbd5b1e9bf67e40adf5312 by Victor Stinner in 
branch 'master':
bpo-39947: Use _PyInterpreterState_GET_UNSAFE() (GH-18978)
https://github.com/python/cpython/commit/ff4584caca04cb3da0dbd5b1e9bf67e40adf5312


--

___
Python tracker 

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



[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2020-03-13 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +18328
pull_request: https://github.com/python/cpython/pull/18980

___
Python tracker 

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



[issue39952] Using VS2019 to automatically build Python3 and it failed to build

2020-03-13 Thread Zachary Ware


Zachary Ware  added the comment:

(FTR, removing yourself from the "nosy list" means you won't get any responses 
to your issue, so I've added you back :))

This appears to be a problem with building Tcl/Tk.  If you don't need the 
tkinter module, you can try adding the `--no-tkinter` flag to your `build.bat` 
invocation.  We have an open issue to upgrade Tcl/Tk to 8.6.10 (which is more 
likely to support VS2019) in Python 3.9, but that is not going to be backported 
to 3.6, which is now in security-fix-only mode.

--
components: +Windows
nosy: +Lin, paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18327
pull_request: https://github.com/python/cpython/pull/18979

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-13 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

Holding the GIL is a reasonable constraint.

As a note, the original request was for a Python-level tracing function (so 
that in the future other Python implementations also provide that function) -- 
does this need a PEP?

--

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18326
pull_request: https://github.com/python/cpython/pull/18978

___
Python tracker 

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



[issue39330] Way to build without IDLE

2020-03-13 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> works for me

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor

STINNER Victor  added the comment:

I tested to build numpy with an opaque PyThreadState. First issue, Plex gets 
the current interpreter using PyThreadState.interp:

/tmp/pip-install-aq60p8w2/Cython/Cython/Plex/Scanners.c:7447:73: erreur: 
déréférencement d'un pointeur du type incomplet « PyThreadState » {alias « 
struct _ts »}
 7447 | PY_INT64_T current_id = 
PyInterpreterState_GetID(PyThreadState_Get()->interp);

We should add a PyThreadState_GetInterpreter(tstate) getter. 
faulthandler_py_enable() would use it for example.

Maybe _PyInterpreterState_Get() can be used, but it's a private function. There 
are also _PyThreadState_UncheckedGet() and 
_PyGILState_GetInterpreterStateUnsafe() which are worse: don't check for NULL 
pointers.

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-03-13 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 6d674a1bf456945eb758e85c11484a9f1494f2b4 by Brandt Bucher in 
branch 'master':
bpo-36144: OrderedDict Union (PEP 584) (#18967)
https://github.com/python/cpython/commit/6d674a1bf456945eb758e85c11484a9f1494f2b4


--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-03-13 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset d648ef10c5c7659ed3c9f34d5c751dc55e2c6007 by Charles Burkland in 
branch 'master':
bpo-36144: Update os.environ and os.environb for PEP 584  (#18911)
https://github.com/python/cpython/commit/d648ef10c5c7659ed3c9f34d5c751dc55e2c6007


--

___
Python tracker 

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



[issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

I close this very old issue (15 years old!). Thank you *very much* to everybody 
who was involved in helping to get it fixed!

If I forgot someone, comment this issue or open a new one.

There is one last minor issue, but there is already a dedicated issue: 
bpo-24871 "freeze.py doesn't work on x86_64 Linux out of the box".

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



[issue1294959] Add sys.platlibdir to use /usr/lib64 on Fedora and SuSE

2020-03-13 Thread STINNER Victor

STINNER Victor  added the comment:

Miro Hrončok ran rpmdiff to compare the Fedora with the old downstream patches 
and with the new upstream commit 8510f430781118d9b603c3a2f06945d6ebc5fe42: 
compare the Python package with and without setup.py changes.

https://src.fedoraproject.org/rpms/python39/pull-request/31#comment-39392

In short, there is no difference. Moreover, Miro Hrončok, Matej Cepl and me 
don't know the rationale of these setup.py changes.

I propose to drop them and wait until someone complains. If someone complains, 
we would know the rationale and so have a good reason to have these setup.py 
changes.

For readline: Fedora libreadline is already linked to libtinfo and so setup.py 
doesn't go up to `self.compiler.find_library_file(self.lib_dirs + 
['/usr/lib/termcap'], 'termcap')` code path. This code is deadcode on Fedora.

For /usr/local/lib vs /usr/local/lib64: I'm not sure why /usr/local/lib is used 
in the first place. Fedora installs libraries in /usr, not in /usr/local. Maybe 
it's there for users who install dependencies without Fedora: by installed them 
manually in /usr/local. Again, since it's unclear how /usr/local is supposed to 
be used, I prefer to leave it unchanged.

I closed the PR 18917.

Morevoer, if it becomes an issue in Fedora, we can start with a downstream 
patch again, to see how it goes, before going directly upstream.

--

___
Python tracker 

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



[issue39330] Way to build without IDLE

2020-03-13 Thread Tal Einat


Change by Tal Einat :


--
nosy:  -taleinat

___
Python tracker 

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



[issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll

2020-03-13 Thread Steve Dower


Change by Steve Dower :


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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 38965ec5411da60d312b59be281f3510d58e0cf1 by Victor Stinner in 
branch 'master':
bpo-39947: Hide implementation detail of trashcan macros (GH-18971)
https://github.com/python/cpython/commit/38965ec5411da60d312b59be281f3510d58e0cf1


--

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

Fabio: I added _PyEval_SetProfile() and _PyEval_SetTrace() which take a tstate 
parameter. These functions have a constraint: the caller must hold the GIL. Is 
it an acceptable constraint for you?

That's not something new, it's already the code in Python 3.8, it's just that 
it wasn't documented. In Python 3.7, it was less important: Python 3.8 added a 
call to PySys_Audit() which can execute arbitrary Python code.

Anyway, touching Python internals without holding the GIL is risky: see 
bpo-1021318 for example.

--

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

> PyEval_SetTrace() and PyEval_SetProfile() function have no return value but 
> can raise an exception. I'm not comfortable about these functions. Maybe one 
> option would be to call PyErr_WriteUnraisable() on PySys_Audit() error. It 
> might be better than "leaking" an exception which is unexpected to 
> PyEval_SetTrace() and PyEval_SetProfile() callers.

I wrote PR 18977 to implement this idea.

--

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18325
pull_request: https://github.com/python/cpython/pull/18977

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

PyEval_SetTrace() and PyEval_SetProfile() function have no return value but can 
raise an exception. I'm not comfortable about these functions. Maybe one option 
would be to call PyErr_WriteUnraisable() on PySys_Audit() error. It might be 
better than "leaking" an exception which is unexpected to PyEval_SetTrace() and 
PyEval_SetProfile() callers.

--

___
Python tracker 

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



[issue39955] argparse print_help breaks when help is blank space

2020-03-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Seems to be a duplicate of issue2

--
nosy: +xtreak

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 309d7cc5df4e2bf3086c49eb2b1b56b929554500 by Victor Stinner in 
branch 'master':
bpo-35370: Add _PyEval_SetTrace() function (GH-18975)
https://github.com/python/cpython/commit/309d7cc5df4e2bf3086c49eb2b1b56b929554500


--

___
Python tracker 

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



[issue39955] argparse print_help breaks when help is blank space

2020-03-13 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue39955] argparse print_help breaks when help is blank space

2020-03-13 Thread paul j3


Change by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-13 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

I'm iterating on all threads and getting its thread id to find out the thread 
state (in my use case) and then doing what you just did there...

So, while this solution does work for me, if the idea is making tstate opaque, 
then having (an optional) thread id in settrace (which iterates to find the 
proper thread if given) could solve it without having to rely on any CPython 
internals on my side (although it should probably return a bool to say if it 
did work then).

--

___
Python tracker 

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



[issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library

2020-03-13 Thread Jimmy Lai

Jimmy Lai  added the comment:

Just found Guido mentioned LibCST. Here is a quick overview:
1. LibCST is an open source Python concrete syntax tree parser. It provides a 
CST looks like and feel like AST.

2. It's built by Instagram for linter and refactoring tools (exact use cases 
what Łukasz mentioned). We have a linter framework built on top of LibCST which 
allows a lint rule automatically fixes the issue (autofixer) for developers. 
We're working on open source it to help developers write better code easily. CC 
Tim
We also found a couple other linter related open source tools use LibCST.

3. It's based on parso (which based on pgen2) and currently supports Python 3.5 
to 3.8. Tim is working on adding the support back to 3.0 now and potentially 
2.7 later.

4. It provides various patterns for traversing and modifying CST easily, 
including the AST visitor/transformer pattern, matchers pattern, various 
helpers for find/replace nodes in a tree and high level transform helpers (e.g. 
added needed import, remove unused import).

5. It also provides metadata for tree node from static analysis, e.g. 
line/column position, qualified name, scope analysis, inferred type annotation 
(through Pyre). Those are useful information for building advanced linter or 
refactoring tool.

There are more features available in LibCST. We continue to develop it to make 
automated refactoring even easier. We welcome your feedback and PRs!

--
nosy: +jimmylai

___
Python tracker 

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



[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9ee88cde1abf7f274cc55a0571b1c2cdb1263743 by Dong-hee Na in branch 
'master':
bpo-37207: Use PEP 590 vectorcall to speed up tuple() (GH-18936)
https://github.com/python/cpython/commit/9ee88cde1abf7f274cc55a0571b1c2cdb1263743


--
nosy: +vstinner

___
Python tracker 

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



[issue1021318] PyThreadState_Next not thread safe

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-35370: "Add _PyEval_SetTrace(tstate, func, arg) function".

--

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

> Maybe better would be the thread id so that the tstate structure is not 
> needed there.

PyInterpreterState.tstate_head allows to iterate on all thread states, but I'm 
not aware of an API to get a PyThreadState from its identifier (tstate->id).

--

See also bpo-1021318: "PyThreadState_Next not thread safe".

--

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

Attached PR 18975 adds _PyEval_SetTrace(tstate, func, arg) function. It 
requires that the caller holds the GIL. The function calls PySys_Audit() in the 
context of the current thread state (not in "tstate").

--

___
Python tracker 

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



[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
title: Provide API to set the tracing function to be used for running threads. 
-> Add _PyEval_SetTrace(tstate, func, arg) function
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue35370] Provide API to set the tracing function to be used for running threads.

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39955] argparse print_help breaks when help is blank space

2020-03-13 Thread Ying Zhang


New submission from Ying Zhang :

Code is attached. Comments in line. 

from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter

parser1 = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter)
parser1.add_argument('--foo',
default='default_value_for_foo', required=False)
# this will not print the default value for foo. I think this is not the  most 
natural choice, given that the user has asked for 
ArgumentDefaultsHelpFormatter, but acceptable since the user didn't define help 
here. 

parser1.add_argument('--bar', help='',
default='default_value_for_bar', required=False)
# this will not print the default value for bar. Again, acceptable but I feel 
not the most natural. 

parser1.add_argument('--baz', help=' ',
default='default_value_for_baz', required=False)
# this will print the default value for baz. 


parser1.print_help()


parser2 = ArgumentParser()
parser2.add_argument('--baz', help=' ',
default='default_value_for_baz', required=False)

# this will break, which surprises me.
parser2.print_help()



Result:
python argparse_help_demo.py 
usage: argparse_help_demo.py [-h] [--foo FOO] [--bar BAR] [--baz BAZ]

optional arguments:
  -h, --help  show this help message and exit
  --foo FOO
  --bar BAR
  --baz BAZ   (default: default_value_for_baz)
Traceback (most recent call last):
  File "argparse_help_demo.py", line 21, in 
parser2.print_help()
  File 
"/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 
2474, in print_help
self._print_message(self.format_help(), file)
  File 
"/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 
2458, in format_help
return formatter.format_help()
  File 
"/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 
284, in format_help
help = self._root_section.format_help()
  File 
"/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 
215, in format_help
item_help = join([func(*args) for func, args in self.items])
  File 
"/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 
215, in 
item_help = join([func(*args) for func, args in self.items])
  File 
"/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 
215, in format_help
item_help = join([func(*args) for func, args in self.items])
  File 
"/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 
215, in 
item_help = join([func(*args) for func, args in self.items])
  File 
"/nfs/statbuild/zhangyi/conda_envs/net37_env0/lib/python3.7/argparse.py", line 
527, in _format_action
parts.append('%*s%s\n' % (indent_first, '', help_lines[0]))
IndexError: list index out of range

--
components: Library (Lib)
messages: 364091
nosy: Ying Zhang
priority: normal
severity: normal
status: open
title: argparse print_help breaks when help is blank space
type: crash
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



[issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

It looks like an installation issue:

% /usr/local/bin/bash -c ""   
ld-elf.so.1: Shared object "libncurses.so.8" not found, required by "bash"

--

___
Python tracker 

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



[issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +koobs

___
Python tracker 

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



[issue39954] test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x

2020-03-13 Thread STINNER Victor


New submission from STINNER Victor :

It started to at build 385 or 386.

AMD64 FreeBSD Shared 3.x:
https://buildbot.python.org/all/#/builders/152/builds/391

==
FAIL: test_specific_shell (test.test_subprocess.POSIXProcessTestCase)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_subprocess.py",
 line 2180, in test_specific_shell
self.assertEqual(p.stdout.read().strip(), bytes(sh, 'ascii'))
AssertionError: b'' != b'/usr/local/bin/bash'

--
components: Tests
messages: 364089
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_subprocess: test_specific_shell() fails on AMD64 FreeBSD Shared 3.x
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



[issue35370] Provide API to set the tracing function to be used for running threads.

2020-03-13 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

Maybe better would be the thread id so that the tstate structure is not needed 
there.

--

___
Python tracker 

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



[issue35370] Provide API to set the tracing function to be used for running threads.

2020-03-13 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

>> Note: currently there is a way to achieve that by pausing all the threads 
>> then selectively switching to a thread to make it current and setting the 
>> tracing function using the C-API (see: 
>> https://github.com/fabioz/PyDev.Debugger/blob/master/pydevd_attach_to_process/dll/attach.cpp#L1224),
>>  but I believe this is very hacky and not portable to other Python 
>> implementations.

> I'm not sure that I understand your need. Do you need a variant of 
> PyEval_SetTrace() which accepts a tstate argument?

Yes

--

___
Python tracker 

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



[issue35370] Provide API to set the tracing function to be used for running threads.

2020-03-13 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

I'd like to, but it only sets the tracing to the currently running thread (the 
request is for setting the tracing for other threads).

Just for info, the problem I'm solving is that the debugger is multi-threaded, 
but the user can start the code without any tracing in place, and then, when it 
gets to an attach to process or a programmatic attach to the debugger, the 
debugger needs to set the tracing to threads that are already running (and any 
new thread created afterward) and Python doesn't really have any structure for 
that in place (so, I'm using the C-API as a workaround to do what 
PyEval_SetTrace does but targeting any thread).

--

___
Python tracker 

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



[issue35370] Provide API to set the tracing function to be used for running threads.

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

> Note: currently there is a way to achieve that by pausing all the threads 
> then selectively switching to a thread to make it current and setting the 
> tracing function using the C-API (see: 
> https://github.com/fabioz/PyDev.Debugger/blob/master/pydevd_attach_to_process/dll/attach.cpp#L1224),
>  but I believe this is very hacky and not portable to other Python 
> implementations.

I'm not sure that I understand your need. Do you need a variant of 
PyEval_SetTrace() which accepts a tstate argument?

--

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3f2f4fefca388bc62fc2a7d07cb6ef24197c84bd by Victor Stinner in 
branch 'master':
bpo-39947: Move get_recursion_depth() to _testinternalcapi (GH-18974)
https://github.com/python/cpython/commit/3f2f4fefca388bc62fc2a7d07cb6ef24197c84bd


--

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

> As a note, externally I have to use it in pydevd to set the tracing for 
> different threads -- i.e.: https://bugs.python.org/issue35370 Will that still 
> be possible?

My intent is not to prevent third-party C extension modules to modify 
PyThreadState, but to make the structure opaque. I mean that we should add 
getter and setter function for the most commonly used PyThreadState fields.

--

___
Python tracker 

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



[issue35370] Provide API to set the tracing function to be used for running threads.

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

Can't you use PyEval_SetTrace()?
https://docs.python.org/dev/c-api/init.html#c.PyEval_SetTrace

--
nosy: +vstinner

___
Python tracker 

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



[issue39953] Let's update ssl error codes

2020-03-13 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue35370] Provide API to set the tracing function to be used for running threads.

2020-03-13 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

As a note, the workaround is now in 
https://github.com/fabioz/PyDev.Debugger/blob/pydev_debugger_1_9_0/pydevd_attach_to_process/common/py_settrace_37.hpp#L150

--

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

As a note, externally I have to use it in pydevd to set the tracing for 
different threads -- i.e.: https://bugs.python.org/issue35370

Will that still be possible?

--
nosy: +fabioz

___
Python tracker 

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



[issue39930] Embedded installer for Python 3.7.7 missing vcruntime140.dll

2020-03-13 Thread Steve Dower


Steve Dower  added the comment:


New changeset c05e491a69df3fe0a8be91eeddd330792ada6755 by Steve Dower in branch 
'3.7':
bpo-39930: Fix MSBuild detection for Build Tools (GH-18938)
https://github.com/python/cpython/commit/c05e491a69df3fe0a8be91eeddd330792ada6755


--

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18323
pull_request: https://github.com/python/cpython/pull/18974

___
Python tracker 

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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 224481a8c988fca12f488544edd2f01c0af2a91d by Victor Stinner in 
branch 'master':
bpo-39947: Move Py_EnterRecursiveCall() to internal C API (GH-18972)
https://github.com/python/cpython/commit/224481a8c988fca12f488544edd2f01c0af2a91d


--

___
Python tracker 

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



[issue39953] Let's update ssl error codes

2020-03-13 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +alex, christian.heimes, dstufft, janssen

___
Python tracker 

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



[issue39862] Why are the union relationships not implemented by default for ≤ and ≥?

2020-03-13 Thread Géry

Géry  added the comment:

More precisely:

The following relationships are always valid and therefore implemented by 
default in Python (_except for the union relationships, which seems arbitrary 
and is the reason of this Python issue_):

- 2 [complementary](https://en.wikipedia.org/wiki/Binary_relation#Complement) 
relationships: "= and ≠ are each other’s complement";
- 6 [converse](https://en.wikipedia.org/wiki/Binary_relation#Converse) 
relationships*: "= is the converse of itself", "≠ is the converse of itself", 
"< and > are each other’s converse", and "≤ and ≥ are each other’s converse";
- 2 [union](https://en.wikipedia.org/wiki/Binary_relation#Union) relationships: 
"≤ is the union < and =" and "≥ is the union of > and ≤".

The following relationships are only valid for [total 
orders](https://en.wikipedia.org/wiki/Binary_relation#Properties) and therefore 
not implemented by default in Python (but users can conveniently implement them 
when they are valid with the 
[`functools.total_ordering`](https://docs.python.org/3/library/functools.html#functools.total_ordering)
 class decorator provided by the Python standard library):

- 4 [complementary](https://en.wikipedia.org/wiki/Binary_relation#Complement) 
relationships: "< and ≥ are each other’s complement" and "> and ≤ are each 
other’s complement".



\* Converse relationships are implemented in Python through the 
[`NotImplemented` 
protocol](https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy).

--

___
Python tracker 

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



[issue39936] Python fails to build _asyncio on module on AIX

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

POWER6 AIX 3.x and PPC64 AIX 3.x buildbots are back to green.

--

___
Python tracker 

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



[issue39936] Python fails to build _asyncio on module on AIX

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39936] Python fails to build _asyncio on module on AIX

2020-03-13 Thread Michael Felt


Michael Felt  added the comment:

Fantastic! Many thanks!

--

___
Python tracker 

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