[issue38636] IDLE regression: toggle tabs and change indent width functions

2019-10-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The old, long discussion of Shell indents is #7676 and a preceding issue 
reference therein.  My replacement is #37892.

The PR patch is simple enough to apply by to existing 3.7.5 and 3.8.0 installs.

--
stage: patch review -> test needed

___
Python tracker 

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



[issue38636] IDLE regression: toggle tabs and change indent width functions

2019-10-30 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +16533
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/17008

___
Python tracker 

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



[issue38636] IDLE regression: toggle tabs and change indent width functions

2019-10-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Interesting.  The result of making these changes is legal code looking like
>>> if a:
if b:
c = 3
This has been proposed as the way Shell should work, but rejected as likely too 
confusing to beginners as the indented code does not look indented compared to 
the line above.  The use of tabs for indents in Shell has long been considered 
a wart that is a 'least bad solution'.

Please hold your proposals.  I intend to solve the issue by moving the prompt 
to a shell sidebar and use the same indent in shell as in editors.  #37903 has 
a PR under review.

--

___
Python tracker 

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



[issue38648] Py_tp_free is specified twice in Python-ast.c

2019-10-30 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset bdac32e9fe25fdb97a7172a93aabd1ffead89462 by Benjamin Peterson 
(Max Bernstein) in branch 'master':
closes bpo-38648: Remove double tp_free slot in Python-ast.c. (GH-17002)
https://github.com/python/cpython/commit/bdac32e9fe25fdb97a7172a93aabd1ffead89462


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



[issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen()

2019-10-30 Thread Anselmo Melo


Change by Anselmo Melo :


--
nosy: +Anselmo Melo

___
Python tracker 

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



[issue38600] Change the mark up of NULL

2019-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 951b6c314a8567be3b5d901059fde866c79f5ff0 by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-38600: NULL -> ``NULL``. (GH-17001) (GH-17004)
https://github.com/python/cpython/commit/951b6c314a8567be3b5d901059fde866c79f5ff0


--

___
Python tracker 

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



[issue38600] Change the mark up of NULL

2019-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2c921c65e9d0aa7e3a38c96a22d5eec56724da72 by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-38600: NULL -> ``NULL``. (GH-17001) (GH-17003)
https://github.com/python/cpython/commit/2c921c65e9d0aa7e3a38c96a22d5eec56724da72


--

___
Python tracker 

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



[issue38651] Add WolfSSL support

2019-10-30 Thread Daniel Johnson


New submission from Daniel Johnson :

WolfSSL is an SSL library targeted at embedded development that focuses on size 
and speed. It's also FIPS certified which is is important for anyone working 
with federal agencies.

WolfSSL website: https://www.wolfssl.com/
WolfSSL github: https://github.com/wolfSSL/wolfssl

I have two ideas currently on how Python could support WolfSSL:

1.) Shim WolfSSL's OpenSSL compatibility layer in. They don't provide a 
complete shim for OpenSSL and I'm not sure if they provide all the symbols 
Python would care about.
2.) Provide an optional configuration to use WolfSSL and it's API instead of 
OpenSSL.

Would either options be something the Python maintainers would be interested 
in? I'm testing the waters to see if this is something anyone is interested in.

Thank you for the time!

--
assignee: christian.heimes
components: SSL
messages: 355733
nosy: Daniel Johnson, christian.heimes
priority: normal
severity: normal
status: open
title: Add WolfSSL support
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



[issue23903] Generate PC/python3.def by scraping headers

2019-10-30 Thread Steve Dower


Steve Dower  added the comment:

Reawakening this issue so we can finish it off - the stable ABI has been 
declared "clean" on python-dev, so there shouldn't be any more concerns about 
APIs leaking in now. We can assume that everything accessible from the header 
files should be included in python3.def.

If it has been cleaned up though, we might need to go through and restore 
anything that used to be in python3.def but wasn't meant to be. Those are 
stable.

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



