[issue35606] Add prod() function to the math module

2019-02-06 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue35606] Add prod() function to the math module

2019-02-06 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset bc098515864d0d1ffe8fb97ca1a0526c30fee45a by Raymond Hettinger 
(Pablo Galindo) in branch 'master':
bpo-35606: Implement math.prod (GH-11359)
https://github.com/python/cpython/commit/bc098515864d0d1ffe8fb97ca1a0526c30fee45a


--

___
Python tracker 

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



[issue22228] Adapt bash readline operate-and-get-next function

2019-02-06 Thread Lele Gaifax


Lele Gaifax  added the comment:

Luckily the referenced branch is still around on GH:

https://github.com/lelit/cpython-hg-mirror/tree/issue8_2

As the name says, it is not related to modern CPython' git repo though.

--

___
Python tracker 

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



[issue35906] Header Injection in urllib

2019-02-06 Thread Sihoon Lee


Sihoon Lee  added the comment:

Yes, I thought so. before the commit version i said, the previous 
version(~3.4.6), raised an exception(no host given~) in urlopen failing parsing 
host.
If this patch wants to be same as the previous version, It is right to raise an 
exception like the previous version.
I thought there is no exact answer, only depends on Python features.

--

___
Python tracker 

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



[issue35923] Update the BuiltinImporter in importlib to use loader._ORIGIN instead of a hardcoded value

2019-02-06 Thread Nina Zakharenko


Nina Zakharenko  added the comment:

Hey Dong-hee, Unfortunately, I already started the work on this which is why I 
assigned the ticket to myself when I opened it. This work came up as a 
continuation of another ticket I worked on - bpo-35321 / GH-11732. I wanted to 
keep them as separate issues.

I'm sorry, I hope you find another ticket to work on soon.

--

___
Python tracker 

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



[issue22228] Adapt bash readline operate-and-get-next function

2019-02-06 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

If the licencing issue is resolved, can we reconsider this for 3.8?

--
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue35927] Intra-package References Documentation Incomplete

2019-02-06 Thread ADataGman


New submission from ADataGman :

Attempting to follow 
https://docs.python.org/3.6/tutorial/modules.html#intra-package-references I 
was unable to recreate the intra-package reference as described. 

"For example, if the module sound.filters.vocoder needs to use the echo module 
in the sound.effects package, it can use from sound.effects import echo."

Creating the file structure described in 
https://docs.python.org/3.6/tutorial/modules.html#packages, with empty 
__init__.py files at all levels, or with __all__ defined as containing relevant 
file names, results in "No module named 'sound'". If I try to run this using 
"from ..effects import echo" then it results in "attempted relative import 
beyond top-level package".

At least one other user has run into this issue with this stack overflow post: 
https://stackoverflow.com/questions/53109627/python-intra-package-reference-doesnt-work-at-all

--
assignee: docs@python
components: Documentation
files: sound.zip
messages: 335002
nosy: ADataGman, docs@python
priority: normal
severity: normal
status: open
title: Intra-package References Documentation Incomplete
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file48109/sound.zip

___
Python tracker 

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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Ubuntu 3.7 and ARMv7 Ubuntu 3.x buildbots

2019-02-06 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Ubuntu 3.7 and ARMv7 Ubuntu 3.x buildbots

2019-02-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

FYI - the name of this bot is misleading. It is now Debian testing as of 18
hours ago instead of obsolete Ubuntu 14.04.  I finally upgraded it.

Opens version says 1.1.1a.

--
blame half the typos on my phone.

On Wed, Feb 6, 2019, 5:45 PM Pablo Galindo Salgado 
> New submission from Pablo Galindo Salgado :
>
> Example failures
>
> https://buildbot.python.org/all/#/builders/117
> https://buildbot.python.org/all/#/builders/106
>
> ==
> ERROR: test_networked_good_cert (test.test_httplib.HTTPSTest)
> --
> Traceback (most recent call last):
>   File
> "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/test/test_httplib.py",
> line 1629, in test_networked_good_cert
> h.request('GET', '/')
>   File
> "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
> line 1229, in request
> self._send_request(method, url, body, headers, encode_chunked)
>   File
> "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
> line 1275, in _send_request
> self.endheaders(body, encode_chunked=encode_chunked)
>   File
> "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
> line 1224, in endheaders
> self._send_output(message_body, encode_chunked=encode_chunked)
>   File
> "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
> line 1016, in _send_output
> self.send(msg)
>   File
> "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
> line 956, in send
> self.connect()
>   File
> "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
> line 1391, in connect
> self.sock = self._context.wrap_socket(self.sock,
>   File
> "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/ssl.py",
> line 405, in wrap_socket
> return self.sslsocket_class._create(
>   File
> "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/ssl.py",
> line 853, in _create
> self.do_handshake()
>   File
> "/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/ssl.py",
> line 1117, in do_handshake
> self._sslobj.do_handshake()
> ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
> verify failed: EE certificate key too weak (_ssl.c:1055)
> --
> Ran 105 tests in 2.477s
>
> Got an error:
> [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate
> (_ssl.c:1055)
> Got an error:
> [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate
> (_ssl.c:1055)
> Got an error:
> [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate
> (_ssl.c:1055)
> test_local_bad_hostname (test.test_httplib.HTTPSTest) ...  server
> (('127.0.0.1', 41921):41921 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)):
>[06/Feb/2019 06:22:07] code 404, message File not found
>  server (('127.0.0.1', 41921):41921 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3',
> 256)):
>[06/Feb/2019 06:22:07] "GET /nonexistent HTTP/1.1" 404 -
>  server (('127.0.0.1', 41921):41921 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3',
> 256)):
>[06/Feb/2019 06:22:07] code 404, message File not found
>  server (('127.0.0.1', 41921):41921 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3',
> 256)):
>[06/Feb/2019 06:22:07] "GET /nonexistent HTTP/1.1" 404 -
> stopping HTTPS server
> joining HTTPS thread
> ok
> test_local_good_hostname (test.test_httplib.HTTPSTest) ...  server
> (('127.0.0.1', 38877):38877 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)):
>[06/Feb/2019 06:22:07] code 404, message File not found
>  server (('127.0.0.1', 38877):38877 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3',
> 256)):
>[06/Feb/2019 06:22:07] "GET /nonexistent HTTP/1.1" 404 -
> stopping HTTPS server
> joining HTTPS thread
> ok
> Got an error:
> [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1055)
> test_local_unknown_cert (test.test_httplib.HTTPSTest) ... stopping HTTPS
> server
> joining HTTPS thread
> ok
>
> Multiple SSL failures, also old commits that previously succeeded fail
> now. This seems something in the buildbot itself. Gregory, do you know if
> something SLL related was upgraded/modify in the gps-ubuntu-exynos5-armv7l
> worker?
>
> --
> components: Tests
> messages: 334996
> nosy: gregory.p.smith, pablogsal
> priority: normal
> severity: normal
> status: open
> title: test_httplib test_nntplib test_ssl fail on ARMv7 Ubuntu 3.7 and
> ARMv7 Ubuntu 3.x buildbots
> versions: Python 3.7, Python 3.8
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___

