[issue38373] List overallocation strategy

2020-03-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39943] Meta: Clean up various issues in C internals

2020-03-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



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

2020-03-11 Thread Zackery Spytz


Zackery Spytz  added the comment:

Okay, Serhiy.  I think your patch is a better choice.

--

___
Python tracker 

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



[issue39885] IDLE right click outside of any selection should clear it

2020-03-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +18302
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18951

___
Python tracker 

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



[issue39943] Meta: Clean up various issues in C internals

2020-03-11 Thread Andy Lester


Change by Andy Lester :


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

___
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-11 Thread Andy Lester


Change by Andy Lester :


--
pull_requests:  -18300

___
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-11 Thread Andy Lester


Change by Andy Lester :


--
pull_requests: +18300
pull_request: https://github.com/python/cpython/pull/18949

___
Python tracker 

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



[issue39943] Meta: Clean up various issues in C internals

2020-03-11 Thread Andy Lester


Change by Andy Lester :


--
title: Meta: Clean up various issues -> Meta: Clean up various issues in C 
internals

___
Python tracker 

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



[issue39943] Meta: Clean up various issues

2020-03-11 Thread Andy Lester


New submission from Andy Lester :

This is a meta-ticket for a number of small PRs that clean up some internals.

Issues will include:

* Removing unnecessary casts
* consting pointers that can be made const
* Removing unused function arguments
* etc

--
components: Interpreter Core
messages: 363993
nosy: petdance
priority: normal
severity: normal
status: open
title: Meta: Clean up various issues

___
Python tracker 

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



[issue39885] IDLE right click outside of any selection should clear it

2020-03-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: IDLE right click should clear any selection -> IDLE right click outside 
of any selection should clear it

___
Python tracker 

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



[issue37224] test__xxsubinterpreters fails randomly

2020-03-11 Thread Kyle Stanley


Kyle Stanley  added the comment:

I have a few spare cycles to take another stab at this issue. I can say with 
some certainty that the failure in test__xxsubinterpreters.DestroyTests does 
not occur on the latest commit to master (3.9):

```
$ ./python -m test test__xxsubinterpreters --match DestroyTests -j200 -F -v

OK
0:09:28 load avg: 80.87 [2188] test__xxsubinterpreters passed
test_all (test.test__xxsubinterpreters.DestroyTests) ... ok
test_already_destroyed (test.test__xxsubinterpreters.DestroyTests) ... ok
test_bad_id (test.test__xxsubinterpreters.DestroyTests) ... ok
test_does_not_exist (test.test__xxsubinterpreters.DestroyTests) ... ok
test_from_current (test.test__xxsubinterpreters.DestroyTests) ... ok
test_from_other_thread (test.test__xxsubinterpreters.DestroyTests) ... ok
test_from_sibling (test.test__xxsubinterpreters.DestroyTests) ... ok
test_main (test.test__xxsubinterpreters.DestroyTests) ... ok
test_one (test.test__xxsubinterpreters.DestroyTests) ... ok
test_still_running (test.test__xxsubinterpreters.DestroyTests) ... ok

== Tests result: INTERRUPTED ==
Test suite interrupted by signal SIGINT.

2188 tests OK.
```

So at this point it seems to be a matter of looking through the diff between 
3.8 vs 3.9 for any relevant code paths, and attempting to determine what change 
resolved the failure for 3.9. It might also be useful to determine if it 
occurred when the tests were first added in 3.8 or if some other commit 
introduced a subtle regression.

--

___
Python tracker 

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



[issue39885] IDLE right click should clear any selection

2020-03-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Restore not clearing the selection when click within it. See Exception in 1 
above.  Users need to continue to see what will be copied or cut (which also 
happens with paste).

The breakpoint toggle and goto file/line options on the context menu need the 
line number of the click.  If the cursor is not moved, another alternative is 
needed.

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

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

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



[issue39940] Micro-optimizations to PySequence_Tuple()

2020-03-11 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue39942] Making instance of `TypeVar` fails because of missing `__name__`

2020-03-11 Thread jack1142


New submission from jack1142 :

Example code:
```
code = """
import typing
T = typing.TypeVar("T")
"""
exec(code, {})
```

Traceback:
```
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in 
  File "C:\Python38\lib\typing.py", line 603, in __init__
def_mod = sys._getframe(1).f_globals['__name__']  # for pickling
KeyError: '__name__'
```

If this problem with `__name__` is not something that needs to be fixed, then I 
also noticed that the same line in typing.py will also raise when platform 
doesn't have `sys._getframe()`

--
components: Library (Lib)
messages: 363990
nosy: jack1142
priority: normal
severity: normal
status: open
title: Making instance of `TypeVar` fails because of missing `__name__`
type: behavior
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



[issue38080] 2to3 urllib fixer: missing fix for urllib.getproxies

2020-03-11 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount()

2020-03-11 Thread miss-islington


miss-islington  added the comment:


New changeset 60b1b5ac56fe6099a3d358dc9d6cd6ec72fce2d8 by Miss Islington (bot) 
in branch '3.8':
bpo-39847: EnterNonRecursiveMutex() uses GetTickCount64() (GH-18780)
https://github.com/python/cpython/commit/60b1b5ac56fe6099a3d358dc9d6cd6ec72fce2d8


--

___
Python tracker 

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



[issue38080] 2to3 urllib fixer: missing fix for urllib.getproxies

2020-03-11 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset 276a84a0a6c694ce227bf36ec2e2e6ec6686170f by José Roberto Meza 
Cabrera in branch 'master':
bpo-38080: Added "getproxies" to urllib fixes in the 2to3 tool (GH-16167)
https://github.com/python/cpython/commit/276a84a0a6c694ce227bf36ec2e2e6ec6686170f


--
nosy: +pablogsal

___
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-11 Thread Michael Felt

Michael Felt  added the comment:

Actually, I had already done that:

diff --git a/Lib/_aix_support.py b/Lib/_aix_support.py
index 2c5cd3297d..c7f4491633 100644
--- a/Lib/_aix_support.py
+++ b/Lib/_aix_support.py
@@ -12,7 +12,8 @@ try:
 _tmp_bd = get_config_var("AIX_BUILDDATE")
 _bgt = get_config_var("BUILD_GNU_TYPE")
 except ImportError:  # pragma: no cover
-_have_subprocess = False
+import _bootsubprocess as subprocess
+_have_subprocess = True
 _tmp_bd = None
 _bgt = "powerpc-ibm-aix6.1.7.0"

And after that test, I tried with no calls to _aix_support.py

diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index 4b002ecef1..513af52ecd 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -79,8 +79,9 @@ def get_host_platform():
 machine += ".%s" % bitness[sys.maxsize]
 # fall through to standard osname-release-machine representation
 elif osname[:3] == "aix":