[issue38650] Add constantness to PyStructSequence_UnnamedField

2019-10-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue38650] Add constantness to PyStructSequence_UnnamedField

2019-10-30 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently the variable PyStructSequence_UnnamedField has type "char *". It is 
used as a special value for setting to the name field of 
PyStructSequence_Field. But the type of the name field is "const char *".

I propose to change the declaration of PyStructSequence_UnnamedField to "const 
char * const". Makes it referring to immutable character string and make it 
itself immutable.

It is binary compatible change, but some user code can complain at compilation 
time if it uses PyStructSequence_UnnamedField in unusual way (assigns to the 
"char *" variable, etc). It is very unlikely.

--
components: Interpreter Core
messages: 355731
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Add constantness to PyStructSequence_UnnamedField
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



[issue38600] Change the mark up of NULL

2019-10-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16531
pull_request: https://github.com/python/cpython/pull/17004

___
Python tracker 

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



[issue38600] Change the mark up of NULL

2019-10-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16530
pull_request: https://github.com/python/cpython/pull/17003

___
Python tracker 

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



[issue38600] Change the mark up of NULL

2019-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e835b31d2b212c3c7820364398979cae2a9740b2 by Serhiy Storchaka in 
branch 'master':
bpo-38600: NULL -> ``NULL``. (GH-17001)
https://github.com/python/cpython/commit/e835b31d2b212c3c7820364398979cae2a9740b2


--

___
Python tracker 

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



[issue38649] tkinter messagebox is sloppy

2019-10-30 Thread David Lambert


New submission from David Lambert :

Does aksokcancel return "true" or True ?  The docstring should say True   This 
is pervasive throughout the module.  tkinter has such a mishmash of numbers 
supplied as strings, strings supplied as constants making this carelessness 
egregious.  On the topic of constants, the messagebox module redefines OK.  You 
might argue that the definition didn't change.  I suspect this issue applies to 
all versions of tkinter or Tkinter having the messagebox.

# types
ABORTRETRYIGNORE = "abortretryignore"
OK = "ok"
...

# replies
...
OK = "ok"



def askokcancel(title=None, message=None, **options):
"Ask if operation should proceed; return true if the answer is ok"
s = _show(title, message, QUESTION, OKCANCEL, **options)
return s == OK

--
assignee: docs@python
components: Documentation
messages: 355729
nosy: David Lambert, docs@python
priority: normal
severity: normal
status: open
title: tkinter messagebox is sloppy
type: enhancement
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



[issue38600] Change the mark up of NULL

2019-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset f2ba17be2aec873741c2d8a55b1342afa360aec2 by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-38600: Change the mark up of NULL in the C API documentation. 
(GH-16950) (GH-16999)
https://github.com/python/cpython/commit/f2ba17be2aec873741c2d8a55b1342afa360aec2


--

___
Python tracker 

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



[issue38600] Change the mark up of NULL

2019-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7f7f986cc485c40d80bae504333e3946ce9e96ba by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-38600: Change the mark up of NULL in the C API documentation. 
(GH-16950) (GH-17000)
https://github.com/python/cpython/commit/7f7f986cc485c40d80bae504333e3946ce9e96ba


--

___
Python tracker 

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



[issue38648] Py_tp_free is specified twice in Python-ast.c

2019-10-30 Thread Maxwell Bernstein


Change by Maxwell Bernstein :


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

___
Python tracker 

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



[issue38648] Py_tp_free is specified twice in Python-ast.c

2019-10-30 Thread Maxwell Bernstein


New submission from Maxwell Bernstein :

This looks like a typo due to copy-paste.

--
messages: 355726
nosy: tekknolagi
priority: normal
severity: normal
status: open
title: Py_tp_free is specified twice in Python-ast.c
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



[issue38600] Change the mark up of NULL

2019-10-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16528
pull_request: https://github.com/python/cpython/pull/17001

___
Python tracker 

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



[issue38647] Why only the MacOSXOSAScript in webbrowser does not have the name property?