[issue35906] Header Injection in urllib

2019-02-06 Thread Martin Panter


Martin Panter  added the comment:

Maybe related to Victor's "Issue 1" described in Issue 32085. That is also a 
security bug about CRLF in the URL's path, but was opened before Issue 30500 
was opened and the code changed, so I'm not sure if it is the same as this or 
not.

Also there is Issue 13359, a proposal to automatically percent-encode invalid 
URLs. For a security fix, I'm not sure but it might be safer to raise an 
exception, rather than rewriting the invalid URL to a valid one.

--

___
Python tracker 

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



[issue35906] Header Injection in urllib

2019-02-06 Thread Sihoon Lee


Sihoon Lee  added the comment:

Sorry, I'm late.
My review is here. https://github.com/python/cpython/pull/11768

--

___
Python tracker 

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



[issue35926] Need openssl 1.1.1 support on Windows for ARM and ARM64

2019-02-06 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch, patch, patch
pull_requests: +11757, 11758, 11759, 11760
stage:  -> patch review

___
Python tracker 

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



[issue35926] Need openssl 1.1.1 support on Windows for ARM and ARM64

2019-02-06 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch, patch
pull_requests: +11757, 11758, 11759
stage:  -> patch review

___
Python tracker 

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



[issue35926] Need openssl 1.1.1 support on Windows for ARM and ARM64

2019-02-06 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue35926] Need openssl 1.1.1 support on Windows for ARM and ARM64

2019-02-06 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch
pull_requests: +11757, 11758
stage:  -> patch review

___
Python tracker 

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



[issue35926] Need openssl 1.1.1 support on Windows for ARM and ARM64

2019-02-06 Thread Paul Monson


New submission from Paul Monson :

Need code and test changes to match https://bugs.python.org/issue35740

--
assignee: christian.heimes
components: SSL, Windows
messages: 334998
nosy: Paul Monson, christian.heimes, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Need openssl 1.1.1 support on Windows for ARM and ARM64
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



[issue35705] libffi support is not there for windows on ARM64

2019-02-06 Thread Paul Monson


Change by Paul Monson :


--
nosy: +Paul Monson

___
Python tracker 

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



[issue35740] openssl version 1.1.1 need to be there in cpython-source-deps for windows ARM64

2019-02-06 Thread Paul Monson


Change by Paul Monson :


--
nosy: +Paul Monson

___
Python tracker 

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



[issue35923] Update the BuiltinImporter in importlib to use loader._ORIGIN instead of a hardcoded value

2019-02-06 Thread Dong-hee Na


Dong-hee Na  added the comment:

@nnja

Hi, Can I work on this issue if no one works on it?

--
nosy: +corona10

___
Python tracker 

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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Ubuntu 3.7 and ARMv7 Ubuntu 3.x buildbots

2019-02-06 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Example failures

https://buildbot.python.org/all/#/builders/117
https://buildbot.python.org/all/#/builders/106

==
ERROR: test_networked_good_cert (test.test_httplib.HTTPSTest)
--
Traceback (most recent call last):
  File 
"/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/test/test_httplib.py",
 line 1629, in test_networked_good_cert
h.request('GET', '/')
  File 
"/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
 line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
  File 
"/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
 line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
  File 
"/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
 line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
  File 
"/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
 line 1016, in _send_output
self.send(msg)
  File 
"/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
 line 956, in send
self.connect()
  File 
"/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/http/client.py",
 line 1391, in connect
self.sock = self._context.wrap_socket(self.sock,
  File 
"/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/ssl.py", line 
405, in wrap_socket
return self.sslsocket_class._create(
  File 
"/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/ssl.py", line 
853, in _create
self.do_handshake()
  File 
"/ssd/buildbot/buildarea/3.x.gps-ubuntu-exynos5-armv7l/build/Lib/ssl.py", line 
1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate 
verify failed: EE certificate key too weak (_ssl.c:1055)
--
Ran 105 tests in 2.477s

Got an error:
[SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:1055)
Got an error:
[SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:1055)
Got an error:
[SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:1055)
test_local_bad_hostname (test.test_httplib.HTTPSTest) ...  server 
(('127.0.0.1', 41921):41921 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)):
   [06/Feb/2019 06:22:07] code 404, message File not found
 server (('127.0.0.1', 41921):41921 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)):
   [06/Feb/2019 06:22:07] "GET /nonexistent HTTP/1.1" 404 -
 server (('127.0.0.1', 41921):41921 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)):
   [06/Feb/2019 06:22:07] code 404, message File not found
 server (('127.0.0.1', 41921):41921 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)):
   [06/Feb/2019 06:22:07] "GET /nonexistent HTTP/1.1" 404 -
stopping HTTPS server
joining HTTPS thread
ok
test_local_good_hostname (test.test_httplib.HTTPSTest) ...  server 
(('127.0.0.1', 38877):38877 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)):
   [06/Feb/2019 06:22:07] code 404, message File not found
 server (('127.0.0.1', 38877):38877 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)):
   [06/Feb/2019 06:22:07] "GET /nonexistent HTTP/1.1" 404 -
stopping HTTPS server
joining HTTPS thread
ok
Got an error:
[SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1055)
test_local_unknown_cert (test.test_httplib.HTTPSTest) ... stopping HTTPS server
joining HTTPS thread
ok

Multiple SSL failures, also old commits that previously succeeded fail now. 
This seems something in the buildbot itself. Gregory, do you know if something 
SLL related was upgraded/modify in the gps-ubuntu-exynos5-armv7l worker?

--
components: Tests
messages: 334996
nosy: gregory.p.smith, pablogsal
priority: normal
severity: normal
status: open
title: test_httplib test_nntplib test_ssl fail on ARMv7 Ubuntu 3.7 and ARMv7 
Ubuntu 3.x buildbots
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue35606] Add prod() function to the math module

2019-02-06 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

PR 11359 has the following properties in its current state:

Performance vs naive implementation
---

./python -m perf timeit -s "import functools;import 
operator;iterable=list(range(1))" 'functools.reduce(operator.mul, iterable, 
1)'  .
Mean +- std dev: 654 us +- 15 us
./python -m perf timeit -s "import math;iterable=list(range(1))" 
'math.prod(iterable)'
.
Mean +- std dev: 72.3 us +- 1.1 us

./python -m perf timeit -s "import functools;import 
operator;iterable=list(map(float,range(1)))" 
'functools.reduce(operator.mul, iterable, 1)'
.
Mean +- std dev: 705 us +- 10 us

./python -m perf timeit -s "import math;iterable=list(map(float,range(1)))" 
'math.prod(iterable)'
.
Mean +- std dev: 52.9 us +- 2.0 us