-from _aix_support import aix_platform
-return aix_platform()
+return "%s-%s.%s" % (osname, version, release)
+# from _aix_support import aix_platform
+# return aix_platform()
 elif osname[:6] == "cygwin":
 osname = "cygwin"
 rel_re = re.compile (r'[\d.]+', re.ASCII)
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 4003726dc9..b116e96007 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -666,8 +666,9 @@ def get_platform():
 machine += ".%s" % bitness[sys.maxsize]
 # fall through to standard osname-release-machine representation
 elif osname[:3] == "aix":
-from _aix_support import aix_platform
-return aix_platform()
+return "%s-%s.%s" % (osname, version, release)
+# from _aix_support import aix_platform
+# return aix_platform()
 elif osname[:6] == "cygwin":
 osname = "cygwin"
 import re



So, even when _aix_support.py is not involved at all, _socket.so is being 
ignored - even though it was built.

--

___
Python tracker 

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



[issue39853] Segmentation fault with urllib.request.urlopen and threads

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



[issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount()

2020-03-11 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue39847] EnterNonRecursiveMutex on win32 can hang for 49.7 days: use GetTickCount64() rather than GetTickCount()

2020-03-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 64838ce7172c7a92183b39b22504b433a33a884d by bobince in branch 
'master':
bpo-39847: EnterNonRecursiveMutex() uses GetTickCount64() (GH-18780)
https://github.com/python/cpython/commit/64838ce7172c7a92183b39b22504b433a33a884d


--

___
Python tracker 

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



[issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug

2020-03-11 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
nosy: +vstinner
nosy_count: 1.0 -> 2.0
pull_requests: +18298
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18944

___
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-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18297
pull_request: https://github.com/python/cpython/pull/18943

___
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-11 Thread miss-islington


miss-islington  added the comment:


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


--

___
Python tracker 

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



[issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents

2020-03-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

idlemain.py should be documented within idlelib* (I will do that, README.txt 
and maybe macosx.py).  Currently, the chdir is only part of idle.app, not idle 
on Mac, because it does not happen when starting IDLE in Terminal.  This is 
confusing.  As near as I can tell, it is not needed in idlemain.py.  If so, it 
should be moved (revised) into idlelib startup code so it always runs on Mac.  
How about something like:

try:
os.chdir(os.path.expanduser('~/Documents'))
except OSError:  # I presume

os.chdir(os.path.expanduser('~'))  # Can this fail?

* The only mention of 'IDLE.app' in idlelib is in the news item for #27310, 
where you mention 'idlemain.py', sans path.

--

___
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-11 Thread STINNER Victor


STINNER Victor  added the comment:

The initial issue is now fixed. I close the issue.

take_gil() only checks if the thread must exit once the GIL is acquired. Maybe 
it would be able to exit earlier, but I took the safe approach. If we must 
exit, drop the GIL and then exit. That's basically Python 3.8 behavior.

If someone wants to optimize/enhance take_gil() for daemon thread, I suggest to 
open a new issue.

Note: Supporting daemon threads require tricky code in take_gil(). I would 
prefer to deprecate daemon threads and prepare their removal.

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



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

2020-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-39941 "multiprocessing: Process.join() should emit a warning if 
the process is killed by a signal" which may help to detect the issue earlier 
on any platform, not only on FreeBSD.

--

___
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-11 Thread Steve Dower


Steve Dower  added the comment:

Okay, I think I've got an approach that works even on the apparently 
misconfigured installs on the buildbots (and some user machines, if this is the 
same underlying issue as issue38597).

I wasn't able to reproduce it though, so I have no idea why they don't have the 
right redist version property. Hopefully using the last-found directory under 
Redist continues to make sense into the future.

--

___
Python tracker 

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



[issue39941] multiprocessing: Process.join() should emit a warning if the process is killed by a signal

2020-03-11 Thread STINNER Victor


New submission from STINNER Victor :

While debugging bpo-39877, I was surprising that Python crash was only noticed 
on FreeBSD by a side effect. On FreeBSD, coredump files are created in the 
current directory. But Python regrtest fails if a test creates a file and 
doesn't remove it.

I found that multiprocessing.Process.join() deletes the subprocess.Popen object 
as soon as the process completes, but it doesn't log any warning if the process 
is killed by a signal. The caller has no way to be notified.

I propose to enhance Process to log a warning if such case happens.

--
components: Library (Lib)
messages: 363980
nosy: vstinner
priority: normal
severity: normal
status: open
title: multiprocessing: Process.join() should emit a warning if the process is 
killed by a signal
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



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

2020-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

Try to replace Lib/_aix_support.py with attached _aix_support.py: in short, it 
uses _bootsubprocess if subprocess is not available.

--
Added file: https://bugs.python.org/file48972/_aix_support.py

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-11 Thread Stefan Krah


Stefan Krah  added the comment:

I checked that NumPy also packs correctly:

>>> import numpy as np
>>> x = np.array([0,1,2,3], dtype=np.bool)
>>> x.tobytes()
b'\x00\x01\x01\x01'

So I vote for not handling incorrectly packed values and removing
"and any non-zero value will be True when unpacking" from the docs,
which does not seem to make any sense for _Bool.

memoryview also does not guard against the theoretical possibility
of incorrectly packed values being trap representations. Values need
to be packed correctly, or you get UB.

--

___
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-11 Thread STINNER Victor


STINNER Victor  added the comment:

Michael: this issue is about bootstraping Python. If you want to test a patch 
or test something else, you must restart from a clean copy of the source code. 
Either use "make distclean", "git clean -fdx", or recreate the source directory 
(git clone, decompress an archive, etc.). Then restart from scratch: 
./configure && make.

> NameError: name 'sys' is not defined

Right, that's a stupid bug in my patch. You must import sys before.

--

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sorry Raul, but I already have a PR written. It includes minor refactoring,  
better error handling in the nearby code, improved tests, fixed documentation 
and comments which incorrectly described the current behavior. It took time to 
determine what parts should be fixed, and unless you have found all this in 
your PR it would take much more time to explain to you what details should be 
checked than check and fix them myself.

--

___
Python tracker 

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



[issue39940] Micro-optimizations to PySequence_Tuple()

2020-03-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Do you have any benchmarks?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39940] Micro-optimizations to PySequence_Tuple()

2020-03-11 Thread Marco Sulla


New submission from Marco Sulla :

This is a little PR with some micro-optimizations to the PySequence_Tuple() 
function. Mainly, it simply add a support variable new_n_tmp_1 instead of 
reassigning newn multiple times.

--
components: Interpreter Core
messages: 363974
nosy: Marco Sulla
priority: normal
pull_requests: 18296
severity: normal
status: open
title: Micro-optimizations to PySequence_Tuple()
type: performance
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



[issue35712] Make NotImplemented unusable in boolean context

2020-03-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> How is -1 interpreted?  Does it become a TypeError?

It is interpreted as error. It requires an exception be set. If you return -1 
without setting an exception you will usually get a SystemError or crash. Oh, 
and this may happen during executing other code, so you will search a bug in 
wrong place.

You cannot change this without breaking the C and Python API in hard way.

> So my thinking is that when the interpreter gets the `NotImplemented` 
> returned by either `if a` or by `if not a` that it would be converted to a 
> `TypeError`

> and the `and` machinery sees it has a `NotImplemented` and raises a 
> `TypeError`.

So you literally want NotImplemented raising a TypeError in boolean context 
except the "not" operator, and redefine `not a` from

False if a else True

to

NotImplemented if a is NotImplemented else False if a else True

You can do this, but this is a different issue, and I doubt that it will solve 
many problems.

--

___
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-11 Thread Michael Felt


Michael Felt  added the comment:

OK. I removed the _aix_support.py from the formula.

After make see the new (rather) old build paths for "socket"

aixtools@x064:[/home/aixtools/python-3.9]find . | grep socket
./Doc/howto/sockets.rst
./Doc/library/socket.rst
./Doc/library/socketserver.rst
./Lib/__pycache__/socket.cpython-39.opt-1.pyc
./Lib/__pycache__/socket.cpython-39.opt-2.pyc
./Lib/__pycache__/socket.cpython-39.opt-4.pyc
./Lib/__pycache__/socket.cpython-39.pyc
./Lib/__pycache__/socketserver.cpython-39.pyc
./Lib/socket.py
./Lib/socketserver.py
./Lib/test/__pycache__/mock_socket.cpython-39.pyc
./Lib/test/__pycache__/test_socket.cpython-39.pyc
./Lib/test/__pycache__/test_socketserver.cpython-39.pyc
./Lib/test/mock_socket.py
./Lib/test/test_socket.py
./Lib/test/test_socketserver.py
./Modules/socketmodule.c
./Modules/socketmodule.h
./PCbuild/_socket.vcxproj
./PCbuild/_socket.vcxproj.filters
./build/lib.aix-7.1-3.9/_socket.so
./build/temp.aix-7.1-3.9/home/aixtools/python-3.9/Modules/socketmodule.o

I remove these two files again and run make:

aixtools@x064:[/home/aixtools/python-3.9]make
 CC='xlc_r' LDSHARED='Modules/ld_so_aix xlc_r -bI:Modules/python.exp' 
OPT='-DNDEBUG -O'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''  ./python -E ./setup.py  
build
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building '_asyncio' extension
xlc_r -DNDEBUG -O -I./Include/internal -I./Include -I. 
-I/home/aixtools/python-3.9/Include -I/home/aixtools/python-3.9 -c 
/home/aixtools/python-3.9/Modules/_asynciomodule.c -o 
build/temp.aix-7.1-3.9/home/aixtools/python-3.9/Modules/_asynciomodule.o
Modules/ld_so_aix xlc_r -bI:Modules/python.exp 
build/temp.aix-7.1-3.9/home/aixtools/python-3.9/Modules/_asynciomodule.o -o 
build/lib.aix-7.1-3.9/_asyncio.so
building '_socket' extension
xlc_r -DNDEBUG -O -I./Include/internal -I./Include -I. 
-I/home/aixtools/python-3.9/Include -I/home/aixtools/python-3.9 -c 
/home/aixtools/python-3.9/Modules/socketmodule.c -o 
build/temp.aix-7.1-3.9/home/aixtools/python-3.9/Modules/socketmodule.o
1500-030: (I) INFORMATION: PyInit__socket: Additional optimization may be 
attained by recompiling and specifying MAXMEM option with a value greater than 
8192.
Modules/ld_so_aix xlc_r -bI:Modules/python.exp 
build/temp.aix-7.1-3.9/home/aixtools/python-3.9/Modules/socketmodule.o -o 
build/lib.aix-7.1-3.9/_socket.so
*** WARNING: renaming "_asyncio" since importing it failed: No module named 
'_socket'

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_gdbm _lzma _sqlite3
_tkinter  readline
To find the necessary bits, look in setup.py in detect_modules() for the 
module's name.


The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  atexitpwd
time


Following modules built successfully but were removed because they could not be 
imported:
_asyncio

The diff!

diff --git a/Lib/_aix_support.py b/Lib/_aix_support.py
index 2c5cd3297d..c7f4491633 100644
--- a/Lib/_aix_support.py
+++ b/Lib/_aix_support.py
@@ -12,7 +12,8 @@ try:
 _tmp_bd = get_config_var("AIX_BUILDDATE")
 _bgt = get_config_var("BUILD_GNU_TYPE")
 except ImportError:  # pragma: no cover
-_have_subprocess = False
+import _bootsubprocess as subprocess
+_have_subprocess = True
 _tmp_bd = None
 _bgt = "powerpc-ibm-aix6.1.7.0"

diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index 4b002ecef1..513af52ecd 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -79,8 +79,9 @@ def get_host_platform():
 machine += ".%s" % bitness[sys.maxsize]
 # fall through to standard osname-release-machine representation
 elif osname[:3] == "aix":
-from _aix_support import aix_platform
-return aix_platform()
+return "%s-%s.%s" % (osname, version, release)
+# from _aix_support import aix_platform
+# return aix_platform()
 elif osname[:6] == "cygwin":
 osname = "cygwin"
 rel_re = re.compile (r'[\d.]+', re.ASCII)
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 4003726dc9..b116e96007 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -666,8 +666,9 @@ def get_platform():
 machine += ".%s" % bitness[sys.maxsize]
 # fall through to standard osname-release-machine representation
 elif osname[:3] == "aix":
-from _aix_support import aix_platform
-return aix_platform()
+return "%s-%s.%s" % (osname, version, release)
+# from _aix_support import aix_platform
+# return aix_platform()
 elif osname[:6] == "cygwin":
 osname = "cygwin"
 import re

IMHO - this problem has nothing to do with _aix_support.py - That issue was 
fixed earlier by the new _bootsubprocess.

--

___
Python 

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

2020-03-11 Thread Michael Felt


Change by Michael Felt :


Added file: https://bugs.python.org/file48971/make.log

___
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-11 Thread Michael Felt


Michael Felt  added the comment:

So, this is what I have on screen. Will add the log in a moment.

[1] +  Donemake 2>&1|tee make.log &
aixtools@x064:[/home/aixtools/python-3.9]find . | grep socket
./Doc/howto/sockets.rst
./Doc/library/socket.rst
./Doc/library/socketserver.rst
./Lib/__pycache__/socket.cpython-39.opt-1.pyc
./Lib/__pycache__/socket.cpython-39.opt-2.pyc
./Lib/__pycache__/socket.cpython-39.opt-4.pyc
./Lib/__pycache__/socket.cpython-39.pyc
./Lib/__pycache__/socketserver.cpython-39.pyc
./Lib/socket.py
./Lib/socketserver.py
./Lib/test/__pycache__/mock_socket.cpython-39.pyc
./Lib/test/__pycache__/test_socket.cpython-39.pyc
./Lib/test/__pycache__/test_socketserver.cpython-39.pyc
./Lib/test/mock_socket.py
./Lib/test/test_socket.py
./Lib/test/test_socketserver.py
./Modules/socketmodule.c
./Modules/socketmodule.h
./PCbuild/_socket.vcxproj
./PCbuild/_socket.vcxproj.filters
./build/lib.aix-7104-1806-32-3.9/_socket.so
./build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/socketmodule.o
aixtools@x064:[/home/aixtools/python-3.9]rm 
./build/lib.aix-7104-1806-32-3.9/_socket.so 
./build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/socketmodule.o

aixtools@x064:[/home/aixtools/python-3.9]make V=1
 CC='xlc_r' LDSHARED='Modules/ld_so_aix xlc_r -bI:Modules/python.exp' 
OPT='-DNDEBUG -O'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''  ./python -E ./setup.py  
build
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building '_asyncio' extension
xlc_r -DNDEBUG -O -I./Include/internal -I./Include -I. 
-I/home/aixtools/python-3.9/Include -I/home/aixtools/python-3.9 -c 
/home/aixtools/python-3.9/Modules/_asynciomodule.c -o 
build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/_asynciomodule.o
Modules/ld_so_aix xlc_r -bI:Modules/python.exp 
build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/_asynciomodule.o
 -o build/lib.aix-7104-1806-32-3.9/_asyncio.so
building '_socket' extension
xlc_r -DNDEBUG -O -I./Include/internal -I./Include -I. 
-I/home/aixtools/python-3.9/Include -I/home/aixtools/python-3.9 -c 
/home/aixtools/python-3.9/Modules/socketmodule.c -o 
build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/socketmodule.o
1500-030: (I) INFORMATION: PyInit__socket: Additional optimization may be 
attained by recompiling and specifying MAXMEM option with a value greater than 
8192.
Modules/ld_so_aix xlc_r -bI:Modules/python.exp 
build/temp.aix-7104-1806-32-3.9/home/aixtools/python-3.9/Modules/socketmodule.o 
-o build/lib.aix-7104-1806-32-3.9/_socket.so
*** WARNING: renaming "_asyncio" since importing it failed: No module named 
'_socket'

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_gdbm _lzma _sqlite3
_tkinter  readline
To find the necessary bits, look in setup.py in detect_modules() for the 
module's name.


The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  atexitpwd
time


Following modules built successfully but were removed because they could not be 
imported:
_asyncio

--

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18295
pull_request: https://github.com/python/cpython/pull/18942

___
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-11 Thread Michael Felt


Michael Felt  added the comment:

So, with the patch - the process stops at:

aixtools@x064:[/home/aixtools/python-3.9]make
 CC='xlc_r' LDSHARED='Modules/ld_so_aix xlc_r -bI:Modules/python.exp' 
OPT='-DNDEBUG -O'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''  ./python -E ./setup.py  
build
Traceback (most recent call last):
  File "/home/aixtools/python-3.9/Lib/subprocess.py", line 72, in 
import msvcrt
ModuleNotFoundError: No module named 'msvcrt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/aixtools/python-3.9/./setup.py", line 4, in 
import subprocess
  File "/home/aixtools/python-3.9/Lib/subprocess.py", line 77, in 
import _posixsubprocess
ModuleNotFoundError: No module named '_posixsubprocess'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/aixtools/python-3.9/./setup.py", line 16, in 
sys.modules['subprocess'] = _bootsubprocess
NameError: name 'sys' is not defined
make: 1254-004 The error code from the last command is 1.


Stop.

--

___
Python tracker 

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



[issue35712] Make NotImplemented unusable in boolean context

2020-03-11 Thread Ethan Furman


Ethan Furman  added the comment:

Serhiy:
--
> First, it is impossible. nb_bool and PyObject_IsTrue() can return
> only three value: 1 for true, 0 for false, and -1 for error.

Huh.  How is -1 interpreted?  Does it become a TypeError?


> It is not possible to represent NotImplemented without breaking all
> extensions.
> 
> Currently
> 
> if not a:
> b()
> else:
> c()
> 
> is equivalent to
> 
>if a:
>c()
> else:
> b()
> 
> If a is NotImplemented, what branch be executed in every case?

Side-stepping to other __dunder__ methods for a moment: if, for example, both 
__add__ and __radd__ return NotImplemented then the interpreter will convert 
that into a TypeError.

So my thinking is that when the interpreter gets the `NotImplemented` returned 
by either `if a` or by `if not a` that it would be converted to a `TypeError`, 
meaning none of the branches would be executed as an exception would be raised 
instead.

> Second, it would not help. Because real-world examples are not always so
> trivial as "return not self.__lt__(other)". It may be a part of more
> complex expression, e.g.:
> 
> return super().__eq__(other) and self.attr == other.attr

I don't see the problem -- breaking it down:

return super().__eq__(other) and self.attr == other.attr

becomes

return NotImplemented and ...

and the `and` machinery sees it has a `NotImplemented` and raises a 
`TypeError`.  The same would be true if the `__eq__` operation returned 
`NotImplemented`.

So to make that work, `and` and `or` would have to check if one of the operands 
is `NotImplemented`.  Are there others that would need to have that check?

The reason I would prefer this solution is that if it could behave as I 
described above, the `TypeError` would point at the user's line of code as 
being the problem, and not inside the __dunder__:

class NoAdd:
#
def __add__(self, other):
return NotImplemented
#
def __radd__(self, other):
# fake a NotImplemented TypeError from bool(NotImplemented)
raise TypeError("cannot boolean NotImplemented")

# what we should see, since the error is in the users' code
--> NoAdd() + 7
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported operand type(s) for +: 'NoAdd' and 'int'

# what we will see -- a leaky implementation detail
--> 7 + NoAdd()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 6, in __radd__
TypeError: cannot boolean NotImplemented

--

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-11 Thread Raul Gallegos


Raul Gallegos  added the comment:

hi @serhiy.storchaka is this something that you think could be done by a new 
contributor? I'd really love to take care of this, I can improve on the PR I 
was preparing https://github.com/python/cpython/pull/18533

--

___
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-11 Thread Michael Felt


Michael Felt  added the comment:

I'll take a look at what you are suggesting.

The starting point (before the rm command) is the make command that I run again.

What I notice - read am thinking - is that _socket.so is being created by the 
"setup.py build" - so, if you can help me make that bit more verbose, I'll work 
on that too.

+++
Script command is started on Wed Mar 11 15:29:44 CDT 2020.
$
$
$
$ rm ./build/lib.aix-7200-1543-32-3.9/_socket.so 
./build/temp.aix-7200-1543-32-3.9/home/aixtools/python/cpython-master/Modules/socketmodule.o
$
$
$ make V=1
 CC='gcc -pthread' LDSHARED='Modules/ld_so_aix gcc -pthread 
-bI:Modules/python.exp' OPT='-DNDEBUG -g -fwrapv -O3 -Wall'  
_TCLTK_INCLUDES='' _TCLTK_LIBS=''  ./python -E ./setup.py  build
running build
running build_ext
ldd: /lib/libreadline.a: File is an archive.
building '_asyncio' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration 
-fvisibility=hidden -I./Include/internal -I./Include
 -I. -I/home/aixtools/python/cpython-master/Include 
-I/home/aixtools/python/cpython-master -c 
/home/aixtools/python/cpython-master/Modules/_asynciomodule.c -o  
build/temp.aix-7200-1543-32-3.9/home/aixtools/python/cpython-master/Modules/_asynciomodule.o
Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp 
build/temp.aix-7200-1543-32-3.9/home/aixtools/python/cpython-master/Modules/_asynciomodule.o
 -o build/lib.aix-7200-1543-32-3.9/_asyncio.so
building '_socket' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration 
-fvisibility=hidden -I./Include/internal -I./Include
 -I. -I/home/aixtools/python/cpython-master/Include 
-I/home/aixtools/python/cpython-master -c 
/home/aixtools/python/cpython-master/Modules/socketmodule.c -o 
build/temp.aix-7200-1543-32-3.9/home/aixtools/python/cpython-master/Modules/socketmodule.o
Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp 
build/temp.aix-7200-1543-32-3.9/home/aixtools/python/cpython-master/Modules/socketmodule.o
 -o build/lib.aix-7200-1543-32-3.9/_socket.so
*** WARNING: renaming "_asyncio" since importing it failed: No module named 
'_socket'

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  atexitpwd
time


Following modules built successfully but were removed because they could not be 
imported:
_asyncio

--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-11 Thread Stefan Krah


Stefan Krah  added the comment:

Okay, in memoryview the cast tests can trigger UB checks. memoryview assumes 
that bool is packed correctly, so just casting does not work.
Casting anything to bool is of course a bit silly anyway.

diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index 6178ffde7a..86cf4c309f 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -2758,6 +2758,8 @@ class TestBufferProtocol(unittest.TestCase):
 tsize = struct.calcsize(tfmt)
 n = prod(_tshape) * tsize
 obj = 'memoryview' if is_byte_format(tfmt) else 'bytefmt'
+if "?" in tfmt:
+continue
 for fmt, items, _ in iter_format(n, obj):
 size = struct.calcsize(fmt)
 shape = [n] if n > 0 else []

--

___
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-11 Thread STINNER Victor


STINNER Victor  added the comment:

Yeah, sys must be imported first. Did you try to fix the patch? Does it work?

--

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It was originally introduced in 
https://github.com/ghaering/pysqlite/commit/780a76dcd8f4142b6ecbd423f52e0ccf067fc277.
 I think that original column names should be returned when PARSE_COLNAMES is 
not set.

Working on a PR.

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39520] AST Unparser can't unparse ext slices correctly

