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

2020-03-31 Thread laike9m


laike9m  added the comment:

I've created a PR to fix documentation.
https://github.com/python/cpython/pull/19274

I'll create a new issue for making the function accept a code object.

--

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


Change by laike9m :


--
keywords: +patch
pull_requests: +18629
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19274

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


Dong-hee Na  added the comment:

@vstinner @petr.viktorin

I 'd like to experiment dict vector call and finalize the work.
Can I proceed it?

--

___
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 pop-up not working on macOS

2020-03-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

My first though was that the 'guy' had executed 'import math' and you had not.  
(See the IDLE doc at https://docs.python.org/3/library/idle.html or, within 
IDLE, Help => IDLE Help, "Editing and navigations" section, "completions' 
subsection, 2nd to last paragraph.)  Or maybe this was another 'Catalina' issue.

But I tried completion on my MacbookAir with Mohave 10.14.6? and 3.8.2 and 
3.7.5, in Shell at >>>, that don't need imports. 'i' should bring up a box 
with 'id' at the top.  'int.' should bring up a box with 'as_integer_ratio' at 
the top.  This works for me on Windows but not on the Mac.

For shortcuts, IDLE Preferences, Keys tab, has "force_open_completions
".  But the edit menu has "Show completions ^S". 
Control-S is not Control-space.  Bug 1. In either case, neither work.  Nor does 
clicking the menu entry.  Bug 2.  Hitting ^S causes "Edit" on the main menu to 
flash blue (Mac only); ^space.  I believe this means that ^S invoked an item on 
the menu.  I repeated the above with IDLE started in Terminal ('python3 -m 
idlelib').  No errors messages appeared.

There are issues where shortcuts don't work, because they duplicate system 
binding, but menu items do.  This is different.

Is this a tkinter widget problem?  Similar Toplevel popups (calltips, squeezer 
tooltips) work.  Listbox is also used in config, config-key, and debugger 
dialogs, all of which at least appear.  

A debug print is autocomplete_w.py show_window reveals that it is called when 
it should be, including after both ^space and ^S, with what I believe are 
appropriate arguments.  Another print in winconfig_event, just before the 
geometry call to move the window into view, shows that x,y position looks good. 
 But two oddities: winconfig_event is called twice instead of once, and with 
^space and not ^S.  I have no idea how this could be.  Adding update() just 
before update_idletasks() prevents the 2nd winconfig_event call but does not 
make the popup appear.

I am out of ideas at the moment, except for this.  Other popups are withdrawn 
while created and filled in, and then deiconified, while this one is moved off 
screen to 1,1 and moved back. Wondering whether tk 8.6 does not like 
this movement, I disabled it.  The widget should then appear, but does not.

--
components: +macOS
nosy: +ned.deily, ronaldoussoren, taleinat
title: IDLE Show completions/ autocomplete pop-up not working -> IDLE Show 
completions pop-up not working on macOS
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global()

2020-03-31 Thread Paulo Henrique Silva


Paulo Henrique Silva  added the comment:

As discussed on PR19172, this module uses a global state in functions that do 
not receive a PyModule* and right now converting such cases to per-module state 
is not trivial. I will wait for PEP-573 implementation that will hopefully make 
this easier.

Pushed PR19273 to avoid the potential crash induced by the original change.

--

___
Python tracker 

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



[issue40071] test__xxsubinterpreters leaked [1, 1, 1] references: test_ids_global()

2020-03-31 Thread Paulo Henrique Silva


Change by Paulo Henrique Silva :


--
pull_requests: +18628
pull_request: https://github.com/python/cpython/pull/19273

___
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 ba8a2bcebfdb41acafea9a195e45e9d177dc216f by Benjamin Peterson in 
branch '2.7':
[2.7] closes bpo-40125: Update multissltests.py to use OpenSSL 1.1.1f. 
(GH-19251)
https://github.com/python/cpython/commit/ba8a2bcebfdb41acafea9a195e45e9d177dc216f


--

___
Python tracker 

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



[issue40113] Turtle demo

2020-03-31 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> the program is supposed to draw a function like y=sin(x) but is drawing 
> y=abs(sin(x)).

It would have been nice if you had described the problem this way from your 
initial bug report, instead of saying that the turtle was moving backwards. I 
understood "moving backwards" as it going back over its own path, retracing its 
steps. I wasted a lot of time peering carefully at the screen trying to see 
where the turtle was retracing its steps.

Now I understand you mean the turtle is moving in the opposite direction from 
that it is facing. Gotcha.


You titled this bug report "Turtle demo", but I can't find it listed in the 
turtle demo here:

https://docs.python.org/3/library/turtle.html#module-turtledemo

Where did you get this demo from? If it's not from the standard library, you 
should report this to the author, as it is a bug in their code, not the turtle 
module, caused by mishandling of negative numbers. If you move *forward* by a 
*negative* amount, of course you are going in the opposite direction to that 
you are facing.

So the spike() function is buggy. There are probably many ways to fix it, 
depending on what you intend it to do, but probably the simplest is to just add 
a call to abs() before calling forward:

james.forward(abs(int(d*100)))

--

___
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 afeaea2d6e346f627b24cc9e84e2986a7266a70e by Victor Stinner in 
branch 'master':
bpo-40094: Add missing import to wait_process() (GH-19268)
https://github.com/python/cpython/commit/afeaea2d6e346f627b24cc9e84e2986a7266a70e


--

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2020-03-31 Thread Furkan Onder


Furkan Onder  added the comment:

There is still an mistake in the document. I sent a pr to fix it.

--

___
Python tracker 

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



[issue27635] pickle documentation says that unpickling may not call __new__

2020-03-31 Thread Furkan Onder


Change by Furkan Onder :


--
keywords: +patch
nosy: +furkanonder
nosy_count: 4.0 -> 5.0
pull_requests: +18626
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19269

___
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: +18625
pull_request: https://github.com/python/cpython/pull/19268

___
Python tracker 

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



[issue40110] multiprocessing.Pool.imap() should be lazy

2020-03-31 Thread Tim Peters


Tim Peters  added the comment:

"Lazy" has several possible aspects, of which Pool.imap() satisfies some:

- Its iterable argument is materialized one object at a time.

- It delivers results one at a time.

So, for example, if `worker` is a function that takes a single int, then

pool = multiprocessing.Pool(4)
for i in pool.imap(worker, itertools.count(1)):
print(i)

works fine, despite that the iterable argument, and the result sequence, are 
"infinite".

You seem to have something more severe in mind, more along the lines of that 
the iterable isn't advanced unless it absolutely _needs_ to be advanced in 
order to deliver a result that's being demanded.  That's how, e.g., the builtin 
Python 3 `map()` works.

But if the iterable isn't advanced until the main program _demands_ the next 
result from imap(), then the main program blocks until the machinery peels off 
the next object from the iterable, picks a worker to send it to, sends it, 
waits for the worker to deliver the result back on an internal queue, then 
delivers the result to the main program.  There's no parallelism then.

The way things are now, imap() consumes the iterable as quickly as possible, 
keeping all workers as busy as possible, regardless of how quickly (or even 
whether) results are demanded.  And seems to me that's overwhelmingly what 
people using multiprocessing would want.  In any case, that's what they _have_, 
so that couldn't be changed lightly (if it all).

Perhaps it would be more profitable to think about ways to implement your 
pipelines using other primitives?  For example, the first thing I'd try for an 
N-stage pipeline is a chain of N processes (not in a Pool) connected one to the 
next by queues.  If for some reason I was determined not to let any process 
"get ahead", easy - specify a max size of 1 for the queues.  map-like 
facilities are inherently SIMD style, but pipelines typically have very 
different code in different stages.

--
nosy: +tim.peters

___
Python tracker 

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



[issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC

2020-03-31 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

__init_subclass__ is called way before (in the type_new, when type is in the 
process of getting created) the object's __new__ (object_new) (which raises 
that TypeError).

--

___
Python tracker 

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



[issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC

2020-03-31 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue25878] CPython on Windows builds with /W3, not /W4

2020-03-31 Thread Alexander Riccio


Alexander Riccio  added the comment:

Ok, so a draft of this produces 34 warnings, but makes way more changes to the 
.vcxproj and .filters files than I think it should: 
https://github.com/ariccio/cpython/commit/60152aa065a3ad861f0359a8ada7f2fbc83a3933

Before I submit a PR, I think I should figure out how to change the defaults 
without Visual Studio adding a bunch of noise to the config - is that 
reasonable?

The warnings appear essentially innocuous - mixing signed/unsigned bytes, some 
benign truncation of constant values, and 3 places where local variables shadow 
the globals, where it looks like the global should've been used - but should be 
checked nonetheless.

The warnings are in the attached file.

--
Added file: https://bugs.python.org/file49017/34PythonWarnings.txt

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

Thanks, Victor!

--

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


--
pull_requests: +18624
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/19267

___
Python tracker 

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



[issue40131] Zipapp example has parameters in the wrong order

2020-03-31 Thread Leron Gray


New submission from Leron Gray :

The second example listed here for zipapp has the parameters in the wrong 
order. 

https://docs.python.org/3/library/zipapp.html?highlight=zipapp#examples

It should be create_archive("myapp", "myapp.pyz") since the parameters are 
(source, target). The documentation for the function itself is correct though.

--
assignee: docs@python
components: Documentation
messages: 365436
nosy: Leron Gray, docs@python
priority: normal
severity: normal
status: open
title: Zipapp example has parameters in the wrong order
type: enhancement
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



[issue40094] Add os.waitstatus_to_exitcode() function

2020-03-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6b982c22e5fdbfecc24e440515b63f7253f695c4 by Victor Stinner in 
branch 'master':
bpo-40094: Add run_command() to setup.py (GH-19266)
https://github.com/python/cpython/commit/6b982c22e5fdbfecc24e440515b63f7253f695c4


--

___
Python tracker 

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



[issue39812] Avoid daemon threads in concurrent.futures

2020-03-31 Thread Kyle Stanley


Kyle Stanley  added the comment:

I'm currently busy today, but I'll have some time to explore a few different 
potential solutions tomorrow. If I can't find anything to fix it by the end of 
the day, I'll prepare a PR to revert PR-19149, and re-apply it later (after 
more thoroughly testing to ensure it doesn't cause refleaks).

Since I authored the PR, I'd like to take responsibility for addressing the 
refleak, whether that's reverting the PR or adding a fix on top of it.

Would that be acceptable Victor, or will it need to be reverted sooner than 
tomorrow? If it needs to be done sooner, I can open a PR to revert it later 
tonight (in ~4 hours or so, when I'm available to do so). This the first time a 
patch of mine has introduced a regression, so I wanted to double check that 
tomorrow was okay.

--

___
Python tracker 

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



[issue40110] multiprocessing.Pool.imap() should be lazy

2020-03-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
components: +Library (Lib)
nosy: +rhettinger
type:  -> enhancement
versions: +Python 3.9 -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



[issue12735] request full Unicode collation support in std python library

2020-03-31 Thread Ahmad Azizi

Ahmad Azizi  added the comment:

Remember, sorting standard Persian(Farsi) characters does not work properly 
with current implementation of Python 3.x
As the result, python is probably unable to sort properly in some other 
languages.

Here is correct order of alphabet in Persian:

 "آ","ا","ب","پ","ت","ث","ج","چ","ح","خ",   
 "د","ذ","ص","ض","ط","ظ","ع","غ","ف","ق",   
 "ک","گ","ك","ل","م","ن","و","ه","ی","ي",

After sorting using sorted():

آ, ا, ب, ت, ث, ج, ح, خ, د, ذ, ص, ض, ط, ظ, ع, غ, ف, ق, ك, ل, م, ن, ه, و, ي, پ, 
چ, ک, گ, ی,

--
nosy: +Ahmad Azizi

___
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 Raymond Hettinger


Raymond Hettinger  added the comment:

I don't think this makes the world better.  It just makes it more intertwined.  
Currently, I can read the test code in isolation and understand it.  But with 
the proposed PR, a person now needs to know more of what is in test_support.  I 
really like seeing the classes in-line so I know exactly what they are doing 
and exactly what a test is doing. 

Also, I don't like reinventing another alternative to mocks.  Ideally, we want 
to minimize the number of things a person has to know in order to read and 
write our tests.

I understand your desire to factor everything you see, but in so doing you're 
creating tighter coupling and increasing complexity for the everyday 
contributor.

--
nosy: +rhettinger

___
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



[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



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



[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



[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



[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



[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


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



[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



[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



[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



[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



[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



[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



[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


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



[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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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



[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



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



[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



[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


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



[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



[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



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



[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



[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



[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



[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



[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



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



[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



[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



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


--
type:  -> enhancement

___
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



[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



[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



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



[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


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



[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



[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



[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



[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



[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



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


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



[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



[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



[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



[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



[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



[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



[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



[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



[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



  1   2   >