2019-10-30 Thread Yoshihiro Nagano


New submission from Yoshihiro Nagano :

Hello.

I am using the webbrowser library in macOS and just found that only the 
MacOSXOSAScript object has `_name` property instead of `name.`
All of the other class, which is inherited from the BaseBrowser, has `name` 
property.
Are there any specific reasons for this API?
Or, are there any ways to access the name of the browser object independent 
from the browser type?

The corresponding implementation is shown below:
https://github.com/python/cpython/blob/4cb08b6c0ae6989d169dd48c2b24087941f6d0b0/Lib/webbrowser.py#L641-L643

Thank you.

--
components: Library (Lib), macOS
messages: 355725
nosy: Yoshihiro Nagano, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Why only the MacOSXOSAScript in webbrowser does not have the name 
property?
type: behavior
versions: Python 2.7, Python 3.7

___
Python tracker 

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



[issue38637] fix GROWTH_RATE comments bug

2019-10-30 Thread Brandt Bucher


Brandt Bucher  added the comment:

This PR was closed as invalid for the same reasons Steven mentioned above.

--
nosy: +brandtbucher
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



[issue38646] Invalid check on the result of pthread_self() leads to libpython startup failure

2019-10-30 Thread Tom Lane


New submission from Tom Lane :

Assorted code in the Python core supposes that the result of pthread_self() 
cannot be equal to PYTHREAD_INVALID_THREAD_ID, ie (void *) -1.  If it is, you 
get a crash at interpreter startup.  Unfortunately, this supposition is 
directly contrary to the POSIX specification for pthread_self(), which defines 
no failure return value; and it is violated by NetBSD's implementation in some 
circumstances.  In particular, we (the Postgres project) are observing that 
libpython.so fails when dynamically loaded into a host executable that does not 
itself link libpthread.  NetBSD's code always returns -1 if libpthread was not 
present at main program start, as they do not support forking new threads in 
that case.  They assert (and I can't disagree) that their implementation 
conforms to POSIX.

A lazy man's solution might be to change PYTHREAD_INVALID_THREAD_ID to some 
other value like -3, but that's not fixing the core problem that you're 
violating POSIX by testing for any specific value at all.

Details and background info can be found in this email thread:

https://www.postgresql.org/message-id/flat/25662.1560896200%40sss.pgh.pa.us

--
components: Interpreter Core
messages: 355723
nosy: tgl
priority: normal
severity: normal
status: open
title: Invalid check on the result of pthread_self() leads to libpython startup 
failure
type: crash
versions: Python 3.7

___
Python tracker 

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



[issue38600] Change the mark up of NULL

2019-10-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16527
pull_request: https://github.com/python/cpython/pull/17000

___
Python tracker 

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



[issue38600] Change the mark up of NULL

2019-10-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16526
pull_request: https://github.com/python/cpython/pull/16999

___
Python tracker 

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



[issue38629] float is missing __ceil__() and __floor__(), required by numbers.Real

2019-10-30 Thread Batuhan


Batuhan  added the comment:

$ ./python -m pyperf timeit -s "from math import floor" --duplicate 100 
"floor(12345.6)"
Before:  Mean +- std dev: 52.5 ns +- 2.6 ns
After:  Mean +- std dev: 71.0 ns +- 1.7 ns

$ ./python -m pyperf timeit -s "from math import ceil" --duplicate 100 
"ceil(12345.6)"
Before:  Mean +- std dev: 51.2 ns +- 1.5 ns
After:  Mean +- std dev: 74.4 ns +- 2.2 ns

--

___
Python tracker 

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



[issue38631] Replace Py_FatalError() with regular Python exceptions

2019-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1d8da61f5ad26274556e0bbce260ce292d0402a1 by Victor Stinner in 
branch 'master':
bpo-38631: Avoid Py_FatalError() in readline (GH-16998)
https://github.com/python/cpython/commit/1d8da61f5ad26274556e0bbce260ce292d0402a1


--

___
Python tracker 

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



[issue38645] datetime.datetime.fromtimestamp(0, tzlocal()) throws error

2019-10-30 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +belopolsky, p-ganssle

___
Python tracker 

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



[issue38645] datetime.datetime.fromtimestamp(0, tzlocal()) throws error

2019-10-30 Thread Michael Zhang


New submission from Michael Zhang :

Discovered this while trying to use a function in `boto3`. Seems like when 
tzlocal() is passed with a 0 to datetime.datetime.fromtimestamp(), it throws an 
"[Errno 22] Invalid argument" error. Using 3.7.4 via Anaconda on Windows 10, 
and tzlocal().tznames's local timezone for me is EST/EDT.

Can replicate through this:
```
import datetime
from dateutil.tz import tzlocal

print(datetime.datetime.fromtimestamp(0, tzlocal()))
```

--
messages: 355720
nosy: mzhang13
priority: normal
severity: normal
status: open
title: datetime.datetime.fromtimestamp(0, tzlocal()) throws error
type: crash
versions: Python 3.7

___
Python tracker 

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



[issue38631] Replace Py_FatalError() with regular Python exceptions

2019-10-30 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38614] test_asyncio: test_communicate() failed on AMD64 FreeBSD Shared 3.8