./python -m perf timeit -s "import functools;import decimal;import 
operator;iterable=list(map(decimal.Decimal,range(1)))" 
'functools.reduce(operator.mul, iterable, 1)'
.
Mean +- std dev: 2.10 ms +- 0.03 ms

./python -m perf timeit -s "import math;import 
decimal;iterable=list(map(decimal.Decimal,range(1)))" 'math.prod(iterable)'
Mean +- std dev: 1.12 ms +- 0.21 ms

Properties
--

* It behaves with floats as numpy.prod:
   - A product of a finite floating-point (or convertible-to-float) numbers 
yields a float, nan or +-inf (no overflow checks).
   - A product involving infinities but no NaNs or zeros returns an 
appropriately-signed infinity.
   - A product involving both infinities and zeros (but not NaNs) returns 'NaN'.
   - A product involving a NaN at any point returns NaN.

* Is a implemented as general purpose function - like the built-in sum - as Tim 
is advising. It can multiply any Python type but has two fast-paths for floats 
and integers (or a mix of both).

-

In my humble opinion, any type-specialized implementation should exist in 
addition to this function (as fprod, iprod, scaledProd) while prod should 
remain as a general purpose function mirroring sum. Notice that people using 
numerical suites like numpy are used to the properties described in the 
previous paragraph and I think this is an advantage.

The main advantage of the function as it exists now in PR11359 is convenience 
and speed (almost 10x for fast paths and 2x for general types). I think this 
function will be very useful for scientific/statistical computing without the 
need for pulling in numpy and friends.

What do people think?

--
nosy: +pablogsal

___
Python tracker 

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



[issue35914] [2.7] PyStructSequence objects not behaving like nametuple

2019-02-06 Thread Eric Snow


Eric Snow  added the comment:

Sounds good.  I hope that helped.

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



[issue35921] Use ccache by default

2019-02-06 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Antoine, thanks for pointing out that ccache exists.  I got immediate 
build-time improvements.

For the Mac, I did a "brew install ccache" and prepended 
"/usr/local/opt/ccache/libexec". No modification of our files was necessary.

--
nosy: +rhettinger

___
Python tracker 

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



[issue22474] No explanation of how a task gets destroyed in asyncio 'task' documentation

2019-02-06 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

It seems that the note about a warning being logged if a pending task is 
destroyed does not exist in the new, rewritten version of the asyncio docs.  
Therefore, I'm going to close this as out of date.

--
nosy: +cheryl.sabella
resolution:  -> out of date
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



[issue35924] curses segfault resizing window

2019-02-06 Thread Josiah Ulfers


New submission from Josiah Ulfers :

To provoke a segmentation fault, run the attached, then grab the top or
bottom edge of the window. Move it down or up until it overlaps the box.
Might need to wiggle the edge a little, but it's reliably reproducible.

Expected error, which is what happens when dragging the left or right edge
instead of the top or bottom:

Traceback (most recent call last):
  File "cursesfault.py", line 12, in 
curses.wrapper(main)
  File "/usr/lib64/python3.6/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
  File "cursesfault.py", line 9, in main
w.addstr(0, 0, box)
_curses.error: addwstr() returned ERR

Actual error message varies a little. It's either:

*** Error in `python3': corrupted size vs. prev_size: 0x55b3055ba820 ***
Aborted (core dumped)

Or:

*** Error in `python3': double free or corruption (!prev): 
0x55b61e1ffbb0 ***
Aborted (core dumped)

Or:

*** Error in `python': malloc(): memory corruption: 0x564907a5a4f0 ***
Aborted (core dumped)

Possibly relates to issue15581

---

Python 2.7.14 and 3.6.5
OpenSUSE 15.0
KDE Plasma 5.12.6

uname -a
Linux ... 4.12.14-lp150.12.45-default #1 SMP Mon Jan 14 20:29:59 UTC 2019 
(7a62739) x86_64 x86_64 x86_64 GNU/Linux

--
components: Extension Modules
files: cursesfault.py
messages: 334991
nosy: Josiah Ulfers
priority: normal
severity: normal
status: open
title: curses segfault resizing window
type: crash
versions: Python 2.7, Python 3.6
Added file: https://bugs.python.org/file48108/cursesfault.py

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Isaac Boukris


Isaac Boukris  added the comment:

> But I want to raise the flag again: why we are adding new functionality to 
> the *deprecated* module? It violates our on deprecation policy, isn't it?

I'm biased but I see this as more of a small and subtle fix for the current 
logic that incorrectly treats this as a closed connection, rather than a new 
feature.
In addition, it could serve a documentation hint for people troubleshooting 
edge cases in their code (especially people who are not familiar with these 
semantics).

> Point with asyncore/chat is that every time you try to fix them you end up 
> messing with the public API one way or another.

I'd agree about the first commit (avoid calling recv with size zero), which may 
change the behavior for a poorly written application that tries to read a chunk 
of zero bytes, but the second commit is straight forward and I can't see how it 
could break anything.

--

___
Python tracker 

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



[issue35923] Update the BuiltinImporter in importlib to use loader._ORIGIN instead of a hardcoded value

2019-02-06 Thread Nina Zakharenko


New submission from Nina Zakharenko :

Update the BuiltinImporter in importllib to set the origin from the shared 
`loader._ORIGIN` attribute instead of using the hard-coded value of 'built-in' 
in order to match the functionality of FrozenImporter.

The FrozenImporter was updated to use this attribute in PR GH-11732 
(https://github.com/python/cpython/pull/11732)

--
assignee: nnja
components: Interpreter Core
messages: 334989
nosy: barry, nnja
priority: low
severity: normal
status: open
title: Update the BuiltinImporter in importlib to use loader._ORIGIN instead of 
a hardcoded value
type: enhancement
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue35921] Use ccache by default

2019-02-06 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

(sorry for the typos; a bit sick today)

--

___
Python tracker 

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



[issue35921] Use ccache by default

2019-02-06 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

> Besides not rebuilding .o[bj] files where the sources have not changed, what 
> else do these tools do?

That's a different caching scheme.

MSVC, make, ninja and friend will compare timestamps of the .c and .o files are 
avoid rebuilding if the .o file is younger.  However, this doesn't work when 
you switch e.g. git branches or compilation options (e.g. from debug to release 
and vice-versa).  ccache caches compilation results in its own cache directory 
and hashes command-line arguments as well as source file contenst.  So it 
covers more situations.

--

___
Python tracker 

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



[issue35887] Doc string for updating the frozen version of importlib in _bootstrap.py incorrect

2019-02-06 Thread Nina Zakharenko


Change by Nina Zakharenko :


--
keywords: +patch, patch
pull_requests: +11753, 11754
stage:  -> patch review

___
Python tracker 

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



[issue35887] Doc string for updating the frozen version of importlib in _bootstrap.py incorrect

2019-02-06 Thread Nina Zakharenko


Change by Nina Zakharenko :


--
keywords: +patch, patch, patch
pull_requests: +11753, 11754, 11755
stage:  -> patch review

___
Python tracker 

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



[issue35887] Doc string for updating the frozen version of importlib in _bootstrap.py incorrect

2019-02-06 Thread Nina Zakharenko


Change by Nina Zakharenko :


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

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

I agree. The problem I have with this is that it introduces a new method 
(handle_eof), which ends up in the "new functionality" bucket (even though it's 
not backward incompatible per-se, as it defaults on calling handle_close() 
anyway, but still it is technically a new API). Point with asyncore/chat is 
that every time you try to fix them you end up messing with the public API one 
way or another.

I know from experience (pyftpdlib) that all asyncore/chat users already 
subclass/overwrite the base classes quite massively, so if they really want to 
rely on this new functionality they probably already have implemented it 
themselves.

--

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Technically the change seems correct, we have the same logic for asyncio 
half-closed streams.

But I want to raise the flag again: why we are adding new functionality to the 
*deprecated* module? It violates our on deprecation policy, isn't it?

--

___
Python tracker 

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



[issue19953] __iadd__() doc not strictly correct

2019-02-06 Thread Felipe Manzano


Change by Felipe Manzano :


--
pull_requests: +11750, 11751

___
Python tracker 

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



[issue19953] __iadd__() doc not strictly correct

2019-02-06 Thread Felipe Manzano


Change by Felipe Manzano :


--
pull_requests: +11750

___
Python tracker 

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



[issue19953] __iadd__() doc not strictly correct

2019-02-06 Thread Felipe Manzano


Change by Felipe Manzano :


--
pull_requests: +11750, 11751, 11752

___
Python tracker 

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



[issue35904] Add statistics.fmean(seq)

2019-02-06 Thread Mark Dickinson


Mark Dickinson  added the comment:

Double-checking my own assertions: here's an example of a list xs of floats for 
which `fsum(xs) / len(xs)` is out by more than 1 ulp. (Obtained simply by 
checking a few lists of random.random() outputs; it's probably possible to 
construct something more obvious.)

Python 3.7.2 (default, Dec 30 2018, 08:55:50)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import fractions, math>>> xs = [float.fromhex(h) for h in 
>>> ['0x1.88104e64ffa5cp-3', '0x1.9b793215ddca8p-3', '0x1.754cbf6b09730p-1', 
>>> '0x1.e2b4ca1df3680p-2', '0x1.91689b66782e1p-1']]
>>> approx_mean = math.fsum(xs) / len(xs)
>>> approx_mean  # in [0.25, 0.5], so 1 ulp is 2**-54
0.47536945341150305
>>> exact_mean = sum(fractions.Fraction(x) for x in xs) / len(xs)
>>> exact_mean
Fraction(10704368466236809, 22517998136852480)
>>> error_in_ulps = abs(exact_mean - fractions.Fraction(approx_mean)) * 2**54
>>> float(error_in_ulps)
1.2

I ran checks on 100 such randomly generated lists, and the error never 
exceeded 1.5 ulps.

Sketch of proof of the 1.5 ulps bound: the fsum result is out by at most 0.5 
ulps; the length n of the list is presumably represented exactly (lists with 
more than 2**53 elements would be infeasible). Division of the fsum result by n 
keeps the relative error the same, but potentially magnifies the ulps error by 
two, due to the usual "wobble" between relative error and ulps error, so that 
gives us up to 1 ulp error. Then the result of the division may need to be 
rounded again, giving another potential error of up to 0.5 ulps. The bound is 
strict: we can't actually attain 1.5 ulps, so the result we get can't be more 
than 1 ulp away from the correctly rounded result.

> the proposed fmean name seems a bit unfortunate in that it's reversing the 
> sense of sum and fsum

I see Josh already made this observation: apologies for the duplicate 
bikeshedding.

--

___
Python tracker 

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



[issue35921] Use ccache by default

2019-02-06 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

time -p make CC="/usr/bin/ccache gcc" --jobs 4 --silent > stdout.txt ^ 
stderr.txt

real 4.36
user 3.69
sys 1.73

on a 4-thread CPU

i7-7560U CPU @ 2.40GHz

--
nosy: +matrixise

___
Python tracker 

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



[issue35922] robotparser crawl_delay and request_rate do not work with no matching entry

2019-02-06 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue35922] robotparser crawl_delay and request_rate do not work with no matching entry

2019-02-06 Thread Joseph Myers


New submission from Joseph Myers :

RobotFileParser.crawl_delay and RobotFileParser.request_rate raise 
AttributeError for a robots.txt with no matching entry for the given 
user-agent, including no default entry, rather than returning None which would 
be correct according to the documentation.  E.g.:

>>> from urllib.robotparser import RobotFileParser
>>> parser = RobotFileParser()
>>> parser.parse([])
>>> parser.crawl_delay('example')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.6/urllib/robotparser.py", line 182, in crawl_delay
return self.default_entry.delay
AttributeError: 'NoneType' object has no attribute 'delay'

--
components: Library (Lib)
messages: 334982
nosy: joseph_myers
priority: normal
severity: normal
status: open
title: robotparser crawl_delay and request_rate do not work with no matching 
entry
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue35903] Build of posixshmem.c should probe for required OS functions

2019-02-06 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

Hi Ronald,
I tested with my MacBook but I'm not sure what version of the OS.  Probably the 
latest but I can check when I get home.  Maybe my comment was not clear. On my 
MacBook, you don't need librt for shm_open, etc.  That sounds like it is the 
same as your 10.14.3.

AC_SEARCH_LIBS is the macro I'm using to find if I need to link with librt.  It 
is a bit hard to use though.  It will execute the true clause if the function 
doesn't require any of the specified libraries.  That seems to be the case for 
MacOS.  It also adds -lrt to LIBS and so I have to undo that.

I'm using $ac_cv_search_shm_open test if -lrt is actually needed.

--

___
Python tracker 

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



[issue35904] Add statistics.fmean(seq)

2019-02-06 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Are you saying that "fsum(seq) / len(seq)" is incorrect because on some
> older builds there is a rare possibility of an error of 1 unit in the last
> place?

Just to be clear, it's not that rare a possibility, and it's not restricted to 
older builds. I think Raymond is referring to the bug where on some machines 
that are still using the x87 for arithmetic, double rounding can lead to the 
fsum result being out (by potentially an arbitrary amount, not just 1 ulp). But 
even without that consideration, we'll still often be out by 1 ulp or more on 
typical new systems.

However, if I got my sums right (and assuming that fsum _is_ correctly rounded, 
and IEEE 754 arithmetic is in use, and the rounding mode hasn't been changed 
from its default of round-ties-to-even, and we're excluding corner cases like 
overflow, underflow, etc., etc.), the result of fsum(seq) / len(seq) can never 
be out by more than 1.5 ulps. That's better than NumPy can promise (even with 
its use of pairwise summation in some -- but not all -- cases), and should be 
good enough for almost any practical purpose.

I think I'd rather see the regular statistics.mean sacrifice the 
good-to-the-last-bit accuracy (and it's really not that much of a sacrifice: 
accurate to 1.5 ulps is a _very_ respectable compromise) than have a new 
function. I don't know how feasible that is, though, given all the 
type-handling in statistics.mean.

Bikeshedding time: the proposed fmean name seems a bit unfortunate in that it's 
reversing the sense of sum and fsum, where fsum is the correctly-rounded, 
slightly slower variant. My first assumption on seeing the name was that fmean 
was supposed to be to mean as fsum is to sum.

--

___
Python tracker 

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



[issue35921] Use ccache by default

2019-02-06 Thread Christian Heimes


Christian Heimes  added the comment:

The PR is not required. I have been using ccache for many years with a custom 
PATH. On Debian, it's recommended to modify PATH manually. On Fedora PATH is 
automatically modified by the ccache package.

$ echo $PATH
/home/heimes/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin
$ ls -la /usr/lib64/ccache/
total 252
drwxr-xr-x.   2 root root   4096 Dec 21 11:23 .
dr-xr-xr-x. 210 root root 249856 Jan 29 10:28 ..
lrwxrwxrwx.   1 root root 16 Dec 21 11:23 c++ -> ../../bin/ccache
lrwxrwxrwx.   1 root root 16 Dec 21 11:23 cc -> ../../bin/ccache
lrwxrwxrwx.   1 root root 16 Dec 21 11:23 g++ -> ../../bin/ccache
lrwxrwxrwx.   1 root root 16 Dec 21 11:23 gcc -> ../../bin/ccache
lrwxrwxrwx.   1 root root 16 Dec 21 11:23 x86_64-redhat-linux-c++ -> 
../../bin/ccache
lrwxrwxrwx.   1 root root 16 Dec 21 11:23 x86_64-redhat-linux-g++ -> 
../../bin/ccache
lrwxrwxrwx.   1 root root 16 Dec 21 11:23 x86_64-redhat-linux-gcc -> 
../../bin/ccache

--
nosy: +christian.heimes

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Isaac Boukris


Isaac Boukris  added the comment:

> It seems recv() returning b"" is an alias for "connection lost". E.g. in 
> Twisted:

To my understanding, technically the connection is not fully closed, it is just 
shut-down for reading but we can still perform write operations on it (that is, 
the client may be still waiting for the response). I can reproduce it with an 
http-1.0 client, I'll try to put up a test to demonstrate it more clearly.

>From recv() man page:
When a stream socket peer has performed an orderly shutdown, the return value 
will be 0 (the traditional "end-of-file" return).

--

___
Python tracker 

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



[issue35921] Use ccache by default

2019-02-06 Thread Steve Dower


Steve Dower  added the comment:

I think the caching that MSVC does naturally handles this well enough - 
certainly rebuilds normally just build those files that have not changed.

Besides not rebuilding .o[bj] files where the sources have not changed, what 
else do these tools do?

--

___
Python tracker 

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



[issue35904] Add statistics.fmean(seq)

2019-02-06 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

> When recv() return 0 we may still have data to send.

It seems recv() returning b"" is an alias for "connection lost". E.g. in 
Twisted:
https://github.com/twisted/twisted/blob/06c891502be9f6389451fcc959cad5485f55d653/src/twisted/internet/tcp.py#L227-L248

--

___
Python tracker 

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



[issue35920] Windows 10 ARM32 platform support

2019-02-06 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch, patch, patch
pull_requests: +11746, 11747, 11748, 11749
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



[issue35920] Windows 10 ARM32 platform support

2019-02-06 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch
pull_requests: +11746, 11747
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



[issue35920] Windows 10 ARM32 platform support

2019-02-06 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch, patch
pull_requests: +11746, 11747, 11749
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



[issue35920] Windows 10 ARM32 platform support

2019-02-06 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +11746
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



[issue35921] Use ccache by default

2019-02-06 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

This is Unix-only, but the same approach may be possible on Windows using 
clcache (https://github.com/frerich/clcache).

--
nosy: +steve.dower

___
Python tracker 

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



[issue35921] Use ccache by default

2019-02-06 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
keywords: +patch, patch
pull_requests: +11743, 11744
stage:  -> patch review

___
Python tracker 

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



[issue35921] Use ccache by default

2019-02-06 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
keywords: +patch, patch, patch
pull_requests: +11743, 11744, 11745
stage:  -> patch review

___
Python tracker 

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



[issue35921] Use ccache by default

2019-02-06 Thread Antoine Pitrou


Change by Antoine Pitrou :


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

___
Python tracker 

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



[issue35921] Use ccache by default

2019-02-06 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I've got a proof-of-concept patch, here are the results:

Debug build, uncached

real0m50,260s
user1m52,663s
sys 0m11,305s

Debug build, cached

real0m4,511s
user0m4,009s
sys 0m1,547s

Non-debug build, uncached

real1m18,384s
user3m19,271s
sys 0m12,319s

Non-debug build, cached

real0m4,047s
user0m3,467s
sys 0m1,621s

This is on a 16-thread CPU.

--

___
Python tracker 

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



[issue35920] Windows 10 ARM32 platform support

2019-02-06 Thread Paul Monson


Change by Paul Monson :


--
nosy: +Paul Monson

___
Python tracker 

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



[issue35921] Use ccache by default

2019-02-06 Thread Antoine Pitrou


New submission from Antoine Pitrou :

While compiling CPython isn't very slow, enabling ccache if found would produce 
faster builds when developing.

--
components: Build
messages: 334973
nosy: pitrou
priority: normal
severity: normal
status: open
title: Use ccache by default
type: resource usage
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



[issue35920] Windows 10 ARM32 platform support

2019-02-06 Thread Steve Dower


New submission from Steve Dower :

As posted at 
https://mail.python.org/pipermail/python-dev/2019-February/156229.html, add 
support for the Windows ARM32 platform.

This is related to issue33125, but we are doing ARM32 first before considering 
ARM64.

Paul Monson (Paul.Monson at microsoft.com) is implementing the support and will 
be the primary contact for Windows ARM32 support.

--
components: Windows
messages: 334972
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Windows 10 ARM32 platform support
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



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-06 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I agree with Rémi Lapeyre.

For reference, the len() check and current tests were added under issue 19156.

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue35914] [2.7] PyStructSequence objects not behaving like nametuple

2019-02-06 Thread Xiang Gao


Xiang Gao  added the comment:

Hi Eric,

Thanks for your valuable information and fast reply. You understand the problem 
exactly correct: initially pytorch had codes like `isinstance(x, tuple)` and 
lots of `PyTuple_Check`, but when we start to change the return type from tuple 
to structseq, these checks starts to fail.

Yes, I agree generally the impact is small for this issue. Most users of 
PyTorch would just use the way like `values, indices = a.max(dim=0)`, which 
works perfectly before or after that PR. The impacts are probably mostly on 
libraries that use PyTorch as dependency. These libraries might have generic 
code that should be able to handle returns of most operators, for example, 
something like:

User code:
```
import torch
import a_deep_learning_library

