[issue40037] py_compile.py quiet undefined in main function

2020-03-31 Thread Georgy Kibardin


Georgy Kibardin  added the comment:

https://bugs.python.org/issue39743 is closed as duplicate of 
https://bugs.python.org/issue38731. 

https://bugs.python.org/issue38731 fixes undeclared variable "quiet" in 
function compile().
At the same time variable "quiet" is used in function main() where it is still 
undeclared and 38731 doesn't fix this problem - it is still there, in python 
3.8.2.

--

___
Python tracker 

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



[issue39865] getattr silences an unrelated AttributeError

2020-03-31 Thread Ammar Askar


Ammar Askar  added the comment:

As unfortunate as this is, I don't think there's an easy way to solve this 
while adhering to descriptors and the attribute lookup model. This is a 
consequence of the following rule:

> object.__getattr__(self, name):
>   Called when the default attribute access fails with an
>   AttributeError (either __getattribute__() raises an AttributeError
>   because name is not an instance attribute or an attribute in the
>   class tree for self; or __get__() of a name property raises
>   AttributeError)

As it notes, if the __get__() raises an AttributeError then a fallback to 
__getattr__ is initiated. One may think that maybe we can just catch 
AttributeError in @property to try to fix this problem but a quick search shows 
that people do intentionally raise AttributeError in @property methods:

* 
https://github.com/kdschlosser/EventGhost-TPLink/blob/a4a642fde8dd4deba66262a36d673cbbf71b8ceb/TPLink/tp_link/rule.py#L148-L152

* 
https://github.com/ajayau404/sniffer/blob/cd0c813b8b526a3c791735a41b13c7677eb4aa0e/lib/python3.5/site-packages/vpython/vpython.py#L1942-L1944

While this in combination with a __getattr__ is rare, I was able to find one 
example:

* 
https://github.com/xrg/behave_manners/blob/19a5feb0b67fe73cd902a959f0d038b905a69b38/behave_manners/context.py#L37

I don't think that changing this behavior is acceptable as people might be 
relying on it and it's well documented.


In your case, I think it's really the "catch-all" __getattr__ that's at fault 
here which really shouldn't be returning None for all attributes blindly. This 
does bring up a good point though that in the process of this fall-back 
behavior, the original AttributeError from A's property does get masked. What 
can be done and might be a good idea is to show the original AttributeError 
failure as the cause for the second. Something like this:

  Traceback (most recent call last):
File "", line 2, in 
File "", line 5, in myprop
  AttributeError: 'int' object has no attribute 'foo'

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
File "", line 7, in 
File "", line 5, in 
File "", line 7, in __getattr__
  AttributeError: not found in __getattr__

This at least somewhat indicates that the original descriptor __get__ failed 
and then __getattr__ also raised. As opposed to now where the original 
exception gets masked:

  >>> class A:
  ...   @property
  ...   def myprop(self):
  ... a = 1
  ... a.foo
  ...   def __getattr__(self, attr_name):
  ... raise AttributeError("not found in __getattr__")
  ...
  >>> a = A()
  >>> a.myprop
  Traceback (most recent call last):
File "", line 1, in 
File "", line 7, in __getattr__
  AttributeError: not found in __getattr__

I'm gonna take a stab at implementing this real quick to see if it's actually 
useful and viable.

--
nosy: +ammar2

___
Python tracker 

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



[issue40037] py_compile.py quiet undefined in main function

2020-03-31 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

There is PR https://github.com/python/cpython/pull/17134 which is not merged to 
fix the exception so this is not fixed for 3.8.2. Once the fix is applied and 
released you can test the same

--

___
Python tracker 

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



[issue40123] append() works not correct

2020-03-31 Thread merli


New submission from merli :

Please try out and look bug in this example:

Liste   = []
StringL = ["Nr.:", "NR", "Bielefeld", "Paderborn", "Lemgo"]
for i in range (10):
StringL[1] = str(i)
Liste.append(StringL)
print (StringL)
#print (Liste)
print ()

print()
for i in range (10):
print (Liste[i])

--
messages: 365371
nosy: merli
priority: normal
severity: normal
status: open
title: append() works not correct
type: behavior
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



[issue40123] append() works not correct

2020-03-31 Thread merli


merli  added the comment:

Output:

['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo']
['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo']
['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo']
['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo']
['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo']
['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo']
['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo']
['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo']
['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo']
['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo']

--

___
Python tracker 

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



[issue40123] append() works not correct

2020-03-31 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi merli, there is no bug here, you always append the same list to Liste so 
when modifying it you override previous values. You could make a copy of it by 
using `Liste.append(list(StringL))` instead of `Liste.append(StringL)` and you 
would get the behaviour you expect.


