[issue36957] Speed up math.isqrt

2019-05-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +13327

___
Python tracker 

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



[issue36957] Speed up math.isqrt

2019-05-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is possible to get yet 10-20% by avoiding to create temporary Python 
integers for right arguments of shift operations. PR 13416 adds two private 
functions _PyLong_Rshift() and _PyLong_Lshift() which take the second argument 
as C size_t instead of Python integer. _PyLong_Lshift() can also be used in 
factorial() and in float to int comparison.

$ ./python -m timeit -s "from math import isqrt; x = range(2**63-1000, 
2**63+1000)" "[isqrt(n) for n in x]"
Unpatched:  200 loops, best of 5: 1.84 msec per loop
Patched:200 loops, best of 5: 1.51 msec per loop

$ ./python -m timeit -s "from math import isqrt; x = range(2**95-1000, 
2**95+1000)" "[isqrt(n) for n in x]"
Unpatched:  100 loops, best of 5: 2.09 msec per loop
Patched:200 loops, best of 5: 1.75 msec per loop

--

___
Python tracker 

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



[issue36957] Speed up math.isqrt

2019-05-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I have also some ideas about algorithmic optimizations (they need to be 
tested). In classic formula $a_{i+1} = a_i + (n - a_i^2)/(2*a_i)$ we can 
calculate $n - a_i^2$ as $(n - a_{i-1}^2) - (a_i^2 - a_{i-1})^2 = (n - 
a_{i-1}^2) - (a_i^2 - a_{i-1})*(a_i^2 + a_{i-1})$. $n - a_i^2$ usually is much 
smaller than $n$, so this can speed up subtraction and division. Things become 
more complicated when use shifts as in your formula, but I think that we can 
get benefit even in this case. This can also speed up the final check $a_i^2 <= 
n$.

--

___
Python tracker 

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



[issue36810] Recursive type annotations do not work in documentation tests

2019-05-19 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

> I don't think there's an actionable bug here.

OK, then taking into account there is a decent workaround, I am closing this.

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



[issue35890] Cleanup some non-consistent API callings

2019-05-19 Thread Erik Janssens


Change by Erik Janssens :


--
pull_requests: +13328

___
Python tracker 

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



[issue20596] Support for alternate wcstok syntax for Windows compilers

2019-05-19 Thread Erik Janssens


Erik Janssens  added the comment:

The same issue was handled in bpo-35890

--
pull_requests: +13329

___
Python tracker 

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



[issue36881] isinstance raises TypeError for metaclass with metaclass=ABCMeta

2019-05-19 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue36957] Speed up math.isqrt

2019-05-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a5119e7d75c9729fc36c059d05f3d7132e7f6bb4 by Serhiy Storchaka in 
branch 'master':
bpo-36957: Add _PyLong_Rshift() and _PyLong_Lshift(). (GH-13416)
https://github.com/python/cpython/commit/a5119e7d75c9729fc36c059d05f3d7132e7f6bb4


--

___
Python tracker 

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



[issue36962] Cant sort ModuleInfo instances

2019-05-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

Unfortunately your change isn't backward compatible with the existing 
(namedtuple) version.

I expect this to fail in the dataclass version:
>>> finder, name, ispkg = list(pkgutil.iter_modules(None))[0]

And since this is an enhancement, it can only go in to 3.8. And the window is 
closing for that, so it's more likely to be 3.9, if we decide that backward 
compatibility isn't important here.

--
nosy: +eric.smith
type:  -> enhancement
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue36964] `python3 -m venv NAME`: virtualenv is not portable

2019-05-19 Thread Marco Sulla


New submission from Marco Sulla :

I'm telling about python3 -m venv VIRTUALENV_NAME, not about the virtualenv 
binary.

Some remarks:

1. `VIRTUAL_ENV` variable in `activate` script is the absolute path of the 
virtualenv folder

2. A symlink to the `python3` bin of the machine is created.