class MyModel(torch.nn.Module):
..
def forward(self, input_):
..
return tensor.sum(dim=0)

model = MyModel()
a_deep_learning_library.do_something(model)
```

Code of a_deep_learning_library:
```
def do_something(model):
input_ = prepare_input()
output = model(input_)
if torch.is_tensor(output):
do_something_1(output)
elif isinstance(output, float):
do_something_2(output)
elif isinstance(output, tuple):
sum_ = sum(output)
do_something_3(sum_)
elif 
```

Unpacking does not always work because it is hard to differentiate these two 
cases: `a, b = torch.tensor([1, 2])` and `a, b = torch.tensor([1, 2]), 
torch.tensor([3, 4])`, but your suggestion is very valuable.

I am neither a member of PyTorch team nor a Facebook employee. I am just a 
community contributor working on that issue. I will open an issue on PyTorch 
discussing the problem.

Thanks!

--

___
Python tracker 

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



[issue27344] zipfile *does* support utf-8 filenames

2019-02-06 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

This wording was removed as part of issue 32035.

--
nosy: +cheryl.sabella
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Documentation of zipfile.ZipFile().writestr() fails to mention 
that 'data' may also be bytes

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

My personal opinion is: we should accept bug fixes for asyncore but stop adding 
new features to the module.
asyncio supersedes asyncore in all aspects.

--
nosy: +asvetlov

___
Python tracker 

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



[issue35914] [2.7] PyStructSequence objects not behaving like nametuple

2019-02-06 Thread Eric Snow


Eric Snow  added the comment:

FWIW, if folks *are* checking for tuple (and I'd love to know why) then I'd 
recommend that they not. :)  A more Pythonic (and arguably generally better) 
approach would be to stick tightly to what data you need and take advantage of 
duck-typing.  When possible, try attribute access first if you expect that 
(e.g. namedtuple or struct seq).  Otherwise try use unpacking.

For example:

```
try:
x, y = ret.x, ret.y
except AttributeError:
pass
else:
...
```

```
try:
   x, y, _ = ret