Please ask questions in python-help or in StackOverflow for questions related 
to Python usage.

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue40123] append() works not correct

2020-03-31 Thread Steven D'Aprano


Change by Steven D'Aprano :


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

___
Python tracker 

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



[issue40122] The implementation and documentation of "dis.findlables" don't match

2020-03-31 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

dis.findlabels() always worked with a byte code. And the docstring correctly 
describes this.

I think this is a documentation issue. The documentation fix should be 
backported to all maintained Python versions.

If you want to make dis.findlabels() accepting a code object, it would be a new 
feature and it may be only added in future Python release (3.9). It needs a 
separate issue. In any case the documentation bug should be fixed in maintained 
versions.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
stage:  -> needs patch
type:  -> behavior
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



[issue40117] __round__ doesn't behave well with return NotImplemented

2020-03-31 Thread Mark Dickinson


Mark Dickinson  added the comment:

Agreed with Eric and Serhiy. This seems to be a misunderstanding about the 
scope of NotImplemented.

@Hameer Abbasi: if you have an example of a problem that would be solved by 
this behaviour change, and which can't be solved simply by raising TypeError or 
another exception within __round__, feel free to open a discussion on the 
python-ideas mailing list.

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

___
Python tracker 

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



[issue38884] __import__ is not thread-safe on Python 3

2020-03-31 Thread Geoffrey Bache


Change by Geoffrey Bache :


--
nosy: +gjb1002

___
Python tracker 

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



[issue40108] Improve error message for -m option when .py is present

2020-03-31 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue40108] Improve error message for -m option when .py is present

2020-03-31 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset ef67512b40240f765026ad41d60b0c9a6dacd2b9 by Pablo Galindo in 
branch 'master':
bpo-40108: Improve the error message in runpy when importing a module that 
includes the extension (GH-19239)
https://github.com/python/cpython/commit/ef67512b40240f765026ad41d60b0c9a6dacd2b9


--

___
Python tracker 

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



[issue38633] shutil.copystat fails with PermissionError in WSL

2020-03-31 Thread Ben Spiller


Ben Spiller  added the comment:

Looks like on WSL the errno is errno.EACCES rather than EPERM, so we just need 
to change the shutil._copyxattr error handler to also cope with that error code:

 except OSError as e:
- if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA):
+ if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA, 
errno.EACCES):
 raise

If anyone needs a workaround until this is fixed in shutil itself, you can do 
it by monkey-patching _copyxattr:

import errno, shutil
# have to monkey patch to work with WSL as workaround for 
https://bugs.python.org/issue38633
orig_copyxattr = shutil._copyxattr
def patched_copyxattr(src, dst, *, follow_symlinks=True):
try:
orig_copyxattr(src, dst, follow_symlinks=follow_symlinks)
except OSError as ex:
if ex.errno != errno.EACCES: raise
shutil._copyxattr = patched_copyxattr

--
nosy: +benspiller

___
Python tracker 

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



[issue40124] Clearer assertion error

2020-03-31 Thread Phil


New submission from Phil :

https://discuss.python.org/t/assertionerror-asyncio-streams-in-drain-helper/3743/4

I recently came across this error, which I now know how to fix. I think the 
error can be clearer and I've a PR which I think does so.

--
components: asyncio
messages: 365378
nosy: asvetlov, pgjones, yselivanov
priority: normal
severity: normal
status: open
title: Clearer assertion error
versions: 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



[issue40124] Clearer assertion error

2020-03-31 Thread Phil


Change by Phil :


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

___
Python tracker 

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



[issue40121] socket module missing audit events

2020-03-31 Thread Steve Dower


Steve Dower  added the comment:


New changeset 63ba5cccf484b9ec23dfbf4cf7ffdc833eda98c3 by Steve Dower in branch 
'master':
bpo-40121: Fixes audit event raised on creating a new socket (GH-19238)
https://github.com/python/cpython/commit/63ba5cccf484b9ec23dfbf4cf7ffdc833eda98c3


--

___
Python tracker 

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



[issue40121] socket module missing audit events

2020-03-31 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40121] socket module missing audit events

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



[issue40121] socket module missing audit events

2020-03-31 Thread miss-islington


miss-islington  added the comment:


New changeset 6a0ee60db4cee4a01bae1a2922d21a859e9ea2ed by Miss Islington (bot) 
in branch '3.8':
bpo-40121: Fixes audit event raised on creating a new socket (GH-19238)
https://github.com/python/cpython/commit/6a0ee60db4cee4a01bae1a2922d21a859e9ea2ed


--

___
Python tracker 

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



[issue40124] Clearer assertion error

2020-03-31 Thread Eric V. Smith


Eric V. Smith  added the comment:

Do we really want this to be just an assert, or do we want to raise another 
type of exception? I think it's showing a real programming error that we 
wouldn't want to throw away with -O.

--
nosy: +eric.smith

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


Change by Dong-hee Na :


--
pull_requests: +18601
pull_request: https://github.com/python/cpython/pull/19242

___
Python tracker 

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



[issue40122] The implementation and documentation of "dis.findlables" don't match

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



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

2020-03-31 Thread miss-islington


miss-islington  added the comment:


New changeset 0f9e889cd94c1e86f8ff28733b207c99803ca8a4 by Miss Islington (bot) 
in branch '3.7':
bpo-39689: Do not use native packing for format "?" with standard size 
(GH-18969)
https://github.com/python/cpython/commit/0f9e889cd94c1e86f8ff28733b207c99803ca8a4


--

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


miss-islington  added the comment:


New changeset 572ef747692055a270a9fbf8eeaf5c4a15c8e332 by Miss Islington (bot) 
in branch '3.8':
bpo-39689: Do not use native packing for format "?" with standard size 
(GH-18969)
https://github.com/python/cpython/commit/572ef747692055a270a9fbf8eeaf5c4a15c8e332


--

___
Python tracker 

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



[issue40121] socket module missing audit events

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

s390x Fedora 3.x buildbot is unhappy:
https://buildbot.python.org/all/#/builders/336/builds/328

==
FAIL: test_socket (test.test_audit.AuditTest)
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/test_audit.py",
 line 125, in test_socket
self.fail(stderr)
AssertionError

Stderr:
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/audit-tests.py",
 line 345, in test_socket
sock.bind(('127.0.0.1', 8080))
OSError: [Errno 98] Address already in use

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/audit-tests.py",
 line 358, in 
globals()[test]()
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/audit-tests.py",
 line 346, in test_socket
except error:
NameError: name 'error' is not defined

--

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
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-31 Thread Petr Viktorin


Petr Viktorin  added the comment:

The change to dict() was not covered by the smaller PRs.
That one will need more thought, but AFAIK it wasn't yet rejected.

--
status: closed -> open

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


STINNER Victor  added the comment:

Oh sorry, I missed the dict.

--
resolution: fixed -> 

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


STINNER Victor  added the comment:


New changeset 1cb763b8808745b9a368c1158fda19d329f63f6f by Dong-hee Na in branch 
'master':
bpo-1635741: Port _uuid module to multiphase initialization (GH-19242)
https://github.com/python/cpython/commit/1cb763b8808745b9a368c1158fda19d329f63f6f


--

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


Change by Dong-hee Na :


--
pull_requests: +18602
pull_request: https://github.com/python/cpython/pull/19243

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18603
pull_request: https://github.com/python/cpython/pull/19244

___
Python tracker 

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



[issue40003] test.regrtest: add an option to run test.bisect_cmd on failed tests, use it on Refleaks buildbots

2020-03-31 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2020-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner
nosy_count: 6.0 -> 7.0
pull_requests: +18605
pull_request: https://github.com/python/cpython/pull/19247

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


STINNER Victor  added the comment:


New changeset 5be8241392453751beea21d2e32096c15a8d47db by Dong-hee Na in branch 
'master':
bpo-1635741: Port math module to multiphase initialization (GH-19243)
https://github.com/python/cpython/commit/5be8241392453751beea21d2e32096c15a8d47db


--

___
Python tracker 

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



[issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f

2020-03-31 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
assignee: christian.heimes
components: SSL
nosy: benjamin.peterson, christian.heimes
priority: normal
severity: normal
status: open
title: update OpenSSL 1.1.1 in multissltests.py to 1.1.1f
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



[issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f

2020-03-31 Thread Christian Heimes


New submission from Christian Heimes :

+1

I usually update all version to latest patch and backport the change to active 
branches.

--

___
Python tracker 

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



[issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f

2020-03-31 Thread Benjamin Peterson


Change by Benjamin Peterson :


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



[issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f

2020-03-31 Thread Benjamin Peterson


Change by Benjamin Peterson :


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

___
Python tracker 

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



[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2020-03-31 Thread Mark Shannon


Mark Shannon  added the comment:

You can't end up with a growing set of keys.
The problem is to do with the *order* of insertion, not the number of keys.

--

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8d84adcd736619c2ce510dff1e7ffd3ab08df06a by Victor Stinner in 
branch 'master':
bpo-32591: _PyErr_WarnUnawaitedCoroutine() sets source (GH-19247)
https://github.com/python/cpython/commit/8d84adcd736619c2ce510dff1e7ffd3ab08df06a


--

___
Python tracker 

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



[issue40003] test.regrtest: add an option to run test.bisect_cmd on failed tests, use it on Refleaks buildbots

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 01e743d704aeefd1c1825a6a96d0c766c5516fb1 by Victor Stinner in 
branch 'master':
bpo-40003: test.bisect_cmd copies Python options (GH-19246)
https://github.com/python/cpython/commit/01e743d704aeefd1c1825a6a96d0c766c5516fb1


--

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread Eryk Sun


Eryk Sun  added the comment:

> On Windows, os.waitpid() status also requires an operation (shif 
> right by 8 bits) to get an exitcode from the waitpid status. 

FWIW, I wouldn't recommend relying on os.waitpid to get the correct process 
exit status in Windows. Status codes are 32 bits and generally all bits are 
required. os.waitpid left shifts the exit status by 8 bits in a dubious attempt 
to return a result that's "more like the POSIX waitpid". In particular, a 
program may exit abnormally with an NTSTATUS [1] or HRESULT [2] code such as 
STATUS_DLL_NOT_FOUND (0xC000_0135) or STATUS_CONTROL_C_EXIT (0xC000_013A).

[1]: 
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/87fba13e-bf06-450e-83b1-9241dc81e781
[2]: 
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a

--
nosy: +eryksun

___
Python tracker 

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



[issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f

2020-03-31 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset cd16661f903153ecac55f190ed682e576c5deb24 by Benjamin Peterson in 
branch 'master':
closes bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. (GH-19248)
https://github.com/python/cpython/commit/cd16661f903153ecac55f190ed682e576c5deb24


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



[issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f

2020-03-31 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f

2020-03-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18608
pull_request: https://github.com/python/cpython/pull/19250

___
Python tracker 

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



[issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f

2020-03-31 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
pull_requests: +18609
pull_request: https://github.com/python/cpython/pull/19251

___
Python tracker 

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



[issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f

2020-03-31 Thread miss-islington


miss-islington  added the comment:


New changeset 9073f9272475be620c09b2852c094788b2b7096a by Miss Islington (bot) 
in branch '3.7':
closes bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. (GH-19248)
https://github.com/python/cpython/commit/9073f9272475be620c09b2852c094788b2b7096a


--

___
Python tracker 

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



[issue40126] Incorrect error handling in unittest.mock

2020-03-31 Thread Barry McLarnon


New submission from Barry McLarnon :

The error handling in mock.decorate_callable (3.5-3.7) and 
mock.decoration_helper (3.8-3.9) is incorrectly implemented. If the error 
handler is triggered in the loop, the `patching` variable is out of scope and 
raises an unhandled `UnboundLocalError` instead.

This happened as a result of a 3rd-party library that attempts to clear the 
`patchings` list of a decorated function. The below code shows a recreation of 
the incorrect error handling:

import functools
from unittest import mock


def is_valid():
return True


def mock_is_valid():
return False


def decorate(f):
@functools.wraps(f)
def decorate_wrapper(*args, **kwargs):
# This happens in a 3rd-party library
f.patchings = []
return f(*args, **kwargs)

return decorate_wrapper


@decorate
@mock.patch('test.is_valid', new=mock_is_valid)
def test_patch():
raise Exception()

--
components: Tests
messages: 365395
nosy: bmclarnon
priority: normal
severity: normal
status: open
title: Incorrect error handling in unittest.mock
type: behavior
versions: 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



[issue40125] update OpenSSL 1.1.1 in multissltests.py to 1.1.1f

2020-03-31 Thread miss-islington


miss-islington  added the comment:


New changeset fb6e04b5f10086194bcc77d571f77cb30873998b by Miss Islington (bot) 
in branch '3.8':
closes bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. (GH-19248)
https://github.com/python/cpython/commit/fb6e04b5f10086194bcc77d571f77cb30873998b


--

___
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-31 Thread hai shi


Change by hai shi :


--
pull_requests: +18610
pull_request: https://github.com/python/cpython/pull/19252

___
Python tracker 

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



[issue40127] Documentation of SSL library

2020-03-31 Thread Christophe Nanteuil


New submission from Christophe Nanteuil :

For the ssl.create_default_context() function, it states that, "if cafile, 
capath and cadata are None, the function *can* choose to trust the system's 
default CA certificates instead".
This statement is not clear as, if the values are None, there is no choice and 
the only elements available are system's default CA.
AFAIK, if the values are not None, it will not fall back to system's default CA 
even if the given CA does not match.
I propose to modify the end of the sentence with "the function trusts the 
system's default CA certificates instead".

--
assignee: docs@python
components: Documentation
messages: 365398
nosy: Christophe Nanteuil, docs@python
priority: normal
severity: normal
status: open
title: Documentation of SSL library
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



[issue40127] Documentation of SSL library

2020-03-31 Thread Christophe Nanteuil


Change by Christophe Nanteuil :


--
type:  -> enhancement

___
Python tracker 

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



[issue40120] Undefined C behavior going beyond end of struct via a char[1].

2020-03-31 Thread Sam Gross


Sam Gross  added the comment:

It may be worth considering C-API extensions written in C++. Flexible array 
members are not part of the C++ standard, although GCC, Clang, and MSVC support 
them as an extension. GCC and Clang will issue warnings with `-Wpedantic` and 
MSVC will issue warnings with `/Wall`. Currently, C++ code that includes 
`` is warning-free in GCC (g++) even with `-Wpedantic`. That won't be 
true after this change, unless Py_LIMITED_API is defined.

Note that GCC also explicitly supports trailing one-element arrays (the current 
pattern) as an extension. https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html

--
nosy: +colesbury

___
Python tracker 

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



[issue40127] Documentation of SSL library

2020-03-31 Thread Christophe Nanteuil


Change by Christophe Nanteuil :


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

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18612
pull_request: https://github.com/python/cpython/pull/19254

___
Python tracker 

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



[issue40019] test_gdb should better detect when Python is optimized

2020-03-31 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40019] test_gdb should better detect when Python is optimized

2020-03-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18614
pull_request: https://github.com/python/cpython/pull/19256

___
Python tracker 

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



[issue40019] test_gdb should better detect when Python is optimized

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

We have this issue in Fedora Rawhide. test_gdb of Python 3.8 fails on s390x and 
armv7hl architectures with GCC 10:
https://bugzilla.redhat.com/show_bug.cgi?id=1818857

I tested manually that my change fix test_gdb: tests are skipped as expected:
https://src.fedoraproject.org/rpms/python3/pull-request/182

So I backported the change to 3.7 and 3.8.

This change only fix test_gdb. To get a fully working python-gdb.py, IMHO the 
best is to disable all compiler optimization using -O0 optimization level.

--

___
Python tracker 

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



[issue40128] IDLE Show completions/ autocomplete pop-up not working

2020-03-31 Thread Arthur


New submission from Arthur :

Hi,
I am new to python, I am learning it now. In the course the guy is using 
autocomplete and when he writes "math." he gets an autocomplete menu. on my 
device for some reason it is not working. I also tried the key combination to 
force pop-up but nothing happens.
I am running macOSx Catalina 10.15.2 and IDLE 3.8.2 
P.s. I reinstalled IDLE, nothing changed.

--
assignee: terry.reedy
components: IDLE
messages: 365401
nosy: darthur90, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE Show completions/ autocomplete pop-up not working
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



[issue40127] Documentation of SSL library

2020-03-31 Thread Christian Heimes


Christian Heimes  added the comment:

There are choices beyond our control. For example the operating system may not 
have a usable trust store. OpenSSL's builtin paths may not be correctly 
configured to locate the trust store. The user may have configured her/his 
environment to load other or no CA certs.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue40120] Undefined C behavior going beyond end of struct via a char[1].

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

> Currently, C++ code that includes `` is warning-free in GCC (g++) 
> even with `-Wpedantic`. That won't be true after this change, unless 
> Py_LIMITED_API is defined.

By the way, the current trend is to make more and more structures opaque in the 
C API. See for example:

* bpo-39573: Make PyObject an opaque structure in the limited C API
* bpo-39947: Make the PyThreadState structure opaque (move it to the internal C 
API)

--

___
Python tracker 

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



[issue40019] test_gdb should better detect when Python is optimized

2020-03-31 Thread miss-islington


miss-islington  added the comment:


New changeset 4ced9a7611ddfd923bd8f72aa61121d0e5aeb8fc by Miss Islington (bot) 
in branch '3.8':
bpo-40019: Skip test_gdb if Python was optimized (GH-19081)
https://github.com/python/cpython/commit/4ced9a7611ddfd923bd8f72aa61121d0e5aeb8fc


--

___
Python tracker 

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



[issue40019] test_gdb should better detect when Python is optimized

2020-03-31 Thread miss-islington


miss-islington  added the comment:


New changeset a764a1cc663708361300cdf88fcf697633142319 by Miss Islington (bot) 
in branch '3.7':
bpo-40019: Skip test_gdb if Python was optimized (GH-19081)
https://github.com/python/cpython/commit/a764a1cc663708361300cdf88fcf697633142319


--

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

Eryk:
> FWIW, I wouldn't recommend relying on os.waitpid to get the correct process 
> exit status in Windows. Status codes are 32 bits and generally all bits are 
> required. os.waitpid left shifts the exit status by 8 bits in a dubious 
> attempt to return a result that's "more like the POSIX waitpid". In 
> particular, a program may exit abnormally with an NTSTATUS [1] or HRESULT [2] 
> code such as STATUS_DLL_NOT_FOUND (0xC000_0135) or STATUS_CONTROL_C_EXIT 
> (0xC000_013A).

os.waitpid() calls _cwait() on Windows and uses "status << 8".

The result is a Python object. IMHO it's ok if the shifted result ("status") is 
larger than 32 bits. But I'm not sure that the current os.waitpid() 
implementation handles integer overflow correctly...

When I look at GetExitCodeProcess() documentation, I don't see any distinction 
between "normal exit" and a program terminated by TerminateProcess(). The only 
different is the actual exit code:
https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess

Do you suggest that os.waitstatus_to_exitcode() result should be negative if a 
process was terminated by TerminateProcess()?

--

My PR 19201 is based on the current Python implementation and assumptions used 
in the current code. But I don't think that what you wrote can be an API issue. 
It's more the opposite, if tomorrow we want to encode the status of a 
terminated process differently, it will be easier if 
os.waitstatus_to_exitcode() is available, no?

--

___
Python tracker 

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



[issue40019] test_gdb should better detect when Python is optimized

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, test_gdb should now be more reliable with various compilers and compiler 
optimization levels.

I chose to not skip a test if '' is found in the gdb output. If 
it becomes an issue, test_gdb can easily be modified to also be skipped in this 
case.

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



[issue40127] Documentation of SSL library

2020-03-31 Thread Christophe Nanteuil


Christophe Nanteuil  added the comment:

Thanks for clarifying the choice. I understand that we could state :
" if cafile ... are None, the function falls back to user/system configuration 
(which is beyond this documentation)."

--

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 278c1e159c970da6cd6683d18c6211f5118674cc by Victor Stinner in 
branch 'master':
bpo-40094: Add test.support.wait_process() (GH-19254)
https://github.com/python/cpython/commit/278c1e159c970da6cd6683d18c6211f5118674cc


--

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18615
pull_request: https://github.com/python/cpython/pull/19259

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18616
pull_request: https://github.com/python/cpython/pull/19260

___
Python tracker 

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



[issue40120] Undefined C behavior going beyond end of struct via a char[1].

2020-03-31 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

"""
The [1] thing is used in more places:

 PyObject *f_localsplus[1]; in PyFrameObject
 PyObject *ob_item[1]; in PyTupleObject
 void *elements[1]; in asdl_seq and int elements[1];` in asdl_int_seq
 digit ob_digit[1]; in PyLongObject
 Py_ssize_t ob_array[1]; in PyMemoryViewObject
 _tracemalloc.c: frame_t frames[1]; in traceback_t

Do we need to update all of them? Do you want to update them all?
""" - vstinner

I believe we probably do.  But I suggest multiple PRs.  I'll update the issue 
title.

I'm also going to ask clang/llvm folks that prompted me to look into this for 
comments.

--

___
Python tracker 

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



[issue40120] Undefined C behavior going beyond end of struct via a [1] arrays.

2020-03-31 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
stage: patch review -> needs patch

___
Python tracker 

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



[issue40120] Undefined C behavior going beyond end of struct via a [1] arrays.

2020-03-31 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
title: Undefined C behavior going beyond end of struct via a char[1]. -> 
Undefined C behavior going beyond end of struct via a [1] arrays.

___
Python tracker 

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



[issue40098] dir() does not return the list of valid attributes for the object

2020-03-31 Thread Vedran Čačić

Vedran Čačić  added the comment:

Guido wrote:

>>> t = list[int]

A few years ago, I tried to explain to you that it's much more intuitive to use 
builtin types instead of their alter egos from typing (List etc.) for [] 
operator, you said it's not important. It's funny that you've implicitly 
acknowledged what I said through this typo. ;-)

--
nosy: +veky

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 27c6231f5827fe17c6cb6f097391931f30b511ec by Victor Stinner in 
branch 'master':
bpo-40094: Enhance fork and wait tests (GH-19259)
https://github.com/python/cpython/commit/27c6231f5827fe17c6cb6f097391931f30b511ec


--

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a9f9687a7ce25e7c0c89f88f52db323104668ae0 by Victor Stinner in 
branch 'master':
bpo-40094: Enhance threading tests (GH-19260)
https://github.com/python/cpython/commit/a9f9687a7ce25e7c0c89f88f52db323104668ae0


--

___
Python tracker 

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



[issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

Fixed by 
https://github.com/python/cpython/commit/a9f9687a7ce25e7c0c89f88f52db323104668ae0

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



[issue40120] Undefined C behavior going beyond end of struct via a [1] arrays.

2020-03-31 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I concur with Sam that we should keep compatibility with C++ in header files.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40098] dir() does not return the list of valid attributes for the object

2020-03-31 Thread Guido van Rossum


Guido van Rossum  added the comment:

> >>> t = list[int]
>
> A few years ago, I tried to explain to you that it's much more intuitive
> to use builtin types instead of their alter egos from typing (List etc.)
> for [] operator, you said it's not important. It's funny that you've
> implicitly acknowledged what I said through this typo. ;-)

It wasn't a typo. See PEPE 585. Its time for this change *now*. It wasn't 
*then*.

--

___
Python tracker 

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



[issue40098] dir() does not return the list of valid attributes for the object

2020-03-31 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

5. dir(module) does not contain module type attributes (in contrary to dir() 
for regular object).

>>> import keyword
>>> dir(keyword)
['__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', 
'__name__', '__package__', '__spec__', 'iskeyword', 'kwlist']
>>> sorted(object.__dir__(keyword))
['__all__', '__builtins__', '__cached__', '__class__', '__delattr__', 
'__dict__', '__dir__', '__doc__', '__eq__', '__file__', '__format__', '__ge__', 
'__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', 
'__le__', '__loader__', '__lt__', '__name__', '__ne__', '__new__', 
'__package__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', 
'__sizeof__', '__spec__', '__str__', '__subclasshook__', 'iskeyword', 'kwlist']

Seems dir() was initially designed for old-style objects and many changes in 
object model were passed its.

On one hand, it would look logical if dir() returned the list of all names that 
can be used as attributes. But my concerns are that it may add a "noise", names 
which can be legally used as attribute names, but which are rarely accessed as 
instance attribute instead of type attributes. This applies to 1 (metaclasses) 
and 5 (module type).

If left out 1 and 5 and implement all other options (and I remind that it 
simplifies the code), it will only break one test for unittest.mock. I'm 
exploring what's going on there.

--

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


Serhiy Storchaka  added the comment:


New changeset 2c003eff8fef430f1876adf88e466bcfcbd0cc9e by Serhiy Storchaka in 
branch 'master':
bpo-39943: Clean up marshal.c. (GH-19236)
https://github.com/python/cpython/commit/2c003eff8fef430f1876adf88e466bcfcbd0cc9e


--

___
Python tracker 

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



[issue40098] dir() does not return the list of valid attributes for the object

2020-03-31 Thread Guido van Rossum


Guido van Rossum  added the comment:

For me, one of the most annoying things about dir() is that it gives all the 
dunders. There are many dunders that are just always there (__class__, mostly 
__dict__, __doc__, __name__ etc.). I wish it would just not give dunders that 
are inherited from object or type. Though it's probably too late for that 
(people's code might break).

--

___
Python tracker 

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



[issue40098] dir() does not return the list of valid attributes for the object

2020-03-31 Thread Vedran Čačić

Vedran Čačić  added the comment:

Guido:

First, wow!

Second, now it's even more glaring that list[str] has repr 'list[str]', while 
list doesn't have a repr 'list'. :-( Is it possible that the time for _that_ 
change will also come some day? :-)

Third, my problem with dir is not dunders, but dunders that really shouldn't be 
there. For example, __le__ when type doesn't support ordering. I understand how 
that happens, but it doesn't mean it isn't a bug.

--

___
Python tracker 

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



[issue29418] inspect.isroutine does not return True for some bound builtin methods

2020-03-31 Thread Hakan


Change by Hakan :


--
keywords: +patch
nosy: +hakancelik
nosy_count: 3.0 -> 4.0
pull_requests: +18617
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19261

___
Python tracker 

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



[issue40020] growable_comment_array_add leaks, causes crash

2020-03-31 Thread Alexander Riccio


Alexander Riccio  added the comment:

Sure, should I open a new issue?

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



[issue40129] Add test classes for custom __index__, __int__, __float__ and __complex__

2020-03-31 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

There are many tests for int-like objects (which implement custom __index__ or 
__int__ methods) in different files. There are less tests for float-like 
objects (with the __float__ method). There are even tests for complex-like 
(with the __complex__ method) in different files. To simplify maintaining old 
tests and adding new tests I propose to add general test classes with custom 
methods __index__, __int__, __float__ or __complex__ which return the specified 
value or raise an exception. There is already one similar general class: 
FakePath.

It could be done using unittest.mock, but Mock objects are much more complex 
and has too much magic, so they can have different behavior than simpler 
classes with a single special method.

--
components: Tests
messages: 365422
nosy: mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Add test classes for custom __index__, __int__, __float__ and __complex__
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



[issue40098] dir() does not return the list of valid attributes for the object

2020-03-31 Thread Guido van Rossum


Guido van Rossum  added the comment:

Vedran, please stay on topic for this issue.

FWIW I agree that it would be best if dir() showed only those dunders that are 
significant. E.g. __eq__ should only be shown if it is overridden by a subclass.

Serhiy did you see my feedback on 3 and 4?

--

___
Python tracker 

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



[issue40129] Add test classes for custom __index__, __int__, __float__ and __complex__

2020-03-31 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31160] Enhance support.reap_children()

2020-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18619
pull_request: https://github.com/python/cpython/pull/19263

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18620
pull_request: https://github.com/python/cpython/pull/19263

___
Python tracker 

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



[issue40068] test_threading: ThreadJoinOnShutdown.test_reinit_tls_after_fork() crash with Python 3.8 on AIX

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

> Fixed by 
> https://github.com/python/cpython/commit/a9f9687a7ce25e7c0c89f88f52db323104668ae0

Ooops, sorry. Only PR 19200 is fixed by this commit.

But this issue is made of 3 bugs. I prefer to leave it open until the 3 bugs 
are fixed.

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

___
Python tracker 

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



[issue40120] Undefined C behavior going beyond end of struct via a [1] arrays.

2020-03-31 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Isn't the only actual way for a C .h file to be compatible with C++ via

extern "C" {
}

which all of our non-meta include files appear to have already?

--

___
Python tracker 

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



[issue40098] dir() does not return the list of valid attributes for the object

2020-03-31 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If using __class__ and __dict__ attribuites is a feature, it does not work for 
__getattr__(). I think it is confusing if __dir__() and __getattr__() are not 
consistent. I'll try to deal with unittes.mock and then will look how this will 
work with other classes that override __class__ or __dict__. Also we need to 
check all classes with custom __getattr__ for the matter of custom __dir__.

I think that it might be better if dir() for instance excluded names which are 
not accessed as via instance, e.g. non-descriptor class attributes and class 
methods. But it may be not easy to do.

--

___
Python tracker 

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



[issue40130] Remove _PyUnicode_AsKind from private C API

2020-03-31 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

_PyUnicode_AsKind is exposed as private C API. It is only used in 
unicodeobject.c, where it is defined. Its name starts with an underscore, it is 
not documented and not included in PC/python3.def (therefore is not exported on 
Windows). Seems it is not used in third party code (I have not found any 
occurrences on GitHub except CPython clones).

Initially it was also used in Python/formatter_unicode.c, and I think it is the 
only reason of exposing it in the header. I think that now it can be removed.

The proposed PR removes _PyUnicode_AsKind from headers, makes it static, rename 
it, and change its signature (since all the kind, data pointer and length are 
available at the caller site). It also includes minor cleanup and 
microoptimizations.

--
components: C API
messages: 365427
nosy: serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Remove _PyUnicode_AsKind from private C API
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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18621
pull_request: https://github.com/python/cpython/pull/19264

___
Python tracker 

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



[issue40130] Remove _PyUnicode_AsKind from private C API

2020-03-31 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue37733] Fail to build _curses module of Python 3.7.4 on AIX 7.1 using gcc

2020-03-31 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue40098] dir() does not return the list of valid attributes for the object

2020-03-31 Thread Guido van Rossum


Guido van Rossum  added the comment:

At least for overriding __dict__, I would presume there would be a matching 
override for __getattribute__ (not __getattr__).

Ditto for __class__, e.g. look at GenericAlias in the pep585 implementation PR. 
(Here __class__ is not in the list of exceptions so it returns the attribute 
from list.)

--

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 40bfdb1594189f3c0238e5d2098dc3abf114e200 by Victor Stinner in 
branch 'master':
bpo-40094: Add _bootsubprocess._waitstatus_to_exitcode (GH-19264)
https://github.com/python/cpython/commit/40bfdb1594189f3c0238e5d2098dc3abf114e200


--

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18623
pull_request: https://github.com/python/cpython/pull/19266

___
Python tracker 

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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 16d75675d2ad2454f6dfbf333c94e6237df36018 by Victor Stinner in 
branch 'master':
bpo-31160: Fix race condition in test_os.PtyTests (GH-19263)
https://github.com/python/cpython/commit/16d75675d2ad2454f6dfbf333c94e6237df36018


--

___
Python tracker 

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



[issue31160] Enhance support.reap_children()

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 16d75675d2ad2454f6dfbf333c94e6237df36018 by Victor Stinner in 
branch 'master':
bpo-31160: Fix race condition in test_os.PtyTests (GH-19263)
https://github.com/python/cpython/commit/16d75675d2ad2454f6dfbf333c94e6237df36018


--

___
Python tracker 

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



  1   2   >