2020-03-11 Thread miss-islington


miss-islington  added the comment:


New changeset cd07b4da659cb5e86fe7c856aca866b9db466fce by Miss Islington (bot) 
in branch '3.8':
bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
https://github.com/python/cpython/commit/cd07b4da659cb5e86fe7c856aca866b9db466fce


--

___
Python tracker 

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



[issue39520] AST Unparser can't unparse ext slices correctly

2020-03-11 Thread miss-islington


miss-islington  added the comment:


New changeset d0837d2af2c23c3a4b6274f76ca6422a427cc438 by Miss Islington (bot) 
in branch '3.7':
bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
https://github.com/python/cpython/commit/d0837d2af2c23c3a4b6274f76ca6422a427cc438


--

___
Python tracker 

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



[issue39520] AST Unparser can't unparse ext slices correctly

2020-03-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18294
pull_request: https://github.com/python/cpython/pull/18941

___
Python tracker 

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



[issue39520] AST Unparser can't unparse ext slices correctly

2020-03-11 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue35712] Make NotImplemented unusable in boolean context

2020-03-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

No.

First, it is impossible. nb_bool and PyObject_IsTrue() can return only three 
value: 1 for true, 0 for false, and -1 for error. It is not possible to 
represent NotImplemented without breaking all extensions.