2019-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a4ed6ed9f3779b6eda41bb65f5c09004a2b937ef by Victor Stinner in 
branch 'master':
bpo-38614: Increase asyncio test_communicate() timeout (GH-16995)
https://github.com/python/cpython/commit/a4ed6ed9f3779b6eda41bb65f5c09004a2b937ef


--

___
Python tracker 

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



[issue38614] test_asyncio: test_communicate() failed on AMD64 FreeBSD Shared 3.8

2019-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

PR 16995 should be backported to 3.7 and 3.8, but I will backport it once PR 
16964 will be backported.

--

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2019-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

PR 16997 is a first step. The second step will be to pass tstate to:

* _PyObject_Vectorcall()
* _PyObject_MakeTpCall()
* _Py_CheckFunctionResult()

(I have a local branch that I have to rewrite on top of PR 16997.)

--

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2019-10-30 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2019-10-30 Thread STINNER Victor


New submission from STINNER Victor :

Follow-up of bpo-36710 for function calls.

--
components: Interpreter Core
messages: 355716
nosy: vstinner
priority: normal
severity: normal
status: open
title: Pass explicitly tstate to function calls
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



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

2019-10-30 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



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

2019-10-30 Thread Zackery Spytz


New submission from Zackery Spytz :

If a base other than 2, 8, or 16 is passed to PyNumber_ToBase(), an assertion 
failure will occur. An exception should be raised instead.

This was mentioned in bpo-38249 (msg353039).

--
components: Interpreter Core
messages: 355715
nosy: ZackerySpytz
priority: normal
severity: normal
status: open
title: Assertion failures when calling PyNumber_ToBase() with an invalid base
type: crash
versions: Python 2.7, 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



[issue38614] test_asyncio: test_communicate() failed on AMD64 FreeBSD Shared 3.8

2019-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16522
pull_request: https://github.com/python/cpython/pull/16995

___
Python tracker 

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



[issue38642] python3.7.3 seems to cause add-apt-repository to rejct or not find gi library

2019-10-30 Thread Marco Ippolito


New submission from Marco Ippolito :

Following the indications found here: 
https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-repository
 
I was trying to install Docker Engine in Ubuntu 18.04.02 Server Edition.

The first installation's steps went fine but I encountered this error message:

(base) marco@pc:~$ sudo add-apt-repository \ 
> "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
> $(lsb_release -cs) \
> stable"
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 11, in 
from softwareproperties.SoftwareProperties import SoftwareProperties, 
shortcut_handler
  File "/usr/lib/python3/dist-packages/softwareproperties
/SoftwareProperties.py", line 67, in 
from gi.repository import Gio
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in 