This makes the virtualenv difficult to export to another machine. The 
VIRTUAL_ENV variable must be manually changed. 

Furthermore I do not understand why the simlink is created. I suppose that 
`python3` is already on the `PATH`, so what's the purpose of simlink?

I propose to makes VIRTUAL_ENV eqauls to the parent folder of the directory 
where `activate` resides. It makes it possible to move the virtualenv and copy 
it to another machine with the same OS.

--
components: Library (Lib)
messages: 342842
nosy: Marco Sulla
priority: normal
severity: normal
status: open
title: `python3 -m venv NAME`: virtualenv is not portable
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



[issue36962] Cant sort ModuleInfo instances

2019-05-19 Thread Batuhan


Batuhan  added the comment:

You're right. I am thinking implementing 4 sequence methods
(contains/len/iter/getitem) and set a depraction warning for them. We can
remove this methods in next relase

On Sun, May 19, 2019, 2:37 PM Eric V. Smith  wrote:

>
> Eric V. Smith  added the comment:
>
> Unfortunately your change isn't backward compatible with the existing
> (namedtuple) version.
>
> I expect this to fail in the dataclass version:
> >>> finder, name, ispkg = list(pkgutil.iter_modules(None))[0]
>
> And since this is an enhancement, it can only go in to 3.8. And the window
> is closing for that, so it's more likely to be 3.9, if we decide that
> backward compatibility isn't important here.
>
> --
> nosy: +eric.smith
> type:  -> enhancement
> versions:  -Python 3.6, Python 3.7
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue36962] Cant sort ModuleInfo instances

2019-05-19 Thread Batuhan


Batuhan  added the comment:

Can you review the PR, i implemented it there.

--

___
Python tracker 

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



[issue36965] use of STATUS_CONTROL_C_EXIT in Modules/main.c breaks compilation with non MSC compilers

2019-05-19 Thread Erik Janssens


New submission from Erik Janssens :

in Modules/main.c STATUS_CONTROL_C_EXIT is included conditionally if compiling 
when _MSC_VER is defined.  Later on STATUS_CONTROL_C_EXIT is used if MS_WINDOWS 
is defined.

This breaks compilation of main.c with any non MSC compiler while compiling for 
MS Windows.

This appears to have been introduced in GH-12123 for bpo-36142

--
components: Windows
messages: 342845
nosy: erikjanss, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: use of STATUS_CONTROL_C_EXIT in Modules/main.c breaks compilation with 
non MSC compilers
type: compile error
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



[issue36965] use of STATUS_CONTROL_C_EXIT in Modules/main.c breaks compilation with non MSC compilers

2019-05-19 Thread SilentGhost


Change by SilentGhost :


--
nosy: +vstinner

___
Python tracker 

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



[issue36962] Cant sort ModuleInfo instances

2019-05-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm not sure all of this churn is worth it for an unusual use case that can be 
satisfied by:

>>> sorted(pkgutil.iter_modules(None), key=lambda x: (x[1], x[2])

or even:

>>> sorted(pkgutil.iter_modules(None), key=operator.itemgetter(1))

(assuming that ispkg doesn't really need to be part of the key)

Before reviewing the patch, I suggest you raise the issue on python-dev and get 
some additional input.

--

___
Python tracker 

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



[issue36965] use of STATUS_CONTROL_C_EXIT in Modules/main.c breaks compilation with non MSC compilers

2019-05-19 Thread Erik Janssens


Change by Erik Janssens :


--
keywords: +patch
pull_requests: +13330
stage:  -> patch review

___
Python tracker 

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



[issue36965] use of STATUS_CONTROL_C_EXIT in Modules/main.c breaks compilation with non MSC compilers

2019-05-19 Thread Erik Janssens


Erik Janssens  added the comment:

According to the Microsoft documentation at

https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/using-ntstatus-values

system-supplied status codes are defined in ntstatus.h. and the NTSTATUS type 
is defined in ntdef.h

PR 13421 includes both ntstatus.h and ntdef.h to be able to use 
STATUS_CONTROL_C_EXIT when compiling for windows.

--

___
Python tracker 

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



[issue36962] Cant sort ModuleInfo instances

2019-05-19 Thread Berker Peksag


Berker Peksag  added the comment:

I agree with Eric that this use case can be easily covered by using sorted(..., 
key=...).

I suggest closing this as 'rejected'.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-19 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset c661b30f89ffe7a7995538d3b1649469b184bee4 by Berker Peksag 
(Xtreak) in branch 'master':
bpo-36948: Fix NameError in urllib.request.URLopener.retrieve (GH-13389)
https://github.com/python/cpython/commit/c661b30f89ffe7a7995538d3b1649469b184bee4


--
nosy: +berker.peksag

___
Python tracker 

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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13332

___
Python tracker 

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



[issue36567] DOC: manpage directive doesn't create hyperlink

2019-05-19 Thread Berker Peksag


Change by Berker Peksag :


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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-19 Thread Berker Peksag


Berker Peksag  added the comment:

Thanks! Apparently, backport to 3.7 isn't needed, so I just closed PR 13422.

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



[issue36962] Cant sort ModuleInfo instances

2019-05-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Dataclasses are even more heavyweight than namedtuples. I am not sure that they 
should be used in the stdlib now. Especially in this case. I think the common 
use of iter_modules() is immediate unpacking of the yielded tuple:

for importer, modname, ispkg in pkgutil.iter_modules():
...

Your change breaks it.

I agree with Eric and Berker that this issue should be closed.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2019-05-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset f4e1babf44792bdeb0c01da96821ba0800a51fd8 by Serhiy Storchaka (Bar 
Harel) in branch 'master':
bpo-27141: Fix collections.UserList and UserDict shallow copy. (GH-4094)
https://github.com/python/cpython/commit/f4e1babf44792bdeb0c01da96821ba0800a51fd8


--

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2019-05-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +1

___
Python tracker 

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



[issue36963] PyDict_GetItem SegFaults on simple dictionary lookup when using Ctypes

2019-05-19 Thread Larry Hastings


Larry Hastings  added the comment:

It's not surprising that you crashed the CPython interpreter by using 
ctypes--it's very easy to do by accident, or via a bug in your own code.  
That's why we don't accept crash reports involving ctypes.

Also, it's rude to "nosy" so many people, particularly on your first bug.  
Please show some courtesy in the future, rather than trying to involve as many 
core developers as possible with what is probably a bug in your own code.

--
resolution:  -> rejected
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



[issue36966] Export __VENV_PROMPT__ as environment variable

2019-05-19 Thread Lysandros Nikolaou


New submission from Lysandros Nikolaou :

For those, who use custom tools for their terminals, prepending __VENV_PROMPT__ 
to PS1 doesn't really help all that much, because it gets overwritten by those 
tools. Would it make sense to export __VENV_PROMPT__ as an environment variable 
upon activation, so that these tools can make use of it, in order to edit PS1 
accordingly?

--
components: Library (Lib)
messages: 342855
nosy: lys.nikolaou
priority: normal
severity: normal
status: open
title: Export __VENV_PROMPT__ as environment variable
type: enhancement
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



[issue36963] PyDict_GetItem SegFaults on simple dictionary lookup when using Ctypes

2019-05-19 Thread Apoorv Reddy


Apoorv Reddy  added the comment:

Greetings Larry !

I apologize for spamming so many people. I was hoping to get some insight into 
this ! Could you let me know to whom I could reach out for help ? I've included 
tehybel as I saw that he has raised/resolved some issues with PyDict in the 
past.

My C code is essentially just this:

#include "Python.h"

#ifdef __cplusplus
extern "C" double test(PyObject* key, PyObject* dict)
#else
double test(PyObject* key, PyObject* dict)
#endif
{
PyObject* list = PyObject_GetItem(dict, key);
return 0.0;
}



And my Python Code is this. I'm pretty sure I've got the input and output types 
correct here.

from ctypes import cdll
from ctypes import *
import json
import sys
import pickle


dll = CDLL('./test2.so')
dll.test.restype = c_double
dll.test.argtypes = (py_object, py_object)

d = {68113113140: [1, 2]}
for i in d.keys():
if i == 68113113140:
break
print(dll.test(i, d)) # this works just fine
print(dll.test(68113113140, d) # this segfaults !

GDB shows me that PyObject_RichCompare (called inside PyDict_GetItem) is the 
function where the segmentation fault happens !


Hoping for some guidance here ! I've been trying to resolve this for 3 days 
now. I have made sure that I've compiled with the correct version of Python 
headers and that I'm using the same version of interpreter as well (in this 
case Python 3.5.6)

--
nosy:  -amaury.forgeotdarc, belopolsky, benjamin.peterson, christian.heimes, 
duaneg, ebarry, georg.brandl, inada.naoki, meador.inge, ned.deily, rhettinger, 
serhiy.storchaka

___
Python tracker 

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



[issue36966] Export __VENV_PROMPT__ as environment variable

2019-05-19 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Is this same as issue35328?

--
nosy: +xtreak

___
Python tracker 

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



[issue36966] Export __VENV_PROMPT__ as environment variable

2019-05-19 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

It is. Somehow search failed me big time. I'm closing the issue.

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



[issue36966] Export __VENV_PROMPT__ as environment variable

2019-05-19 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
resolution:  -> duplicate

___
Python tracker 

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



[issue36966] Export __VENV_PROMPT__ as environment variable

2019-05-19 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
superseder:  -> Set a environment variable for venv prompt

___
Python tracker 

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



[issue35328] Set a environment variable for venv prompt

2019-05-19 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue36964] `python3 -m venv NAME`: virtualenv is not portable

2019-05-19 Thread SilentGhost


Change by SilentGhost :


--
nosy: +vinay.sajip
versions: +Python 3.8 -Python 3.9

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2019-05-19 Thread miss-islington


miss-islington  added the comment:


New changeset 3645d29a1dc2102fdb0f5f0c0129ff2295bcd768 by Miss Islington (bot) 
in branch '3.7':
bpo-27141: Fix collections.UserList and UserDict shallow copy. (GH-4094)
https://github.com/python/cpython/commit/3645d29a1dc2102fdb0f5f0c0129ff2295bcd768


--
nosy: +miss-islington

___
Python tracker 

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



[issue35328] Set a environment variable for venv prompt

2019-05-19 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Is anybody still working on this?

--

___
Python tracker 

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



[issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close()

2019-05-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13334

___
Python tracker 

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



[issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close()

2019-05-19 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 7c59362a15dfce538512ff1fce4e07d33a925cfb by Berker Peksag in 
branch 'master':
bpo-29183: Fix double exceptions in wsgiref.handlers.BaseHandler (GH-12914)
https://github.com/python/cpython/commit/7c59362a15dfce538512ff1fce4e07d33a925cfb


--
nosy: +berker.peksag

___
Python tracker 

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



[issue35894] Apparent regression in 3.8-dev: 'TypeError: required field "type_ignores" missing from Module'

2019-05-19 Thread Anthony Sottile


Anthony Sottile  added the comment:

there's other optional fields in the ast, type ignores don't seem essential to 
the `Module`, could those be made optional as well?

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue36691] SystemExit & sys.exit : Allow both exit status and message

2019-05-19 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
nosy: +mbussonn

___
Python tracker 

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



[issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close()

2019-05-19 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset f393e8eb463d60ce559982613429568c518ab8d9 by Berker Peksag (Miss 
Islington (bot)) in branch '3.7':
bpo-29183: Fix double exceptions in wsgiref.handlers.BaseHandler (GH-12914)
https://github.com/python/cpython/commit/f393e8eb463d60ce559982613429568c518ab8d9


--

___
Python tracker 

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



[issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close()

2019-05-19 Thread Berker Peksag


Change by Berker Peksag :


--
components: +Library (Lib)
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.4, Python 3.5, Python 
3.6

___
Python tracker 

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



[issue35894] Apparent regression in 3.8-dev: 'TypeError: required field "type_ignores" missing from Module'

2019-05-19 Thread David Lord


Change by David Lord :


--
nosy: +davidism

___
Python tracker 

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



[issue36957] Speed up math.isqrt

2019-05-19 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 5c08ce9bf712acbb3f05a3a57baf51fcb534cdf0 by Mark Dickinson in 
branch 'master':
bpo-36957: Speed up math.isqrt (#13405)
https://github.com/python/cpython/commit/5c08ce9bf712acbb3f05a3a57baf51fcb534cdf0


--

___
Python tracker 

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



[issue36957] Speed up math.isqrt

2019-05-19 Thread Mark Dickinson


Mark Dickinson  added the comment:

Calling this done for now.

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



[issue36759] datetime: astimezone() results in OSError: [Errno 22] Invalid argument

2019-05-19 Thread SilentGhost


SilentGhost  added the comment:

I'm going to close this issue as a duplicate of #29097. If you're still 
experience this problem on python3.7, please re-open.

--
resolution:  -> duplicate
stage:  -> resolved
status: pending -> closed
superseder:  -> [Windows] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails 
on Python 3.6

___
Python tracker 

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



[issue21315] email._header_value_parser does not recognise in-line encoding changes

2019-05-19 Thread Abhilash Raj


Change by Abhilash Raj :


--
pull_requests: +13335
stage:  -> patch review

___
Python tracker 

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



[issue36962] Cant sort ModuleInfo instances

2019-05-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree. Sorry, BTaskaya, but I just don't think the benefit of this change is 
worth the disruption.

--
resolution:  -> wont fix
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



[issue35121] Cookie domain check returns incorrect results

2019-05-19 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +13336
stage: commit review -> patch review

___
Python tracker 

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



[issue35647] Cookie path check returns incorrect results

2019-05-19 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +13337

___
Python tracker 

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



[issue36721] Add pkg-config python-3.8-embed

2019-05-19 Thread Ned Deily


Ned Deily  added the comment:

I don't understand the need for this.  AFAICT, the purpose of python-config is 
to provide configuration info for embedding Python (Issue1161914 and 
https://docs.python.org/3/extending/embedding.html#compiling-and-linking-under-unix-like-systems).
  At some point, a pkg-config template was added (in Issue3585) but it seems to 
duplicate the purpose of python-config and thus is also intended for use in 
embedding Python (although we don't seem to document it, it is familiar to 
users of automake). I don't know what other purposes either python-config or 
the pkg-config template serve other than for embedding. AFAIK, they should not 
be used for building C extension modules. But admittedly this area is not 
well-documented.  In any case, I think pkg-config and python-config should 
return the same values for similar parameters.  Anyone else have an opinion?

--
nosy: +ned.deily

___
Python tracker 

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



[issue35814] Syntax quirk with variable annotations

2019-05-19 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Is PEP the best place for such updates? Maybe we can add a `versionchanged` 
note in 
https://docs.python.org/3/reference/simple_stmts.html#annotated-assignment-statements
 instead?

--

___
Python tracker 

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



[issue36881] isinstance raises TypeError for metaclass with metaclass=ABCMeta

2019-05-19 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

I think this is related to how `__subclasscheck__` is implemented in `ABCMeta`. 
I just checked this also happens in Python 3.6 (i.e. it is not something 
specific to the C version introduced in Python 3.7).

--

___
Python tracker 

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



[issue22865] Document how to make pty.spawn not copy data

2019-05-19 Thread Geoff Shannon


Geoff Shannon  added the comment:

@martin.panter I removed the mention of inserting null bytes and restricted the 
documentation updates to more fully documenting the current behaviour.

--

___
Python tracker 

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



[issue36967] Eliminate unnecessary check in _strptime when determining AM/PM

2019-05-19 Thread Gordon P. Hemsley


New submission from Gordon P. Hemsley :

Since __calc_am_pm() explicitly limits self.am_pm to 2 values, there are only 
ever 3 possible values of %p: AM, PM, or blank. Since blank is treated the same 
as AM, there is only the need to check whether %p is PM. This eliminates an 
unnecessary comparison and doubly ensures that there is no unhandled case.

--
messages: 342872
nosy: gphemsley, p-ganssle
priority: normal
severity: normal
status: open
title: Eliminate unnecessary check in _strptime when determining AM/PM
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



[issue36968] Top level transient modal windows stopping deiconify on windows 10

2019-05-19 Thread Daniel Law


New submission from Daniel Law :

python 3.6 and also found it in 3.7.3, on windows 10. when a main application 
window built with Tkinter has a modal top level window (transient, grab_set) if 
it is minimised (which get blocked unless you click show desktop or shake 
another application around) any and all atempts to reopen or switch to the 
application again are blocked and the application has to be closed and reopened.

gif attached of this in practice.

--
components: Windows
files: arrow_rotate_clockwise_48x48.png
messages: 342873
nosy: Daniel Law, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Top level transient modal windows stopping deiconify on windows 10
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file48337/arrow_rotate_clockwise_48x48.png

___
Python tracker 

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



[issue36967] Eliminate unnecessary check in _strptime when determining AM/PM

2019-05-19 Thread Gordon P. Hemsley


Change by Gordon P. Hemsley :


--
keywords: +patch
pull_requests: +13338
stage:  -> patch review

___
Python tracker 

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



[issue36967] Eliminate unnecessary check in _strptime when determining AM/PM

2019-05-19 Thread Gordon P. Hemsley


Change by Gordon P. Hemsley :


--
components: +Library (Lib)

___
Python tracker 

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



[issue36968] Top level transient modal windows stopping deiconify on windows 10

2019-05-19 Thread Daniel Law


Change by Daniel Law :


Removed file: https://bugs.python.org/file48337/arrow_rotate_clockwise_48x48.png

___
Python tracker 

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



[issue34580] sqlite doc: clarify the scope of the context manager

2019-05-19 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 287b84de939db47aa8c6f30734ceb8aba9d1db29 by Berker Peksag 
(Xtreak) in branch 'master':
bpo-34580: Update sqlite3 examples to call close() explicitly (GH-9079)
https://github.com/python/cpython/commit/287b84de939db47aa8c6f30734ceb8aba9d1db29


--

___
Python tracker 

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



[issue34580] sqlite doc: clarify the scope of the context manager

2019-05-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13339

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2019-05-19 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13340

___
Python tracker 

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



[issue35252] test_functools dead code after FIXME

2019-05-19 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset d673810b9d9df6fbd29f5b7db3973d5adae10fd3 by Łukasz Langa 
(Lysandros Nikolaou) in branch 'master':
bpo-35252: Remove FIXME from test_functools (GH-10551)
https://github.com/python/cpython/commit/d673810b9d9df6fbd29f5b7db3973d5adae10fd3


--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2019-05-19 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ed48866c55b8e4ee14faa8b5ad97819e8e74c98b by Victor Stinner in 
branch 'master':
bpo-35134: Split traceback.h header (GH-13430)
https://github.com/python/cpython/commit/ed48866c55b8e4ee14faa8b5ad97819e8e74c98b


--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2019-05-19 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13341

___
Python tracker 

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



[issue34580] sqlite doc: clarify the scope of the context manager

2019-05-19 Thread Berker Peksag


Change by Berker Peksag :


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

___
Python tracker 

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



[issue34580] sqlite doc: clarify the scope of the context manager

2019-05-19 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 205c1f0e36e00e6e7cb7fbabaab4f52732859f9e by Berker Peksag (Miss 
Islington (bot)) in branch '3.7':
bpo-34580: Update sqlite3 examples to call close() explicitly (GH-9079)
https://github.com/python/cpython/commit/205c1f0e36e00e6e7cb7fbabaab4f52732859f9e


--

___
Python tracker 

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



[issue36969] pdb: do_args: display/handle keyword-only arguments

2019-05-19 Thread daniel hahler


New submission from daniel hahler :

With a program like the following, `args` will not display the keyword-only 
argument:

```
def f1(arg=None, *, kwonly=None):
__import__('pdb').set_trace()


f1()
```

```
(Pdb) args
arg = 'arg'
kw = 'kw'
```

Related code:
https://github.com/python/cpython/blob/5c08ce9bf712acbb3f05a3a57baf51fcb534cdf0/Lib/pdb.py#L1129-L1144

--
components: Library (Lib)
messages: 342878
nosy: blueyed
priority: normal
severity: normal
status: open
title: pdb: do_args: display/handle keyword-only arguments
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue36963] PyDict_GetItem SegFaults on simple dictionary lookup when using Ctypes

2019-05-19 Thread Inada Naoki


Inada Naoki  added the comment:

At first glance, you used ctypes.cdll, which releases GIL.  But you called 
Python/C API in extension module.  You shouldn't do it.
Try ctypes.pydll, which don't release GIL.

If it doesn't help you, please continue it in another communities.
I don't want to make Issue Tracker as user support forum.


> Could you let me know to whom I could reach out for help ?

Communities!

* Slack: https://pyslackers.com/
* Mailing list: https://mail.python.org/mailman/listinfo/python-list
* Stack Overflow: https://stackoverflow.com/questions/tagged/python

--
nosy: +inada.naoki

___
Python tracker 

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



[issue35252] test_functools dead code after FIXME

2019-05-19 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


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



[issue36963] PyDict_GetItem SegFaults on simple dictionary lookup when using Ctypes

2019-05-19 Thread Larry Hastings


Larry Hastings  added the comment:

Inada-san, while it is best to not call PyDict_ functions without holding the 
GIL, it doesn't matter unless one creates a second thread.  The GIL doesn't 
even exist until Python creates a second thread.

But, I too don't want bugs.python.org to become a "help people debug their 
programs" site.  Particularly when using ctypes, which crashes a lot.

--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2019-05-19 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fd1e0e93b15af018184476ea0b3af0eabef37d89 by Victor Stinner in 
branch 'master':
bpo-35134: Register new traceback.h header files (GH-13431)
https://github.com/python/cpython/commit/fd1e0e93b15af018184476ea0b3af0eabef37d89


--

___
Python tracker 

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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-19 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13342

___
Python tracker 

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



[issue36951] Wrong types for PyMemberDefs in Objects/typeobject.c

2019-05-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13344

___
Python tracker 

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



[issue36951] Wrong types for PyMemberDefs in Objects/typeobject.c

2019-05-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13343

___
Python tracker 

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



[issue36951] Wrong types for PyMemberDefs in Objects/typeobject.c

2019-05-19 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 53d378c81286644138415cb56da52a7351e1a477 by Benjamin Peterson 
(Zackery Spytz) in branch 'master':
closes bpo-36951: Correct some types in the type_members struct in 
typeobject.c. (GH-13403)
https://github.com/python/cpython/commit/53d378c81286644138415cb56da52a7351e1a477


--
nosy: +benjamin.peterson
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



[issue36951] Wrong types for PyMemberDefs in Objects/typeobject.c

2019-05-19 Thread miss-islington


miss-islington  added the comment:


New changeset eda691dd9d076e175c396dc6f85dee2795572f6c by Miss Islington (bot) 
in branch '2.7':
closes bpo-36951: Correct some types in the type_members struct in 
typeobject.c. (GH-13403)
https://github.com/python/cpython/commit/eda691dd9d076e175c396dc6f85dee2795572f6c


--
nosy: +miss-islington

___
Python tracker 

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



[issue36951] Wrong types for PyMemberDefs in Objects/typeobject.c

2019-05-19 Thread miss-islington


miss-islington  added the comment:


New changeset 64b0bdba7ee30ecc5c4c5ad46fb6afd6c0ddd487 by Miss Islington (bot) 
in branch '3.7':
closes bpo-36951: Correct some types in the type_members struct in 
typeobject.c. (GH-13403)
https://github.com/python/cpython/commit/64b0bdba7ee30ecc5c4c5ad46fb6afd6c0ddd487


--

___
Python tracker 

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



[issue36630] failure of test_colors_funcs in test_curses with ncurses 6.1

2019-05-19 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

The test fails because curses.pair_content(curses.COLOR_PAIRS-1) validates its 
parameter against the limits for signed short (max 32767) while 
curses.COLOR_PAIRS-1 has the value 65535.

Unfortunately, re-plumbing curses.pair_content() to use signed integers instead 
of signed shorts and replacing the underlying ncurses API call from 
pair_content() to extended_pair_content() doesn't fix the problem because 
extended_pair_content() still fails when passed 65535. Tracing into the ncurses 
6.1 source code, I found that start_color() clamps the maximum number of color 
pairs at SHRT_MAX (32767) regardless of the number of color pairs supported by 
the terminal.

--
nosy: +websurfer5
Added file: https://bugs.python.org/file48338/extended_pair_content.c

___
Python tracker 

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



[issue36958] IDLE should print exit message or status if one is provided

2019-05-19 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +13345
stage: needs patch -> patch review

___
Python tracker 

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



[issue36958] IDLE should print exit message or status if one is provided

2019-05-19 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 6d965b39b7a486dd9e96a60b19ee92382d668299 by Terry Jan Reedy in 
branch 'master':
bpo-36958: In IDLE, print exit message (GH-13435)
https://github.com/python/cpython/commit/6d965b39b7a486dd9e96a60b19ee92382d668299


--

___
Python tracker 

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



[issue36958] IDLE should print exit message or status if one is provided

2019-05-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13346

___
Python tracker 

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



[issue24653] Mock.assert_has_calls([]) is surprising for users

2019-05-19 Thread Inada Naoki


Inada Naoki  added the comment:

I concur with Serhiy.  Current document and example describe clearly
that this API is for checking inclusion, not equality.

Current example:

"""
>>> mock = Mock(return_value=None)
>>> mock(1)
>>> mock(2)
>>> mock(3)
>>> mock(4)
>>> calls = [call(2), call(3)]
>>> mock.assert_has_calls(calls)
>>> calls = [call(4), call(2), call(3)]
>>> mock.assert_has_calls(calls, any_order=True)
"""

Empty list is allowed by same rule.  There are no exception.

And when people understand this API checks inclusion, calling with
empty list doesn't make sense at all.  So I don't think it is worth enough.

--
nosy: +inada.naoki
resolution:  -> wont fix
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



[issue22385] Define a binary output formatting mini-language for *.hex()

2019-05-19 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

FYI - micropython added an optional 'sep' second argument to binascii.hexlify() 
that is a single character separator to insert between every two hex digits.

given the #9951 .hex() methods we have everywhere (and corresponding .fromhex), 
binascii.hexlify is almost a legacy API.  (but micropython doesn't have those 
methods yet).  one key difference?  hexlify returns the hex value as a bytes 
rather than a str.

just adding a couple of parameters to the hex() method seems fine.  a separator 
string and a number of bytes to separate.

yet another minilanguage would be overkill.  and confusing in the face of the 
existing numeric formatting mini language ability to insert , or _ separators 
every four spaces ala f'{value:_x}'.

--
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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