Currently

if not a:
b()
else:
c()

is equivalent to

if a:
c()
else:
b()

If a is NotImplemented, what branch be executed in every case?

Second, it would not help. Because real-world examples are not always so 
trivial as "return not self.__lt__(other)". It may be a part of more complex 
expression, e.g.:

return super().__eq__(other) and self.attr == other.attr

So it may help in some examples, but make bugs in other examples even more 
mystical.

--

___
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-11 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

I tried your patch on AIX 7.2, looks like you need to shift sys import to the 
top


Traceback (most recent call last):
  File "/home/isidentical/cpython/./setup.py", line 16, in 
sys.modules['subprocess'] = _bootsubprocess
NameError: name 'sys' is not defined
make: The error code from the last command is 1.


Stop.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-11 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-11 Thread Berker Peksag


Berker Peksag  added the comment:

https://github.com/ghaering/pysqlite/commit/f3d452f2daeb432b8ad89fa4f087164bfd6ddc12
 should probably give more context than that huge svnmerge commit :)

(Removed older Python versions since even if decide to change the behavior from 
2006, it may break third-party programs that are relying on it.)

--
versions:  -Python 2.7, Python 3.5, 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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-11 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue39939] Add str methods to remove prefixes or suffixes

2020-03-11 Thread Dennis Sweeney


New submission from Dennis Sweeney :

Following discussion here ( 
https://mail.python.org/archives/list/python-id...@python.org/thread/RJARZSUKCXRJIP42Z2YBBAEN5XA7KEC3/
 ), there is a proposal to add new methods str.cutprefix and str.cutsuffix to 
alleviate the common misuse of str.lstrip and str.rstrip.