from . import _gi
ImportError: cannot import name '_gi' from 'gi' (/usr/lib/python3/dist-
packages/gi/__init__.py)

But import gi in python3 works fine:

(base) marco@pc:~$ python3
Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> 


After changing the first line of /usr/bin/add-apt-repository in order to point 
to 3.6 version :  #!/usr/bin/python3.6 everything went fine: 

(base) marco@pc:~$ sudo add-apt-repository \
>"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
>$(lsb_release -cs) \
>stable"
Hit:1 http://gb.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]   
 
Get:3 http://gb.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 
kB] 
Get:4 http://gb.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6
 kB]
Get:5 https://download.docker.com/linux/ubuntu bionic/stable amd64
Packages [9594 B]
Get:6 http://gb.archive.ubuntu.com/ubuntu bionic-updates/universe i386 
Packages [985 kB]  
Get:7 http://gb.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 
Packages [1017 kB]
Hit:8 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease 

   
Hit:9 http://ppa.launchpad.net/certbot/certbot/ubuntu bionic InRelease  

   
Get:10 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 
kB] 
  
Fetched 2328 kB in 11s (217 kB/s)   

   
Reading package lists... Done

(base) marco@pc:~$ sudo apt-get update
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease
Hit:3 http://gb.archive.ubuntu.com/ubuntu bionic InRelease
Hit:4 http://gb.archive.ubuntu.com/ubuntu bionic-updates InRelease  
 
Hit:5 http://gb.archive.ubuntu.com/ubuntu bionic-backports InRelease
 
Hit:6 http://ppa.launchpad.net/certbot/certbot/ubuntu bionic InRelease
Hit:7 https://download.docker.com/linux/ubuntu bionic InRelease
Reading package lists... Done

(base) marco@pc:~$ sudo apt-get install docker-ce docker-ce-cli 
containerd.io
Reading package lists... Done
Building dependency tree   
Reading state information... Done
The following additional packages will be installed:
  aufs-tools cgroupfs-mount pigz
The following NEW packages will be installed
  aufs-tools cgroupfs-mount containerd.io docker-ce docker-ce-cli pigz
0 to upgrade, 6 to newly install, 0 to remove and 0 not to upgrade.
Need to get 85.6 MB of archives.
After this operation, 384 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y

So it seems that python3.7.3 has something which causes add-apt-repository to 
reject/not find gi library

--
messages: 355714
nosy: Marco Ippolito
priority: normal
severity: normal
status: open
title: python3.7.3 seems to cause add-apt-repository to rejct or not find gi 
library
type: compile error
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 

[issue38641] lib2to3 does not support py38 return/yield syntax with starred expressions

2019-10-30 Thread Vlad Emelianov


Change by Vlad Emelianov :


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



[issue38641] lib2to3 does not support py38 return/yield syntax with starred expressions

2019-10-30 Thread Vlad Emelianov


New submission from Vlad Emelianov :

Lib2to3 does not support changes made in https://bugs.python.org/issue32117

```python
def test():
my_list = ["value2", "value3"]
yield "value1", *my_list
return "value1", *my_list
```

The idea is to use `testlist_star_expr` instead of `testlist`.

This is a backwards compatible change, because testlist_star_expr supports test 
as well like testlist does.

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 355713
nosy: Vlad Emelianov
priority: normal
pull_requests: 16521
severity: normal
status: open
title: lib2to3 does not support py38 return/yield syntax with starred 
expressions
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



[issue32117] Tuple unpacking in return and yield statements

2019-10-30 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +16520
pull_request: https://github.com/python/cpython/pull/16994

___
Python tracker 

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



[issue38636] IDLE regression: toggle tabs and change indent width functions

2019-10-30 Thread Stephen Paul Chappell


Stephen Paul Chappell  added the comment:

When I start IDLE and the shell window appears, my first task is to press "Alt 
+ T" to change from using tabs to spaces and then "Alt + U" to change from 
using 8 spaces to 4. This allows code pasted from the shell into an editor 
window or other IDE to not require reformatting since those settings seem to be 
common for Python code. If the defaults for these settings were to be exposed 
in IDLE's settings under the General tab (maybe near the new "Show line numbers 
in new windows" checkbox), would it be best to make that request here or to 
open a new bug with an enhancement suggestion?

--

___
Python tracker 

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



[issue38640] while False: break => SyntaxError: 'break' outside loop

2019-10-30 Thread miss-islington


miss-islington  added the comment:


New changeset dcb338ea1b8f14e21dde3564658b9040df996349 by Miss Skeleton (bot) 
in branch '3.8':
bpo-38640: Allow break and continue in always false while loops (GH-16992)
https://github.com/python/cpython/commit/dcb338ea1b8f14e21dde3564658b9040df996349


--
nosy: +miss-islington

___
Python tracker 

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



[issue38640] while False: break => SyntaxError: 'break' outside loop

2019-10-30 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks, Hugo Dupras for the report! :)

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



[issue38640] while False: break => SyntaxError: 'break' outside loop

2019-10-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16519
pull_request: https://github.com/python/cpython/pull/16993

___
Python tracker 

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



[issue38640] while False: break => SyntaxError: 'break' outside loop

2019-10-30 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6c3e66a34b95fff07df0ad5086104dd637a091ce by Pablo Galindo in 
branch 'master':
bpo-38640: Allow break and continue in always false while loops (GH-16992)
https://github.com/python/cpython/commit/6c3e66a34b95fff07df0ad5086104dd637a091ce


--

___
Python tracker 

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



[issue38614] test_asyncio: test_communicate() failed on AMD64 FreeBSD Shared 3.8

2019-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 24c6258269acd842914450f55491690ba87dded9 by Victor Stinner in 
branch 'master':
bpo-38614: Add timeout constants to test.support (GH-16964)
https://github.com/python/cpython/commit/24c6258269acd842914450f55491690ba87dded9


--

___
Python tracker 

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



[issue28029] Replace and empty strings

2019-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

> Because of possible compatibility issue (very unlikely) this change is done 
> only in master and will not be backported.

Yeah, I agree. It would be a mistake to change the Python behavior in a minor 
release.

--

___
Python tracker 

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



[issue38630] subprocess.Popen.send_signal() should poll the process

2019-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

> subprocess.Popen.send_signal() doesn't check if the process exited since the 
> poll() method has been called for the last time. If the process exit just 
> before os.kill() is called, the signal can be sent to the wrong process if 
> the process identified is recycled.

I'm not sure under which conditions this case happens.

I understood that the pid is released (and so can be reused) as soon as the 
child process completes *and* waitpid() has been called.

Two cases:

* os.waitpid(pid, 0) can be called directly ("raw call")
* Popen API used, but called from a different thread: thread A calls 
send_signal(), thread B calls waitpid()

I'm mostly concerned by the multithreading case. I noticed the race condition 
while working on regrtest which uses 2 threads. One thread which is responsible 
for the process (call .communicate(), call .wait(), etc.), and one "main" 
thread which sends a signal to every child processes to interrupt them.

My first implementation called .wait() after calling .send_signal() in the main 
thread. But it seems like Popen is not "fully" thread safe: the "waitpid lock" 
only protects the os.waitpid() call, it doesn't protect the self.returncode 
attribute.

I modified regrtest to only call .waitpid() in the thread responsible of the 
process, to avoid such race condition. It seems like the new design is more 
reliable. The main thread only calls .send_signal(): it doesn't call .wait() 
(which calls os.waitpid()) anymore.

--

___
Python tracker 

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



[issue38640] while False: break => SyntaxError: 'break' outside loop

2019-10-30 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue38640] while False: break => SyntaxError: 'break' outside loop

2019-10-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +3.8regression
nosy: +pablogsal, serhiy.storchaka

___
Python tracker 

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