except TypeError:
   pass
except ValueError:
   pass
else:
   ...
```

Either way is easier to follow than code that relies on type (and length) 
checking.  They also have the advantage of allowing arbitrary types that fit 
(duck-typing).

--

___
Python tracker 

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



[issue35914] [2.7] PyStructSequence objects not behaving like nametuple

2019-02-06 Thread Eric Snow


Eric Snow  added the comment:

[1] https://devguide.python.org/#status-of-python-branches

--

___
Python tracker 

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



[issue35914] [2.7] PyStructSequence objects not behaving like nametuple

2019-02-06 Thread Eric Snow


Eric Snow  added the comment:

tl;dr It's too late to change anything here.  Also, is it actually a problem in 
practice?



At this point enhancements can not go into 2.7 (you're welcome to appeal to the 
release manager).  The changes to `PyStructSequence` (from bpo-1820) appear to 
have been merged for 3.2 in July 2010.  However, this is just after 2.7 went 
final and 3 months after the first beta release (where no more enhancements are 
allowed).

Likewise, at this point we cannot revert the original change (from bpo-1820).  
Doing so in 3.7 (the only one taking bug fixes) or 3.8 (upcoming) would break 
compatibility with 3.2 and up.

Notably, this discrepancy has been there since 2.7/3.2 were released (8+ 
years).  I don't recall any previous reports of a problem here, so I expect the 
impact is small.

Regardless, from what I understand the problem is that pytorch was returning 
tuples and (with that PR) was going to return "named" tuples. 
 For C-extension functions it wouldn't actually be a tuple any more but a 
structseq instead.  So user code that checked for a tuple would suddenly work 
differently.  Is that right?

If so, I'm not clear on when this would be a problem in practice.  Why would 
users of pytorch (or any similar library) be checking the type returned from a 
specific function in the library's documented API?  If it was returning a tuple 
before then I'd expect them to be using unpacking or index access.  That would 
keep working if the library switched to namedtuple and structseq.

--
nosy: +benjamin.peterson, christian.heimes, eric.snow, rhettinger
type: behavior -> enhancement

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Isaac Boukris


Isaac Boukris  added the comment:

Fair enough. I'll sign the CLA meanwhile you consider it.

In my opinion it may still be useful in addressing issues in existing projects 
written using asyncore (and maybe for python2 as well).

Thanks!

--

___
Python tracker 

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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-06 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Also, for completeness (since discussion is getting split), please see my 
proposal to move SharedMemoryManager and SharedMemoryServer into 
multiprocessing.managers namespace and rename shared_memory.py to 
_shared_memory.py:
https://mail.python.org/pipermail/python-dev/2019-February/156235.html
Also, it appears ShareableList should be register()ed against 
SharedMemoryManager.

--

___
Python tracker 

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



[issue35919] multiprocessing: shared manager Pool fails with AttributeError

2019-02-06 Thread Giampaolo Rodola'


New submission from Giampaolo Rodola' :

import multiprocessing
import multiprocessing.managers

def f(n):
return n * n

def worker(pool):
with pool:
pool.apply_async(f, (10, ))

manager = multiprocessing.managers.SyncManager()
manager.start()
pool = manager.Pool(processes=4)
proc = multiprocessing.Process(target=worker, args=(pool, ))
proc.start()
proc.join()

This is related to BPO-35917 and it fails with:

Process Process-2:
Traceback (most recent call last):
  File "/home/giampaolo/cpython/Lib/multiprocessing/process.py", line 302, in 
_bootstrap
self.run()
  File "/home/giampaolo/cpython/Lib/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
  File "foo.py", line 54, in worker
pool.apply_async(f, (10, ))
  File "", line 2, in apply_async
  File "/home/giampaolo/cpython/Lib/multiprocessing/managers.py", line 802, in 
_callmethod
proxytype = self._manager._registry[token.typeid][-1]
AttributeError: 'NoneType' object has no attribute '_registry'

--
messages: 334962
nosy: davin, giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: multiprocessing: shared manager Pool fails with AttributeError

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

Hi!

> Assigning this to me but am not sure 1) when I'll be able to look at this 2) 
> whether it's worth it as asyncore is deprecated in favor of asyncio.

Yes, asyncore is deprecated since 3.6.

--
nosy: +eamanu

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Assigning this to me but am not sure 1) when I'll be able to look at this 2) 
whether it's worth it as asyncore is deprecated in favor of asyncio.

--
assignee:  -> giampaolo.rodola

___
Python tracker 

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



[issue35918] multiprocessing's SyncManager.dict.has_key() method is broken

2019-02-06 Thread Giampaolo Rodola'


New submission from Giampaolo Rodola' :

Related to BPO-35917:

$ ./python 
Python 3.8.0a1+ (heads/master:cd90f6a369, Feb  6 2019, 17:16:10) 
[GCC 7.3.0] on linux
>>> import multiprocessing.managers
>>> m = multiprocessing.managers.SyncManager()
>>> m.start()
>>> d = m.dict()
>>> 'has_key' in dir(d)
True
>>> d.has_key(1)
Traceback (most recent call last):
  File "/home/giampaolo/cpython/Lib/multiprocessing/managers.py", line 271, in 
serve_client
fallback_func = self.fallback_mapping[methodname]
KeyError: 'has_key'

--
messages: 334959
nosy: davin, giampaolo.rodola, jnoller, pitrou, sbt
priority: normal
severity: normal
stage: needs patch
status: open
title: multiprocessing's SyncManager.dict.has_key() method is broken
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue35915] re.search extreme slowness (looks like hang/livelock), searching for patterns containing .* in a large string

2019-02-06 Thread Tim Peters


Tim Peters  added the comment:

Yes, it's quadratic time.  If the string being searched has N characters, first 
it fails to find "x" in all N of 'em, then `.*` advances by one and it fails to 
find "x" in the trailing N-1 characters, then again in the trailing N-2, and so 
on.  N + N-1 + N-2 + ... + 1 is quadratic in N.

That's how this kind of regexp engine works.  And it's mild, as such things go: 
 you can also create poor regexps that take time _exponential_ in N that fail 
to match certain strings.

It's unlikely this will change without replacing Python's regexp implementation 
entirely.  For why, see Jeffrey Friedl's book "Mastering Regular Expressions" 
(published by O'Reilly).  That book also spells out techniques for crafting 
regexps that don't suck ;-)  It's not a small topic, alas.

--
nosy: +tim.peters

___
Python tracker 

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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-06 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Unit-tests at https://bugs.python.org/issue35917.

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue35915] re.search extreme slowness (looks like hang/livelock), searching for patterns containing .* in a large string

2019-02-06 Thread Ben Spiller


Ben Spiller  added the comment:

Running this command:
time python -c "import re;  re.compile('y.*x').search('y'*(N))"

It's clearly quadratic:
N=100,000 time=7s
N=200,000 time=18s
N=400,000 time=110s
N=1,000,000 time=690s

This illustrates how a simple program that's working correctly can quickly 
degrade to a very long period of unresponsiveness after some fairly modest 
increases in size of input string.

--

___
Python tracker 

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



[issue35917] multiprocessing: provide unit-tests for manager classes and shareable types

2019-02-06 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Would probably be worthwhile backporting to 3.7 as well.

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



[issue35917] multiprocessing: provide unit-tests for manager classes and shareable types

2019-02-06 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Interesting.  I had never looked too closely and assumed this was already 
tested.

--

___
Python tracker 

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



[issue35915] re.search extreme slowness (looks like hang/livelock), searching for patterns containing .* in a large string

2019-02-06 Thread Ben Spiller


Ben Spiller  added the comment:

Correction to original report - it doesn't hang indefinitely, it just takes a 
really long time. Specifically, looks like it's quadratic in the length of the 
input string. Increase the size of the input string to 1000*1000 and it's 
really really slow. 

I don't know for sure if it's possible to implement regexes in a way that 
avoids this pathological behaviour, but it's certainly quite risky that an 
otherwise working bit of code using a pattern containing .* can hang/livelock 
an application for an arbitrary  amount of time if passed a 
larger-than-expected (but actually not that big) input string.

--
title: re.search livelock/hang, searching for patterns starting .* in a large 
string -> re.search extreme slowness (looks like hang/livelock), searching for 
patterns containing .* in a large string
type: crash -> performance

___
Python tracker 

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



[issue35917] multiprocessing: provide unit-tests for manager classes and shareable types

2019-02-06 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
keywords: +patch, patch, patch
pull_requests: +11740, 11741, 11742

___
Python tracker 

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



[issue35917] multiprocessing: provide unit-tests for manager classes and shareable types

2019-02-06 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
keywords: +patch, patch
pull_requests: +11740, 11741

___
Python tracker 

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



[issue35917] multiprocessing: provide unit-tests for manager classes and shareable types

2019-02-06 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
keywords: +patch
pull_requests: +11740

___
Python tracker 

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



[issue35917] multiprocessing: provide unit-tests for manager classes and shareable types

2019-02-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue35911] add a cell construtor, and expose the cell type in Lib/types.py

2019-02-06 Thread Pierre Glaser


Change by Pierre Glaser :


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

___
Python tracker 

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



[issue35911] add a cell construtor, and expose the cell type in Lib/types.py

2019-02-06 Thread Pierre Glaser


Change by Pierre Glaser :


--
pull_requests: +11738, 11739
stage:  -> patch review

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread SilentGhost


Change by SilentGhost :


--
nosy: +giampaolo.rodola, josiahcarlson, stutzbach
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



[issue35917] multiprocessing: provide unit-tests for manager classes and shareable types

2019-02-06 Thread Giampaolo Rodola'


New submission from Giampaolo Rodola' :

This is a follow up of BPO-35813 and PR-11664 and it provides unit tests for 
SyncManager and SharedMemoryManager classes + all the shareable types which are 
supposed to be supported by them. Also, see relevant python-dev discussion at: 
https://mail.python.org/pipermail/python-dev/2019-February/156235.html.

In doing so I discovered a couple of issues which I will treat in a separate 
BPO ticket (multiprocessing.managers's dict.has_key() and Pool() appear to be 
broken).

--
components: Tests
messages: 334952
nosy: giampaolo.rodola
priority: normal
severity: normal
stage: patch review
status: open
title: multiprocessing: provide unit-tests for manager classes and shareable 
types
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



[issue35916] 3.6.5 try/except/else/finally block executes code with typos, no errors

2019-02-06 Thread SilentGhost

SilentGhost  added the comment:

This seem to be the exactly documented behaviour. From 
https://docs.python.org/3.8/reference/compound_stmts.html#the-try-statement

If finally is present, it specifies a ‘cleanup’ handler. The try clause is 
executed, including any except and else clauses. If an exception occurs in any 
of the clauses and is not handled, the exception is temporarily saved. The 
finally clause is executed. If there is a saved exception it is re-raised at 
the end of the finally clause. If the finally clause raises another exception, 
the saved exception is set as the context of the new exception. If the finally 
clause executes a return, break or continue statement, the saved exception is 
discarded.

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



[issue35916] 3.6.5 try/except/else/finally block executes code with typos, no errors

2019-02-06 Thread DMITRY KOSHELEV


New submission from DMITRY KOSHELEV :

Hello dear developer!
I was playing with try/else/finally block and have found a bug:

Inside of "else" or/and "except" I can do this 
  1 + print('Why do you print me?') + 1
this would print "Why do you print me?", 
in case if I have "finally" block with a "return" statement, no error raises,
if I don't have finally, nothing is printed.

def foo(var):
  try:
print("Hello")
# 1 + print("Hello")
except:
  1 + print('Why do you print me?') + 1
else:
  1 + print('Why do you print me?') + 1
finally:
  print("finally block")
  return

--
files: bug_in_try_exceptions.py
messages: 334950
nosy: dmitry_koshelev
priority: normal
severity: normal
status: open
title: 3.6.5 try/except/else/finally block executes code with typos, no errors
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file48107/bug_in_try_exceptions.py

___
Python tracker 

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



[issue35915] re.search livelock/hang, searching for patterns starting .* in a large string

2019-02-06 Thread Ben Spiller


New submission from Ben Spiller :

These work fine and return instantly:
python -c "import re;  re.compile('.*x').match('y'*(1000*100))"
python -c "import re;  re.compile('x').search('y'*(1000*100))"
python -c "import re;  re.compile('.*x').search('y'*(1000*10))"

This hangs / freezes / livelocks indefinitely, with lots of CPU usage:
python -c "import re;  re.compile('.*x').search('y'*(1000*100))"

Admittedly performing a search() with a pattern starting .* isn't useful, 
however it's worth fixing as:
- it's easily done by inexperienced developers, or users interacting with code 
that's far removed from the actual regex call
- the failure mode of hanging forever (with the GIL held, of course) is quite 
severe (took us a lot of debugging with gdb before we figured out where our 
complex multi-threaded python program was hanging!), and 
- the fact that the behaviour is different based on the length of the string 
being matched suggests there is some kind of underlying bug in how the buffer 
is handled whcih might also affect other, more reasonable regex use cases

--
components: Regular Expressions
messages: 334949
nosy: benspiller, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re.search livelock/hang, searching for patterns starting .* in a large 
string
type: crash
versions: Python 2.7, Python 3.6

___
Python tracker 

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



[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-06 Thread Steve Dower


Steve Dower  added the comment:

Victor may be thinking about it from time to time (or perhaps it's time to make 
the rest of the configuration changes plans concrete so we can all help out?), 
but I'd like to see this as either:

* a helper function to fill out the core config structure from a pyvenv.cfg 
file (rather than hiding it deeper as it currently is), or better yet,
* remove the dependency on all non-frozen imports at initialization and let 
embedders define Python code to do the initialization

In the latter case, the main python.exe also gets to define its behavior. So 
for the most part, we should be able to remove getpath[p].c and move it into 
the site module, then make that our Python initialization step.

This would also mean that if you are embedding Python but not allowing imports 
(e.g. as only a calculation engine), you don't have to do the dance of 
_denying_ all lookups, you simply don't initialize them.

But as far as I know, we don't have a concrete vision for "how will consumers 
embed Python in their apps" that can translate into work - we're still all 
individually pulling in slightly different directions. Sorting that out is most 
important - having someone willing to do the customer engagement work to define 
an actual set of requirements and desirables would be fantastic.

--
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-06 Thread Steve Dower


Steve Dower  added the comment:

> This includes _getdiskusage, _getfinalpathname, _getfullpathname, 
> _getvolumepathname, _isdir, and startfile. They have no place in a POSIX 
> module.

Except for startfile, I disagree. They are all there to help implement POSIX 
compatibility, and as private APIs, there's no better place to put them.

In any case, this issue is closed for now, pending a discussion on python-dev. 
If anyone feel strongly about making changes, it'll need to start with a post 
on the mailing list.

--

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch
pull_requests: +11735, 11736
stage:  -> patch review

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue35914] [2.7] PyStructSequence objects not behaving like nametuple

2019-02-06 Thread Xiang Gao


New submission from Xiang Gao :

Related: https://bugs.python.org/issue1820

On issue 1820, a bunch of improvements was made on PyStructSequence to make it 
behave like a namedtuple. These improvements are not ported to Python 2, which 
makes it a trouble to write python 2-3 compatible code.

See also: https://github.com/pytorch/pytorch/pull/15429#discussion_r253205020

--
components: Interpreter Core
messages: 334946
nosy: Xiang Gao
priority: normal
severity: normal
status: open
title: [2.7] PyStructSequence objects not behaving like nametuple
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I would prefer that we be consistent.  In any case, I think you should be added 
to Misc/ACKS in the PR.

--

___
Python tracker 

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



[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Isaac Boukris


New submission from Isaac Boukris :

When recv() return 0 we may still have data to send. Add a handler for this 
case, which may happen with some protocols, notably http1.0 ver.

Also, do not call recv with a buffer size of zero to avoid ambiguous return 
value (see recv man page).

--
components: Library (Lib)
messages: 334944
nosy: Isaac Boukris
priority: normal
severity: normal
status: open
title: asyncore: allow handling of half closed connections
type: behavior

___
Python tracker 

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



[issue35905] macOS build docs need refresh (2019)

2019-02-06 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I also have a script that does something very similar 
(https://github.com/jaraco/jaraco.develop/blob/master/jaraco/develop/macos-build-python.py),
 invoked with `python -m jaraco.develop.macos-build-python` (or `pip-run -m 