I think sticking with the most basic possible behavior

def cutprefix(self: str, prefix: str) -> str:
if self.startswith(prefix):
return self[len(prefix):]
# return a copy to work for bytearrays
return self[:]

def cutsuffix(self: str, suffix: str) -> str:
if self.startswith(suffix):
# handles the "[:-0]" issue
return self[:len(self)-len(suffix)]
return self[:]

would be best (refusing to guess in the face of ambiguous multiple arguments). 
Someone can do, e.g.

>>> 'foo.tar.gz'.cutsuffix('.gz').cutsuffix('.tar')
'foo'

to cut off multiple suffixes. More complicated behavior for multiple arguments 
could be added later, but it would be easy to make a mistake in prematurely 
generalizing right now.

In bikeshedding method names, I think that avoiding the word "strip" would be 
nice so users can have a consistent feeling that "'strip' means character sets; 
'cut' means substrings".

--
components: Interpreter Core
messages: 363958
nosy: Dennis Sweeney
priority: normal
severity: normal
status: open
title: Add str methods to remove prefixes or suffixes
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue20039] Missing documentation for argparse.ArgumentTypeError

2020-03-11 Thread Rahul Kumaresan


Change by Rahul Kumaresan :


--
nosy: +rahul-kumi

___
Python tracker 

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



[issue39938] RotatingFileHandler does not support any mode other than 'a'.

2020-03-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue39935] argparse: help parameter not documented in add_subparsers().add_parser

2020-03-11 Thread Rahul Kumaresan


Change by Rahul Kumaresan :


--
nosy: +rahul-kumi

___
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-11 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +18291
pull_request: https://github.com/python/cpython/pull/18938

___
Python tracker 

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



[issue39938] RotatingFileHandler does not support any mode other than 'a'.

2020-03-11 Thread Eric Govatos


Change by Eric Govatos :


--
title: RotatingFileHandler does not support any other mode than 'a'. -> 
RotatingFileHandler does not support any mode other than 'a'.

___
Python tracker 

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



[issue39938] RotatingFileHandler does not support any other mode than 'a'.

2020-03-11 Thread Eric Govatos


New submission from Eric Govatos :

The RotatingFileHandler class located within lib/logging/handlers.py  does not 
accept any other 'mode' value than its default value of 'a' - even when the 
parameter is supplied, such as 'ab', to append bytes, this is disregarded and 
the mode is set back to 'a' if the maxBytes variable is greater than 0. 

While the reasoning behind this does make sense as the rotating file handler 
should only be appending data to files, this means that supplying a mode to 
append bytes is not supported. You can currently get around this by supplying 
the mode after constructing the handler.

Proposed solution would be to remove lines 146 and 147 from the class entirely 
and let the user decide on the file mode themselves.

--
components: Library (Lib)
messages: 363957
nosy: elgovatos
priority: normal
severity: normal
status: open
title: RotatingFileHandler does not support any other mode than 'a'.
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



[issue35712] Make NotImplemented unusable in boolean context

2020-03-11 Thread Ethan Furman


Ethan Furman  added the comment:

I know I'm late to the party, but if

  bool(NotImplemented)

returned `NotImplemented` wouldn't that solve the problem?

def __ge__(self, other):
return not self.__lt__(other)

then

   if __lt__ returns   then __gt__ returns

 NotImplemented  NotImplemented
 TrueFalse
 False   True

Correct code (which checks for NotImplemented) would still work, and buggy code 
(which just returns the bool() of NotImplemented), would then be correct.

--
nosy: +ethan.furman

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-11 Thread Stefan Krah


Stefan Krah  added the comment:

So which memoryview test (unless it is using the struct module)
relies on UB?

--

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-11 Thread Stefan Krah


Stefan Krah  added the comment:

Concerning memoryview, I've looked at this very briefly: memoryview
does not pack values directly, it casts first, which is legal:


#define PACK_SINGLE(ptr, src, type) \
do { \
type x;  \
x = (type)src;   \
memcpy(ptr, (char *), sizeof x);   \
} while (0)


This macro has exposed compiler bugs before.

--
nosy: +skrah

___
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-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

Yes, I can add a section explaining that after the PEP was accepted, we decided 
to add the operators to several non-dict mappings as well. I'm also going to 
add some explanation as to why Mapping/MutableMapping didn't grow them, too.

--

___
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-11 Thread STINNER Victor


STINNER Victor  added the comment:

Another approach to patch _aix_support.py, replace:

try:
import subprocess
_have_subprocess = True
_tmp_bd = 
_bgt = get_config_var("BUILD_GNU_TYPE")
except ImportError:  # pragma: no cover
_have_subprocess = False
_tmp_bd = None
_bgt = "powerpc-ibm-aix6.1.7.0"

with:

try:
import subprocess
_have_subprocess = True
_tmp_bd = get_config_var("AIX_BUILDDATE")
_bgt = get_config_var("BUILD_GNU_TYPE")
except ImportError:  # pragma: no cover
import _bootsubprocess as subprocess
_have_subprocess = True
_tmp_bd = None
_bgt = "powerpc-ibm-aix6.1.7.0"

Use _bootsubprocess when subprocess is not available. If this approach works, 
_have_subprocess=False code path can be removed.

--

___
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-11 Thread STINNER Victor


STINNER Victor  added the comment:

Michael.Felt: Can you please try to build the master branch of Python with the 
attached setup-aix.patch applied?

Something like:

git checkout master
git apply setup-aix.patch
./configure CFLAGS="-O0"
make 2>&1|tee make.log

Then attach make.log.

--
keywords: +patch
Added file: https://bugs.python.org/file48970/setup-aix.patch

___
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-11 Thread Michael Felt


Michael Felt  added the comment:

While looking through the history of bot builds - I consistently see 420 tests 
being done on one bot - but test_socket does not always show up in the list.

I'll look at this as I can, but "free-time" is limited. Delay is not a lack of 
interest.

--
nosy: +Michael.Felt

___
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-11 Thread Rahul Kumaresan


New submission from Rahul Kumaresan :

In the whatsnew section, under the point which mentions the deprecation of 
getchildren() and getiterator() through bpo-36543, it is suggested to use 
iter() instead.

Ideally there should be a suggestion to use Element.iter() instead.

--
assignee: docs@python
components: Documentation
messages: 363949
nosy: docs@python, rahul-kumi, xtreak
priority: normal
pull_requests: 18290
severity: normal
status: open
title: Suggest the usage of Element.iter() instead of iter() in whatsnew
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