[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-30 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Maybe we should hold-off on adding negative number support unless a 
> compelling use case arises.

+100. It makes little sense mathematically, and I'm sceptical that such use 
cases exist in real life.

--

___
Python tracker 

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



[issue28029] Replace and empty strings

2019-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Because of possible compatibility issue (very unlikely) this change is done 
only in master and will not be backported.

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

___
Python tracker 

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



[issue28029] Replace and empty strings

2019-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 865c3b257fe38154a4320c7ee6afb416f665b9c2 by Serhiy Storchaka in 
branch 'master':
bpo-28029: Make "".replace("", s, n) returning s for any n != 0. (GH-16981)
https://github.com/python/cpython/commit/865c3b257fe38154a4320c7ee6afb416f665b9c2


--

___
Python tracker 

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



[issue38600] Change the mark up of NULL

2019-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 25fc088607c855060ed142296dc1bd0125fad1af by Serhiy Storchaka in 
branch 'master':
bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)
https://github.com/python/cpython/commit/25fc088607c855060ed142296dc1bd0125fad1af


--

___
Python tracker 

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



[issue38636] IDLE regression: toggle tabs and change indent width functions

2019-10-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Both the menu items and the short cuts for these two functions on the Format 
menu give these call errors.  They are only visible if IDLE is started from a 
console.

They work in 3.6; the regression is due to #36390.  These 2 functions were 
moved separately from the others in the 3rd PR, PR 14827, changeset 
1b3892243433da7eae7f5f3a4f98f13d309c8926.  I found the mistake and believe I 
have one possible version of a working fix on a new branch.

The diff contains this comment:
  # With mixed indents not allowed, these are semi-useless and not unittested.
I was thinking that they should be removed, but regardless, they should have 
been manually tested.  However, in one test with 3.6, a mixed indent -- tab + 4 
spaces following a 4 space tab -- did work, so I am not sure of the rule.  I 
will try to add a unittest along with the fix.

--
components:  -Windows
nosy:  -paul.moore, steve.dower, tim.golden, zach.ware
stage:  -> test needed
title: "Alt + T" and "Alt + U" Broken in IDLE on Windows -> IDLE regression: 
toggle tabs and change indent width functions
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



[issue38640] while False: break => SyntaxError: 'break' outside loop

2019-10-30 Thread Hugo Dupras


New submission from Hugo Dupras :

In python 3.8 the following code raises an exception, which was not the case 
with previous python.

```
while False:
...
break
```
It raises the following exception: SyntaxError: 'break' outside loop.
This `while False` loop was used to temporary disable a while loop in our code 
base.

Workaround to fix this:
```
enable=False
while enable:
...
break
``` (or use the walrus operator)

--
components: Interpreter Core
messages: 355700
nosy: jabesq
priority: normal
severity: normal
status: open
title: while False: break => SyntaxError: 'break' outside loop
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



[issue38639] Optimize floor(), ceil() and trunc() for floats

2019-10-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue38639] Optimize floor(), ceil() and trunc() for floats

2019-10-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
title: Optimize floor() and ceil() for floats -> Optimize floor(), ceil() and 
trunc() for floats

___
Python tracker 

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



[issue38639] Optimize floor() and ceil() for floats

2019-10-30 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently math.floor(), math.ceil() and math.trunc() look up special methods 
__floor__, __ceil__ and __trunc__ correspondingly and execute them if found. 
Otherwise they execute common code for floats. There are no special slots for 
these methods, so looking up these names in type dicts takes some time. It is a 
waste of time for most common case -- float objects.

The proposed PR adds checks PyFloat_CheckExact() before looking up the special 
method. Some microbenchmarks:

$ ./python -m pyperf timeit -s "from math import floor" --duplicate 100 
"floor(12345.6)"
Before:  Mean +- std dev: 63.2 ns +- 1.7 ns
After:   Mean +- std dev: 51.8 ns +- 1.3 ns