jaraco.develop -- -m jaraco.develop.macos-build-python` if you don't have it 
installed).

--

___
Python tracker 

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



[issue35912] _testembed.c fails to compile when using --with-cxx-main in the configure step

2019-02-06 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Programs/_testembed.c is compiled with $(MAINCC) in Makefile.pre.in and that 
will use the C++ compiler if --with-cxx-main is used in the configuration step. 
The problem is that if the C++ compiler used is some of the more uncommon ones 
(like the solaris compiler) some parts of _testembed.c and its includes fail to 
compile because they are assuming C99 or compiler extension. There are mainly 
two:

1) _testembed.c has gotos that crosses variable definitions. The C++ standard 
says:

If transfer of control enters the scope of any automatic variables (e.g. by 
jumping forward over a declaration statement), the program is ill-formed 
(cannot be compiled), unless all variables whose scope is entered have

1) scalar types declared without initializers
2) class types with trivial default constructors and trivial destructors 
declared without initializers
3) cv-qualified versions of one of the above
4) arrays of one of the above

So the gotos that can be found in `dump_config_impl` in `_testembed.c` are 
invalidating this rule.

2) `testembed.c` is pulling `pystate.h` and that header file defines a macro 
(_PyCoreConfig_INIT) that uses designated initializers that are not available 
as an extension in all C++ compilers.

The solutions that I can immediately think of aare:

1) Compile _testembed.c with the $(CC) instead of $(CCMAIN).
2) Change these files to make them compliant with the standard (by initializing 
all variables at the beginning and by using just compound literals).

--
components: Interpreter Core
messages: 334942
nosy: pablogsal
priority: normal
severity: normal
status: open
title: _testembed.c fails to compile when using --with-cxx-main in the 
configure step
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue34398] Docs search does not index glossary items

2019-02-06 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@ammar2, this looks like a great addition to the docs.  Would you be able to 
address Berker's request and also fix the merge conflict on the PR?

Also adding Julien and Carol from the expert's index for documentation.

--
nosy: +cheryl.sabella, mdk, willingc
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



  1   2   >