[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-03-11 Thread Rahul Kumaresan


Change by Rahul Kumaresan :


--
nosy: +rahul-kumi
nosy_count: 3.0 -> 4.0
pull_requests: +18289
pull_request: https://github.com/python/cpython/pull/18937

___
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-11 Thread STINNER Victor


STINNER Victor  added the comment:

AIX_BUILDDATE variable is written in pyconfig.h by configure:

> https://buildbot.python.org/all/#/builders/119/builds/383

configure: "checking for the system builddate... 1806"

> https://buildbot.python.org/all/#/builders/119/builds/451

configure: "checking for the system builddate... 1806"

So AIX_BUILDDATE seems to be set in both case.

But on build 451, the "build/lib.aix-7100-9898-32-3.9-pydebug" directory name 
contains 9898: this number comes from _aix_support._MISSING_BD. It's used when 
_have_subprocess is false or when get_config_var("AIX_BUILDDATE") cannot be 
converted into an integer.

--

___
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-11 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10
nosy_count: 5.0 -> 6.0
pull_requests: +18288
pull_request: https://github.com/python/cpython/pull/18936

___
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-11 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-39936 "Python fails to build _asyncio on module on AIX" to debug 
the AIX build failure.

--

___
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-11 Thread STINNER Victor


New submission from STINNER Victor :

The commit 1ec63b62035e73111e204a0e03b83503e1c58f2e of bpo-39763 broke the 
Python compilation on AIX:
https://bugs.python.org/issue39763#msg363749

--

The last successful build was before the commit 
1ec63b62035e73111e204a0e03b83503e1c58f2e:
https://buildbot.python.org/all/#/builders/119/builds/383

_socket compilation:
(...) -o build/lib.aix-7100-9898-32-3.9-pydebug/_socket.so

pythoninfo:

sys.path: [
  '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build',
  
'/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/target/lib/python39.zip',
  '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib',
  
'/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/build/lib.aix-7100-9898-32-3.9-pydebug',
  '/home/buildbot/.local/lib/python3.9/site-packages']

Both steps use "build/lib.aix-7100-9898-32-3.9-pydebug/" directory.

--

Recent failure:
https://buildbot.python.org/all/#/builders/119/builds/451

_socket compilation:

(...) -o build/lib.aix-7104-1806-32-3.9-pydebug/_socket.so

pythoninfo:

sys.path: [
  '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build',
  
'/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/target/lib/python39.zip',
  '/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib',
  
'/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/build/lib.aix-7100-9898-32-3.9-pydebug',
  '/home/buildbot/.local/lib/python3.9/site-packages']

So the compilation uses "build/lib.aix-7104-1806-32-3.9-pydebug/" directory, 
whereas pythoninfo uses "build/lib.aix-7100-9898-32-3.9-pydebug/" directory.

It can explain why setup.py fails to import _socket later: it was built in a 
different directory.

--

I see that _aix_support._aix_bosmp64() has two code paths depending on the 
subprocess module can be imported:

# subprocess is not necessarily available early in the build process
# if not available, the config_vars are also definitely not available
# supply substitutes to bootstrap the build
try:
import subprocess
_have_subprocess = True
_tmp_bd = get_config_var("AIX_BUILDDATE")
_bgt = get_config_var("BUILD_GNU_TYPE")
except ImportError:  # pragma: no cover
_have_subprocess = False
_tmp_bd = None
_bgt = "powerpc-ibm-aix6.1.7.0"

def _aix_bosmp64():
# type: () -> Tuple[str, int]
"""
Return a Tuple[str, int] e.g., ['7.1.4.34', 1806]
The fileset bos.mp64 is the AIX kernel. It's VRMF and builddate
reflect the current ABI levels of the runtime environment.
"""
if _have_subprocess:
# We expect all AIX systems to have lslpp installed in this location
out = subprocess.check_output(["/usr/bin/lslpp", "-Lqc", "bos.mp64"])
out = out.decode("utf-8").strip().split(":")  # type: ignore
# Use str() and int() to help mypy see types
return str(out[2]), int(out[-1])
else:
from os import uname

osname, host, release, version, machine = uname()
return "{}.{}.0.0".format(version, release), _MISSING_BD

--

_aix_support._aix_bosmp64() is called by _aix_support.aix_platform() which is 
called by get_host_platform() of distutils.util.

Currently, setup.py does:

* Inject _bootsubprocess into sys.modules['subprocess'] so "import subprocess" 
works
* Build all C extensions
* Remove sys.modules['subprocess'], so the next "import subprocess" may or may 
not load Lib/subprocess.py which uses the newly built C extensions like 
_posixsubprocess and select
* Attempt to load C extensions: if an import fails, rename the file: it happens 
for _asyncio on AIX, that's the bug

--
components: Build
messages: 363946
nosy: vstinner
priority: normal
severity: normal
status: open
title: Python fails to build _asyncio on module on AIX
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



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

2020-03-11 Thread Michael Felt


Michael Felt  added the comment:

After a checkout the build finishes (successfully) with:
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_gdbm _lzma _sqlite3
_tkinter  _uuid readline
To find the necessary bits, look in setup.py in detect_modules() for the 
module's name.


The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  atexitpwd
time

running build_scripts
creating build/scripts-3.9
copying and adjusting /data/prj/python/git/python3-3.9/Tools/scripts/pydoc3 -> 
build/scripts-3.9
copying and adjusting /data/prj/python/git/python3-3.9/Tools/scripts/idle3 -> 
build/scripts-3.9
copying and adjusting /data/prj/python/git/python3-3.9/Tools/scripts/2to3 -> 
build/scripts-3.9
changing mode of build/scripts-3.9/pydoc3 from 644 to 755
changing mode of build/scripts-3.9/idle3 from 644 to 755
changing mode of build/scripts-3.9/2to3 from 644 to 755
renaming build/scripts-3.9/pydoc3 to build/scripts-3.9/pydoc3.9
renaming build/scripts-3.9/idle3 to build/scripts-3.9/idle3.9
renaming build/scripts-3.9/2to3 to build/scripts-3.9/2to3-3.9
/opt/bin/install -c -m 644 ../git/python3-3.9/Tools/gdb/libpython.py 
python-gdb.py
xlc_r -c  -DNDEBUG -O -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -I/opt/include 
-O2 -qmaxmem=-1 -qarch=pwr5-I../git/python3-3.9/Include/internal -IObjects 
-IInclude -IPython -I. -I../git/python3-3.9/Include -I/opt/include -I/op
t/include  -DPy_BUILD_CORE -o Programs/_testembed.o 
../git/python3-3.9/Programs/_testembed.c
../git/python3-3.9/Modules/makexp_aix Modules/python.exp . libpython3.9.a;  
xlc_r /opt/lib/libintl.a -L/opt/lib -liconv -lexpat /opt/lib/libintl.a 
-L/opt/lib -liconv -lexpat   -Wl,-bE:Modules/python.exp -lld -o 
Programs/_testembed
Programs/_testembed.o libpython3.9.a -lintl -ldl  -lm   -lm
sed -e "s,@EXENAME@,/opt/bin/python3.9," < 
../git/python3-3.9/Misc/python-config.in >python-config.py
LC_ALL=C sed -e 's,\$(\([A-Za-z0-9_]*\)),\$\{\1\},g' < Misc/python-config.sh 
>python-config

root@x065:[/data/prj/python/python3-3.9]./python
Python 3.9.0a4+ (tags/v3.9.0a4-59-gdffe4c0709-dirty:dffe4c0709, Mar 11 2020, 
17:09:06) [C] on aix
Type "help", "copyright", "credits" or "license" for more information.
>>>

--

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



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

2020-03-11 Thread miss-islington


miss-islington  added the comment:


New changeset c22879914b03ff2da768e557b5c00e9c8c62c695 by Miss Islington (bot) 
in branch '3.8':
bpo-39916: Use os.scandir() as context manager in Path.glob(). (GH-18880)
https://github.com/python/cpython/commit/c22879914b03ff2da768e557b5c00e9c8c62c695


--

___
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-11 Thread Michael Felt


Michael Felt  added the comment:

This was already confirmed by both bots...

The last bot build that worked (and for both AIX bots) is: 
dffe4c07095e0c693e094d3c140e85a68bd8128e

The first build that failed (for both) is: 
1ec63b62035e73111e204a0e03b83503e1c58f2e

See (pass) https://buildbot.python.org/all/#/builders/119/builds/383 and 
https://buildbot.python.org/all/#/builders/227/builds/369; fail 
https://buildbot.python.org/all/#/builders/119/builds/384
 and https://buildbot.python.org/all/#/builders/227/builds/370

I'll checkout dffe4c07095e0c693e094d3c140e85a68bd8128e to verify it still works 
successfully.

--

___
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-11 Thread miss-islington


miss-islington  added the comment:


New changeset b1b1d5ff11108620f5bc97976bb889f5cbb24373 by Miss Islington (bot) 
in branch '3.7':
bpo-39916: Use os.scandir() as context manager in Path.glob(). (GH-18880)
https://github.com/python/cpython/commit/b1b1d5ff11108620f5bc97976bb889f5cbb24373


--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 196f1eb6adcfc6a7239330ef508b8bf9dff9940f by Hai Shi in branch 
'master':
bpo-1635741: Fix refleaks of time module error handling (GH-18486)
https://github.com/python/cpython/commit/196f1eb6adcfc6a7239330ef508b8bf9dff9940f


--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Hai Shi for your 3 latest PRs, I merged them.

--

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

Stefan Behnel: as the 3rd author of the PEP 489, what's your call on this issue?

--
nosy: +scoder

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset aa0c0808efbfdee813d2829e49030c667da44e72 by Hai Shi in branch 
'master':
bpo-1635741: Fix potential refleaks in binascii module (GH-18613)
https://github.com/python/cpython/commit/aa0c0808efbfdee813d2829e49030c667da44e72


--

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-11 Thread STINNER Victor


STINNER Victor  added the comment:

> Proposed PR checking if the module state is NULL:
> 
> * PR 18358: _locale module
> * PR 18608: audioop module
> * PR 18613: binascii

Petr suggested to not hold these PRs with this controversial issue. I agree, so 
I merged these 3 PRs.

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 41fbf865a35d4fb64f047f98dc24690cb0c170fd by Hai Shi in branch 
'master':
bpo-1635741: Port audioop extension module to multiphase initialization (PEP 
489) (GH-18608)
https://github.com/python/cpython/commit/41fbf865a35d4fb64f047f98dc24690cb0c170fd


--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a158168a787e82c4b7b18f6833153188e93627a5 by Hai Shi in branch 
'master':
bpo-1635741: Port _locale extension module to multiphase initialization (PEP 
489) (GH-18358)
https://github.com/python/cpython/commit/a158168a787e82c4b7b18f6833153188e93627a5


--

___
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-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18287
pull_request: https://github.com/python/cpython/pull/18935

___
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-11 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +18286
pull_request: https://github.com/python/cpython/pull/18934

___
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-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 704e2065f8b8021a4a6999470fb6ed3453f7679e by Serhiy Storchaka in 
branch 'master':
bpo-39916: Use os.scandir() as context manager in Path.glob(). (GH-18880)
https://github.com/python/cpython/commit/704e2065f8b8021a4a6999470fb6ed3453f7679e


--

___
Python tracker 

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



[issue39935] argparse: help parameter not documented in add_subparsers().add_parser

2020-03-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +paul.j3, rhettinger
versions:  -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue38076] Make struct module PEP-384 compatible