$ ./python -m pyperf timeit -s "from math import ceil" --duplicate 100 
"ceil(12345.6)"
Before:  Mean +- std dev: 61.1 ns +- 1.5 ns
After:   Mean +- std dev: 51.9 ns +- 1.1 ns

$ ./python -m pyperf timeit -s "from math import trunc" --duplicate 100 
"trunc(12345.6)"
Before:  Mean +- std dev: 72.0 ns +- 1.5 ns
After:   Mean +- std dev: 34.7 ns +- 1.4 ns

We should also check how this optimization affects other types:

$ ./python -m pyperf timeit -s "from math import floor" --duplicate 100 
"floor(12345)"
Before:  Mean +- std dev: 56.3 ns +- 1.3 ns
After:   Mean +- std dev: 56.3 ns +- 1.4 ns

$ ./python -m pyperf timeit -s "from math import ceil" --duplicate 100 
"ceil(12345)"
Before:  Mean +- std dev: 55.7 ns +- 1.6 ns
After:   Mean +- std dev: 56.8 ns +- 1.6 ns

$ ./python -m pyperf timeit -s "from math import trunc" --duplicate 100 
"trunc(12345)"
Before:  Mean +- std dev: 54.7 ns +- 1.3 ns
After:   Mean +- std dev: 56.7 ns +- 1.5 ns

--
components: Interpreter Core
messages: 355699
nosy: mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Optimize floor() and ceil() for floats
type: performance
versions: Python 3.9

___
Python tracker 

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



[issue38638] Backtrace of exit phase of context managers

2019-10-30 Thread Alexander Kurakin


New submission from Alexander Kurakin :

class CM:

def __init__(self):
pass

def __enter__(self):
return self

def __exit__(self, exc_type, exc_val, exc_tb):
raise RuntimeError()

if __name__ == '__main__':
with CM() as cm:
print('Hello')


$ python3 cm.py 
Hello
Traceback (most recent call last):
  File "cm.py", line 14, in 
print('Hello')  # <--
  File "cm.py", line 10, in __exit__
raise RuntimeError()
RuntimeError


Is it correct that print presents in backtrace? Well it's the last line but...

Thanks.

--
components: Interpreter Core
messages: 355698
nosy: kuraga
priority: normal
severity: normal
status: open
title: Backtrace of exit phase of context managers
type: behavior
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



[issue30548] typo in documentation for create_autospec

2019-10-30 Thread Erik Byström

Erik Byström  added the comment:

Yes, you're right. I do think the docs are a bit misleading.

Maybe something like this would make it more clear?

"If a class is used as a spec then the returned object will be a mock of that 
class. When the constructor of the returned mock class is invoked an instance 
object is returned that has the same spec as a normal instance object would 
have. By passing instance=True you can directly create a mock instance of the 
class."

If not, feel free to close this issue.

--

___
Python tracker 

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



[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-30 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Have you read the rest of the thread? There is a compelling reason to 
support harmonic mean including zero (resistors in parallel) but not yet 
any compelling reason to support negative values.

If you have a good use-case for harmonic mean of negative values, please 
tell us. Until then, I agree with Raymond: negative values should be 
treated as an error, as documented.

Can we go back to the original issue? Should we just document the 
"early out" behaviour on hitting zero, or should we follow the 
suggestion to check for bad data and raise?

I'm currently undecided which I would prefer.

--

___
Python tracker 

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



[issue38613] Optimize some set operations in dictkeys object

2019-10-30 Thread Inada Naoki


Inada Naoki  added the comment:

done.

--

___
Python tracker 

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



[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-30 Thread gaoxinge


gaoxinge  added the comment:

Your point makes sense. We should still also consider the `int`, `Decimal`, 
`Fraction`, `math.nan`, `math.inf`, `np.int` and so on. So

- `geometric mean`: input should be positive (>= 0)
- `harmonic mean`: input should be nonzero (!= 0)
- `mean` or `fmean`: no input restriction

--

___
Python tracker 

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