2020-03-11 Thread Petr Viktorin


Change by Petr Viktorin :


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



[issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever()

2020-03-11 Thread Ama Aje My Fren


Change by Ama Aje My Fren :


--
pull_requests: +18285
pull_request: https://github.com/python/cpython/pull/18933

___
Python tracker 

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



[issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever()

2020-03-11 Thread Ama Aje My Fren


Change by Ama Aje My Fren :


--
pull_requests: +18284
pull_request: https://github.com/python/cpython/pull/18932

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +berker.peksag, ghaering

___
Python tracker 

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



[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-11 Thread Petr Viktorin


Petr Viktorin  added the comment:

Oh! I just reead the docs more carefully; they say:

For the '?' format character, the return value is either True or False. When 
packing, the truth value of the argument object is used. Either 0 or 1 in the 
native or standard bool representation will be packed, and any non-zero value 
will be True when unpacking.

--

___
Python tracker 

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



[issue39935] argparse: help parameter not documented in add_subparsers().add_parser

2020-03-11 Thread Nazime Koussaila Lakehal


New submission from Nazime Koussaila Lakehal :

The parameter help in the method add_parser of _SubParsersAction (that we 
obtain with ArgumentParser.add_subparsers()) Is not documented.

In the documentation we can find:
The add_subparsers() method is normally called with no arguments and returns a 
special action object. This object has a single method, add_parser(), which 
takes a command name and any ArgumentParser constructor arguments, and returns 
an ArgumentParser object that can be modified as usual.

I found the parameter by accident and then I checked in the source code, it's 
unfortunate because the help parameter give really nice output when having sub 
commands.

the parameter 'aliases' is also not documented.

--
assignee: docs@python
components: Documentation
messages: 363932
nosy: Nazime Koussaila Lakehal, docs@python
priority: normal
severity: normal
status: open
title: argparse: help parameter not documented in add_subparsers().add_parser
type: enhancement
versions: Python 2.7, Python 3.5, 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



  1   2   >