[issue32199] uuid.getnode() should return the MAC address on Android

2017-12-05 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Whatever the change made to fix this issue, it is not possible to add a test 
case for this change.

So following the suggestion made by Barry in PR 4696, we can add (in another 
issue) a new keyword parameter to getnode() named 'methods' whose value may be 
None (the default, meaning try all the known methods) or a tuple containing a 
subset of the following methods ('unix', 'ifconfig', 'ip', 'arp', 'lanscan', 
'netstat',  'random') that would raise an exception if the value cannot be 
obtained using one of the requested method tried in the requested order. This 
would also improve the documentation on the methods getnode() is using. Then if 
we decide to make the change for 'ip link' in the current issue, one can add a 
test case that would first test for the avaibility of the ip command and if the 
command exists would fail if getnode(methods=('ip',)) raises an exception.

--

___
Python tracker 

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



[issue32199] uuid.getnode() should return the MAC address on Android

2017-12-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What if "ip link list" was intentionally prohibited "for security reasons", and 
"ip link" works just due to oversight? Xavier, could you please inspect the 
sources of the ip command on Android? Is it the standard iproute2 with 
additional patches prohibiting the part of the functionality?

--

___
Python tracker 

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



[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.

2017-12-05 Thread Nick Coghlan

Nick Coghlan  added the comment:

See also https://bugs.python.org/issue31901, which reached a similar conclusion 
to this discussion (i.e. atexit functions should be run when the subinterpreter 
goes away).

--
nosy: +ncoghlan

___
Python tracker 

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



[issue32215] sqlite3 400x-600x slower depending on formatting of an UPDATE statement in a string

2017-12-05 Thread Berker Peksag

Change by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue32229] Simplify hiding developer warnings in user facing applications

2017-12-05 Thread Nick Coghlan

New submission from Nick Coghlan :

One of the observations coming out of the PEP 565 discussions is that it's 
surprisingly tricky to opt-in to getting all warnings from a particular package 
and its subpackages, while opting out of warnings in general.

The simplest approximation is to do the following:

if not sys.warnoptions:
warnings.simplefilter("ignore")
warnings.filterwarnings("default", module="app_pkg.*")

That shows warnings for any module or package starting with `app_pkg`. A 
stricter filter that avoided warnings from top-level packages that merely 
shared the prefix would look like:

if not sys.warnoptions:
warnings.simplefilter("ignore")
warnings.filterwarnings("default", module="^app_pkg(\..*)?$")

It could be helpful to encapsulate that logic in a more declarative utility 
API, such that applications could do the following:

import warnings.
warnings.hide_warnings()

Or:

import warnings.
warnings.hide_warnings(override_warnoptions=True)

Or:

import warnings.
warnings.hide_warnings(show=["app_pkg"])

Proposed API:

def hide_warnings(*, show=(), override_warnoptions=False):
if override_warnoptions or not sys.warnoptions:
simplefilter("ignore")
for pkg_name in show:
pkg_filter =  _make_regex_for_pkg(pkg_name)
filterwarnings("default", module=pkg_filter)

--
messages: 307701
nosy: ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Simplify hiding developer warnings in user facing applications
type: enhancement
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



[issue32220] multiprocessing: passing file descriptor using reduction breaks duplex pipes on darwin

2017-12-05 Thread Nate

Nate  added the comment:

According to https://developer.apple.com/library/content/qa/qa1541/_index.html 
some bugs were fixed in 10.5. Not sure if the original attempt to patch the 
problem was happening on < 10.5, or if this was still a problem in 10.5+.

I can't for the life of me find it again, but I had found another source that 
claimed the true fixes for OS X came out with 10.7.

In any case, because this code is specifically part of the multiprocessing 
package, whereby it should be *expected* for multiple processes to be accessing 
the pipe, it's disastrous for this code to be reading/writing an acknowledge 
packet in this manner.

This is a hard case to test for, as timing matters. The duplex pipe doesn't get 
confused/corrupted unless one process is sending/receiving a message over the 
pipe at the same moment that another process is executing your acknowledge 
logic. It's reproducible, but not 100%.

Personally, I've restructured to using one pipe exclusively for file descriptor 
passing, and using a separate Queue (or Pipe pair) for custom message passing. 
If a better fix cannot be established, at a minimum the documentation for 
multiprocessing and the Pipe class should be updated with a big red warning 
about passing file descriptors on OS X/macOS/darwin.

--

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-12-05 Thread Nick Coghlan

Nick Coghlan  added the comment:

Aye, I think Sanyam's proposed messages look good, and the "C().__init__() 
takes no arguments" wording is easier to follow than my suggested "C.__init__() 
takes exactly one argument" wording (as interpreting the latter currently 
requires noticing that it's referring to the *unbound* method taking one 
argument: the instance).

--

___
Python tracker 

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



[issue32228] truncate() changes current stream position

2017-12-05 Thread andreymal

Change by andreymal :


--
type:  -> behavior

___
Python tracker 

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



[issue32228] truncate() changes current stream position

2017-12-05 Thread andreymal

Change by andreymal :


--
title: truncate() changes tell() result -> truncate() changes current stream 
position

___
Python tracker 

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



[issue32228] truncate() changes tell() result

2017-12-05 Thread andreymal

New submission from andreymal :

See attached file.

As documentation about "truncate" says, "The current stream position isn’t 
changed." This is true for most cases. But this is not true for "wtf1.py" 
example. If you run it with Linux (Tested Debian 8 and Arch; Windows was not 
tested by me) and Python 3.3+ (or with Python 2.7 using backported "io" 
module), then these lines:

print('tell:', fp.tell())
print('truncate:', fp.truncate())
print('tell again:', fp.tell())

prints this:

tell: 4098
truncate: 4098
tell again: 4

As you can see, "tell" before truncate and "tell" after truncate are different. 
Looks like bug.

This bug will not reproduce with Python 2.7 and builtin "open" function; it 
affects only "io.open".

--
components: IO
files: wtf1.py
messages: 307698
nosy: andreymal
priority: normal
severity: normal
status: open
title: truncate() changes tell() result
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: https://bugs.python.org/file47321/wtf1.py

___
Python tracker 

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



[issue32199] uuid.getnode() should return the MAC address on Android

2017-12-05 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Dec 5, 2017, at 16:28, Xavier de Gaye  wrote:
> 
> The result of various 'ip' commands on Android, the last 'ip link list' 
> command is run as root and succeeds (did not think about trying that before):
> 
> generic_x86_64:/data/local/tmp/python $ ip link list
> request send failed: Permission denied
> 
> 1|generic_x86_64:/data/local/tmp/python $ ip link help
> request send failed: Permission denied
> 
> 1|generic_x86_64:/data/local/tmp/python $ ip link
…[output]…

Well, that’s weird!
-B

--

___
Python tracker 

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



[issue32215] sqlite3 400x-600x slower depending on formatting of an UPDATE statement in a string

2017-12-05 Thread Brian Forst

Brian Forst  added the comment:

Hi Antoine, yup, adding a space after the UPDATE makes the speed difference 
disappear on macOS Sierra and Windows 7.

--

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-05 Thread STINNER Victor

STINNER Victor  added the comment:

I removed old patches in favor of the now up to date PR 855.

--

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-05 Thread STINNER Victor

Change by STINNER Victor :


Removed file: https://bugs.python.org/file46274/encodings.py

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-05 Thread STINNER Victor

Change by STINNER Victor :


--
title: [WIP] Implementation of the PEP 540: Add a new UTF-8 mode -> PEP 540: 
Add a new UTF-8 mode

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-05 Thread STINNER Victor

Change by STINNER Victor :


Removed file: https://bugs.python.org/file46263/pep540-3.patch

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-05 Thread STINNER Victor

Change by STINNER Victor :


Removed file: https://bugs.python.org/file46258/pep540.patch

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-05 Thread STINNER Victor

Change by STINNER Victor :


Removed file: https://bugs.python.org/file46257/pep540_cli.py

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-05 Thread STINNER Victor

STINNER Victor  added the comment:

I rebased my PR on master.

--

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-05 Thread STINNER Victor

Change by STINNER Victor :


Removed file: https://bugs.python.org/file46270/pep540-4.patch

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-05 Thread STINNER Victor

Change by STINNER Victor :


Removed file: https://bugs.python.org/file46262/pep540-2.patch

___
Python tracker 

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



[issue32227] singledispatch support for type annotations

2017-12-05 Thread Łukasz Langa

Łukasz Langa  added the comment:

> this creates a circular dependency functools <-> typing

Well, it doesn't since I explicitly import typing inside singledispatch. By the 
time this import happens, functools is fully imported. This would only be a 
problem if functools itself tried to use singledispatch with annotations. Not 
impossible but super unlikely.

--

___
Python tracker 

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



[issue32227] singledispatch support for type annotations

2017-12-05 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

Idea looks interesting (like a basic runtime @overload). My expectation is that 
some changes are necessary in mypy for this to work properly.

Another (minor) problem is that this creates a circular dependency functools 
<-> typing.

--
nosy: +levkivskyi -gvanrossum
stage:  -> patch review

___
Python tracker 

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



[issue32227] singledispatch support for type annotations

2017-12-05 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

Oops something wrong happened.

--
nosy: +gvanrossum
stage: patch review -> 

___
Python tracker 

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



[issue32227] singledispatch support for type annotations

2017-12-05 Thread Łukasz Langa

Łukasz Langa  added the comment:

Guido, I know that you have a lot on your plate right now. Adding you because 
of PEP 443 and PEP 484.

--
nosy: +gvanrossum
stage: patch review -> 

___
Python tracker 

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



[issue32215] sqlite3 400x-600x slower depending on formatting of an UPDATE statement in a string

2017-12-05 Thread R. David Murray

R. David Murray  added the comment:

It disappears for me running it on linux with the blank added.

--

___
Python tracker 

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



[issue32199] uuid.getnode() should return the MAC address on Android

2017-12-05 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

The result of various 'ip' commands on Android, the last 'ip link list' command 
is run as root and succeeds (did not think about trying that before):

generic_x86_64:/data/local/tmp/python $ ip link list
request send failed: Permission denied

1|generic_x86_64:/data/local/tmp/python $ ip link help
request send failed: Permission denied

1|generic_x86_64:/data/local/tmp/python $ ip link
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode 
DEFAULT group default 
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: wlan0:  mtu 1500 qdisc mq state UP mode 
DORMANT group default qlen 1000
link/ether 02:00:00:44:55:66 brd ff:ff:ff:ff:ff:ff
5: hwsim0:  mtu 1500 qdisc noop state DOWN mode DEFAULT 
group default 
link/ieee802.11/radiotap 12:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
6: sit0:  mtu 1480 qdisc noop state DOWN mode DEFAULT group default 
link/sit 0.0.0.0 brd 0.0.0.0
8: radio0:  mtu 1500 qdisc pfifo_fast state UP 
mode DEFAULT group default qlen 1000
link/ether 22:d5:92:86:1a:d8 brd ff:ff:ff:ff:ff:ff

generic_x86_64:/data/local/tmp/python # ip link list
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode 
DEFAULT group default 
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: wlan0:  mtu 1500 qdisc mq state UP mode 
DORMANT group default qlen 1000
link/ether 02:00:00:44:55:66 brd ff:ff:ff:ff:ff:ff
5: hwsim0:  mtu 1500 qdisc noop state DOWN mode DEFAULT 
group default 
link/ieee802.11/radiotap 12:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
6: sit0:  mtu 1480 qdisc noop state DOWN mode DEFAULT group default 
link/sit 0.0.0.0 brd 0.0.0.0
8: radio0:  mtu 1500 qdisc pfifo_fast state DOWN mode 
DEFAULT group default qlen 1000
link/ether 22:d5:92:86:1a:d8 brd ff:ff:ff:ff:ff:ff

--

___
Python tracker 

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



[issue32227] singledispatch support for type annotations

2017-12-05 Thread Łukasz Langa

Change by Łukasz Langa :


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

___
Python tracker 

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



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2017-12-05 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

def func():
try:
try:
raise RuntimeError
except:
return 1
finally:
return 3
func()


Sorry, I've been collecting a whole slew of code snippets that cause issues 
with the "unwind_stack" branch.  I haven't organized them and made unit tests 
out of them though.  Two packages I found hairy try/except/finally code are 
"tox" and "gevent".

--

___
Python tracker 

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



[issue32227] singledispatch support for type annotations

2017-12-05 Thread Łukasz Langa

New submission from Łukasz Langa :

With the patch attached to this issue, @singledispatch gains support for 
passing the type in @register via annotations.

This looks more natural and enables more thorough type checking without 
repeating yourself:


@singledispatch
def generic(arg): ...

@generic.register
def _(arg: str): ...

@generic.register
def _(arg: int): ...


The previous API is still available for backwards compatibility, as well as 
stacking, and use with classes (sic, I was surprised to learn it's used that 
way, too).

The patch should be uncontroversial, maybe except for the fact that it's 
importing the `typing` module if annotations are used. This is necessary 
because of forward references, usage of None as a type, and so on. More 
importantly, with PEP 563 it's mandatory.

--
assignee: lukasz.langa
components: Library (Lib)
messages: 307686
nosy: lukasz.langa, rhettinger, yselivanov
priority: normal
severity: normal
status: open
title: singledispatch support for type annotations
type: enhancement
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



[issue26855] android: add platform.android_ver()

2017-12-05 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Yes, and fall back to spawning getprop if that fails.

In the following link Robin Gawenda is reporting that /system/build.prop is 
world readable on all the devices he checked: 
https://stackoverflow.com/questions/9937099/how-to-get-the-build-prop-values

--

___
Python tracker 

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



[issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec

2017-12-05 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
assignee: ghaering -> 
versions: +Python 3.7 -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec

2017-12-05 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec

2017-12-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

See https://bugs.python.org/issue32215 for what seems to be a related bug.

Also note that pysqlite now seems to be using a different logic:
https://github.com/ghaering/pysqlite/blob/master/src/cursor.c#L537-L548
Also this changeset:
https://github.com/ghaering/pysqlite/commit/94eae5002967a51782f36ce9b7b81bba5b4379db

As a sidenote, this seems to mean that the stdlib sqlite module doesn't receive 
updates anymore from its author...?

--
nosy: +pitrou, r.david.murray

___
Python tracker 

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



[issue32215] sqlite3 400x-600x slower depending on formatting of an UPDATE statement in a string

2017-12-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Brian, does the speed difference disappear when you add a space character just 
after "UPDATE"?
We may be hitting this path: 
https://github.com/python/cpython/blob/master/Modules/_sqlite/statement.c#L76-L93

--
nosy: +pitrou

___
Python tracker 

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



[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-05 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


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



[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-05 Thread Ivan Levkivskyi

New submission from Ivan Levkivskyi :

As discussed before, there will be two PRs. One for the core components, and 
the second one (large) for typing updates. I will open the first PR shortly.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-05 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
assignee: levkivskyi
components: Interpreter Core, Library (Lib)
nosy: levkivskyi
priority: normal
severity: normal
stage: needs patch
status: open
title: Implement PEP 560: Core support for typing module and generic types
type: enhancement
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



[issue32225] Implement PEP 562: module __getattr__ and __dir__

2017-12-05 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
keywords: +patch
pull_requests: +4634

___
Python tracker 

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



[issue32225] Implement PEP 562: module __getattr__ and __dir__

2017-12-05 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
assignee: levkivskyi
components: Interpreter Core
nosy: levkivskyi
priority: normal
severity: normal
stage: patch review
status: open
title: Implement PEP 562: module __getattr__ and __dir__
type: enhancement
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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2017-12-05 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Hi Cristian,

>  I don't want to have three ways to load certificates, especially when it 
> involves more C code.

I think this (more C code) is the primary and the *only* negative point against 
the current patch. And that seems necessary for the feature specific to 
OpenSSL. 

Not sure if you looked at the latest version 
(https://github.com/python/cpython/pull/2449/files) recently. 

The current patch does not deviate in-principle from the PEP 543.

It maintains the same API arguments ` SSLContext.load_cert_chain(certfile, 
keyfile=None, password=None)`

* We expect the migration of ssl module to newer ABC of PEP-543 not be 
one-to-one. We could foresee this API living. (And we haven't deprecated this 
API).

* The patch provides the feature along with plenty of tests that PEP-543 talks 
about (Loading of certs from memory).

* Has an implementation refactorable for OpenSSL-specific TLS backend (as one 
of the provider), that again will be useful to PEP-543 implementation.

These are the benefits in my opinion.

PEP-543 is important and seems like a *major effort*. The current patch might 
still be valuable and perhaps might be useful towards PEP-543 implementation. 
It deals only with certificates only.

--

___
Python tracker 

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



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2017-12-05 Thread Mark Shannon

Mark Shannon  added the comment:

0610860 doesn't include any tests. What is it fixing?
3794016 passes the same set of tests.

Do have an actual code example that produces erroneous behaviour?

--

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-12-05 Thread Sanyam Khurana

Sanyam Khurana  added the comment:

Nick,

I think the error messages are incorrect. We expect error message to be `takes 
no argument` rather than `takes exactly one argument`. Can you please confirm 
that?

I think for the class without any method overrides, the functionality should be 
something like this:

 >>> class C:
... pass
...
>>> C(42)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: C() takes no arguments
>>> C.__new__(C, 42)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: C() takes no arguments
>>> C().__init__(42)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: C().__init__() takes no arguments
>>> object.__new__(C, 42)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: C() takes no arguments
>>> object.__init__(C(), 42)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: C().__init__() takes no arguments



Is that correct?

--

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-12-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I think the main problem is not with coding, but with design. And from this 
point of view this may be not so easy issue. Let wait until Nick has a time to 
work on it.

--

___
Python tracker 

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



[issue32199] uuid.getnode() should return the MAC address on Android

2017-12-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Why the 'ip link list' command fails on Android at first place? Does Android 
use its own independent implementation? Or its version is based on the fork of 
very old version of iproute2 that didn't supported the list command (if there 
was such version)?

--

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-12-05 Thread Sanyam Khurana

Sanyam Khurana  added the comment:

I'll work on a fix for this and issue a PR.

--
nosy: +CuriousLearner

___
Python tracker 

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



[issue32199] uuid.getnode() should return the MAC address on Android

2017-12-05 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Over in the PR I suggested:

Here's another thought: what if you just added another getter that calls ip 
link list and placed that after one that calls ip link. Wouldn't that 
accomplish both goals? Then if ip link fails, we fall back to the old behavior, 
so nothing changes. It's uglier, but it doesn't special case for the Android 
platform, and eventually we can decide to remove ip link list altogether.

--
nosy: +barry

___
Python tracker 

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



[issue32224] socket.create_connection needs to support full IPv6 argument

2017-12-05 Thread Matthew Stoltenberg

Change by Matthew Stoltenberg :


--
title: socket.creaet_connection needs to support full IPv6 argument -> 
socket.create_connection needs to support full IPv6 argument

___
Python tracker 

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



[issue32224] socket.creaet_connection needs to support full IPv6 argument

2017-12-05 Thread Matthew Stoltenberg

New submission from Matthew Stoltenberg :

The following causes a ValueError in the create_connection convenience function

import socket

sock1 = socket.create_connection(('::1', '80'))
sock2 = socket.create_connection(sock1.getpeername())

--
components: Library (Lib)
messages: 307674
nosy: Matthew Stoltenberg
priority: normal
severity: normal
status: open
title: socket.creaet_connection needs to support full IPv6 argument
type: behavior
versions: Python 3.4, Python 3.6

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-12-05 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset 7a6f28f2802db3da79b3c2bd5d75e40eb0709744 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.6':
bpo-30928: update idlelib/NEWS.txt. (GH-4706) (#4707)
https://github.com/python/cpython/commit/7a6f28f2802db3da79b3c2bd5d75e40eb0709744


--

___
Python tracker 

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



[issue26855] android: add platform.android_ver()

2017-12-05 Thread STINNER Victor

STINNER Victor  added the comment:

"-rw-r--r-- 1 root root 2083 2017-07-12 22:01 /system/build.prop" so
anyone can *read* the file. Maybe we can write a cheap parser for it,
instead of spawning a subprocess or relying on a private function
which may be removed in the near future?

--

___
Python tracker 

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



[issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers)

2017-12-05 Thread Neil Schemenauer

Change by Neil Schemenauer :


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



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2017-12-05 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

There is some more explanation in the PR and sample code.

We unwind, if we hit a finally fblock, we emit code of the body of it.  If 
inside the block, there is another return statement, we unwind again.  That 
causes an infinite loop in the compiler.

The commit 0610860 is a fix, I think.  I have a cleaner version but haven't 
pushed it yet.  There are still some remaining bugs though, caused by "return" 
in the finally body.  The problem as I see it is that "unwind_exception" in 
ceval pushes a EXCEPT_HANDLER fblock if we are inside a SETUP_EXCEPT or 
SETUP_FINALLY block.  If there is a return in the finally body, the compiler 
doesn't know if it should POP_BLOCK or not.  At least, that is my understanding 
now.

I think the best way forward is to split this patch into multiple parts.  I 
have a simple patch that changes fblockinfo to be a singly linked list (like 
blockinfo).  Next, I think we could change the exception opcodes to have a 
fixed stack effect (don't think that requires unwind to be done by compiler).  
Rather than pushing three values for an exception, could we just build a tuple 
and push that?  Seems simpler to me vs having ROT_FOUR. Finally, we can tackle 
the compiler based unwind.

--

___
Python tracker 

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



[issue32223] distutils doesn't correctly read UTF-8 content from config files

2017-12-05 Thread Dan

Change by Dan :


Added file: https://bugs.python.org/file47319/setup.cfg

___
Python tracker 

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



[issue32223] distutils doesn't correctly read UTF-8 content from config files

2017-12-05 Thread Dan

Dan  added the comment:

I've attached the files.

Run using 'python setup.py sdist'.
The resulting PKG-INFO will contain incorrect data:

Summary: délivrance
Author: Dan Tès

The expected output is:

Summary: délivrance
Author: Dan Tès

--

___
Python tracker 

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



[issue32223] distutils doesn't correctly read UTF-8 content from config files

2017-12-05 Thread Dan

Change by Dan :


Added file: https://bugs.python.org/file47320/setup.py

___
Python tracker 

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



[issue32223] distutils doesn't correctly read UTF-8 content from config files

2017-12-05 Thread Éric Araujo

Change by Éric Araujo :


--
versions:  -Python 3.4, Python 3.5, Python 3.8

___
Python tracker 

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



[issue32223] distutils doesn't correctly read UTF-8 content from config files

2017-12-05 Thread Éric Araujo

Éric Araujo  added the comment:

Can you give an example setup.cfg file, setup.py command and the full error 
message?

--

___
Python tracker 

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



[issue32223] distutils doesn't correctly read UTF-8 content from config files

2017-12-05 Thread Dan

New submission from Dan :

On Windows, distutils doesn't correctly read UTF-8 content from config files 
(setup.cfg).

Seems like the issue is located on the line reading the files via the 
ConfigParser; simply adding 'encoding="UTF-8"' as argument fixes the problem 
for me: https://github.com/python/cpython/pull/4727

On Linux it seems to be working fine.

--
components: Distutils, Library (Lib), Windows
messages: 307668
nosy: delivrance, dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
pull_requests: 4633
severity: normal
status: open
title: distutils doesn't correctly read UTF-8 content from config files
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32210] Add platform.android_ver() to test.pythoninfo for Android platforms

2017-12-05 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
dependencies: +android: add platform.android_ver()
title: Add the versions of the Android SDK and NDK to test.pythoninfo -> Add 
platform.android_ver()  to test.pythoninfo for Android platforms

___
Python tracker 

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



[issue26855] android: add platform.android_ver()

2017-12-05 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

I cannot find a reference to the "build.prop" file in the Android documentation 
but google answers at the question ' what is "build.prop"':

The “build.prop” file is a system file that exists on every Android device. 
The file contains build information and other system properties which are used 
throughout the operating system.

and stackoverflow is thriving with questions on how to edit this file.

The file contains part of the information returned by the getprop command and 
all the information we are needing here.

Here is its content and access rights on an android-24-x86_64 emulator:

generic_x86_64:/data/local/tmp/python $ ls -al /system/build.prop
-rw-r--r-- 1 root root 2083 2017-07-12 22:01 /system/build.prop
generic_x86_64:/data/local/tmp/python $ cat /system/build.prop

# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=NYC
ro.build.display.id=sdk_phone_x86_64-userdebug 7.0 NYC 4174735 test-keys
ro.build.version.incremental=4174735
ro.build.version.sdk=24
ro.build.version.preview_sdk=0
ro.build.version.codename=REL
ro.build.version.all_codenames=REL
ro.build.version.release=7.0
ro.build.version.security_patch=2017-06-05
ro.build.version.base_os=
ro.build.date=Wed Jul 12 19:46:52 UTC 2017
ro.build.date.utc=149912
ro.build.type=userdebug
ro.build.user=android-build
ro.build.host=wphl5.hot.corp.google.com
ro.build.tags=test-keys
ro.build.flavor=sdk_phone_x86_64-userdebug
ro.product.model=Android SDK built for x86_64
ro.product.brand=Android
ro.product.name=sdk_phone_x86_64
ro.product.device=generic_x86_64
ro.product.board=
# ro.product.cpu.abi and ro.product.cpu.abi2 are obsolete,
# use ro.product.cpu.abilist instead.
ro.product.cpu.abi=x86_64
ro.product.cpu.abilist=x86_64,x86
ro.product.cpu.abilist32=x86
ro.product.cpu.abilist64=x86_64
ro.product.manufacturer=unknown
ro.product.locale=en-US
ro.wifi.channels=
ro.board.platform=
# ro.build.product is obsolete; use ro.product.device
ro.build.product=generic_x86_64
ro.product.cpu.abilist=x86_64,x86
ro.product.cpu.abilist32=x86
ro.product.cpu.abilist64=x86_64
ro.product.manufacturer=unknown
ro.product.locale=en-US
ro.wifi.channels=
ro.board.platform=
# ro.build.product is obsolete; use ro.product.device
ro.build.product=generic_x86_64
# Do not try to parse description, fingerprint, or thumbprint
ro.build.description=sdk_phone_x86_64-userdebug 7.0 NYC 4174735 test-keys
ro.build.fingerprint=Android/sdk_phone_x86_64/generic_x86_64:7.0/NYC/4174735:userdebug/test-keys
ro.build.characteristics=emulator
# end build properties
#
# from build/target/board/generic_x86_64/system.prop
#
#
# system.prop for generic sdk
#

rild.libpath=/system/lib/libreference-ril.so
rild.libargs=-d /dev/ttyS0

#
# ADDITIONAL_BUILD_PROPERTIES
#
ro.config.notification_sound=OnTheHunt.ogg
ro.config.alarm_alert=Alarm_Classic.ogg
persist.sys.dalvik.vm.lib.2=libart.so
dalvik.vm.isa.x86_64.variant=x86_64
dalvik.vm.isa.x86_64.features=default
dalvik.vm.isa.x86.variant=x86
dalvik.vm.isa.x86.features=default
dalvik.vm.lockprof.threshold=500
xmpp.auto-presence=true
ro.config.nocheckin=yes
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt

--

___
Python tracker 

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



[issue32217] freeze.py fails to work.

2017-12-05 Thread Decorater

Decorater  added the comment:

python ..\externals\cpython\Tools\freeze\freeze.py pyeimport.py
Error: needed directory E:\python360\lib\python3.6\config-3.6 not found
Use ``..\externals\cpython\Tools\freeze\freeze.py -h'' for help

Seems like freeze works now with no traceback. However on Windows I need to 
figure out how to make it actually work without ``make install`` because lack 
of ``make install`` on Windows.

:thinking: how can it know on Windows what the config to python could be?

--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-05 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 33c377ed9b6cb3b9493005314c4e0cfa7517ea65 by Victor Stinner in 
branch 'master':
bpo-32030: Simplify _PyCoreConfig_INIT macro (#4728)
https://github.com/python/cpython/commit/33c377ed9b6cb3b9493005314c4e0cfa7517ea65


--

___
Python tracker 

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



[issue22589] mimetypes uses image/x-ms-bmp as the type for bmp files

2017-12-05 Thread R. David Murray

R. David Murray  added the comment:

That's the basis, but its a bit more complicated than that (NEWS item, putting 
bpo-22589 in the issue title, the question of signing a CLA, though a CLA 
doesn't really matter for this kind of change IMO).  If you can't do it one of 
our core-mentorship volunteers will take care of it, I'm sure.

--
keywords: +easy

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-05 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4632

___
Python tracker 

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



[issue22589] mimetypes uses image/x-ms-bmp as the type for bmp files

2017-12-05 Thread Jonathan Watt

Jonathan Watt  added the comment:

I'm unfamiliar with the Python contribution procedures. If it's simply a case 
of cloning from github.com and putting up a PR then I can do that. I'm 
overloaded currently though, so if it's more involved than that it may take me 
a while to figure things out.

--

___
Python tracker 

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



[issue26855] android: add platform.android_ver()

2017-12-05 Thread STINNER Victor

STINNER Victor  added the comment:

Chromium still uses the private __system_property_get() function:

https://chromium.googlesource.com/chromium/+/trunk/base/sys_info_android.cc

I would prefer a C function call rather than spawning a subprocess, just to get 
a value. But the function seems private, and I see discussion about removal of 
the function...

--
nosy: +vstinner

___
Python tracker 

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



[issue22589] mimetypes uses image/x-ms-bmp as the type for bmp files

2017-12-05 Thread Jonathan Watt

Jonathan Watt  added the comment:

> If image/bmp is now[*] the official IANA type

You can find image/bmp here:

https://www.iana.org/assignments/media-types/media-types.xhtml#image

--

___
Python tracker 

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



[issue22589] mimetypes uses image/x-ms-bmp as the type for bmp files

2017-12-05 Thread R. David Murray

R. David Murray  added the comment:

If image/bmp is now[*] the official IANA type, mimetypes should use that.  
However, because this is a change with possible backward compatibility issues, 
it should probably only go into 3.7, but I'm open to arguments about that.

[*] The mimetypes module is very old and nobody specifically maintains it; we 
depend on user reports for updates to it, and obviously this one was 
overlooked.  Care to prepare a PR?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue27240] 'UnstructuredTokenList' object has no attribute '_fold_as_ew'

2017-12-05 Thread R. David Murray

R. David Murray  added the comment:

Huh, I thought I had closed it.

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



[issue22589] mimetypes uses image/x-ms-bmp as the type for bmp files

2017-12-05 Thread Jonathan Watt

Jonathan Watt  added the comment:

I should note that while Chrome will refuse to open an image/x-ms-bmp file 
directly, when loaded as an image embedded in a document (e.g. via HTML's 
) then Chrome doesn't care what MIME type it has. It will sniff the image 
stream and detect from its contents that it is a BMP image and correctly render 
it.

--

___
Python tracker 

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



[issue32210] Add the versions of the Android SDK and NDK to test.pythoninfo

2017-12-05 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

The NDK version may be printed by the pythoninfo make target before 
test.pythoninfo is run on Android.

platform.android_ver() (not yet implemented, see issue 26855) must be added to 
collect_sys() in test.pythoninfo.

--

___
Python tracker 

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



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2017-12-05 Thread Mark Shannon

Mark Shannon  added the comment:

On 04/12/17 17:53, Neil Schemenauer wrote:

> There is a bug with the PR regarding the final bodies.  Exits from the final 
> body cause the whole fblock stack to unwind, not just the blocks enclosing 
> the final body.  Unwind looks at 'c' to get the fblock stack. I think we need 
> to allocate fblockinfo on the C stack and then use a back pointer to 
> enclosing block.  When you get into a final body that creates its own 
> fblockinfo (e.g. a try/except inside the finally), the current code doesn't 
> work.

I don't really follow you.
Could you provide a code example that will expose this error?

--

___
Python tracker 

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



[issue32219] SSLWantWriteError being raised by blocking SSL socket

2017-12-05 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

There's no timeout. The man page claims SSL_ERROR_WANT_WRITE can't happen on a 
blocking socket, but who knows...

Re: EINTR, this is all happening in a child thread. On Linux, this would mean 
that it almost certainly isn't receiving any signals. I'm not sure about MacOS, 
though. (POSIX allows signals to be delivered to any thread, but most Unixes 
are much more conservative in practice.)

--

___
Python tracker 

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



[issue32205] test.pythoninfo does not print the cross-built sysconfig data

2017-12-05 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue32222] pygettext doesn't extract docstrings for functions with type annotated params

2017-12-05 Thread Toby Harradine

Toby Harradine  added the comment:

Correction for above: the type annotation syntax is actually from PEP 3107, not 
PEP 484.

I should also point out that this behaviour is occurring for annotated return 
types of functions and methods as well.

This is occurring on both Windows and Linux.

--
Added file: https://bugs.python.org/file47318/test_returntypehinted_funcs.py

___
Python tracker 

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



[issue22589] mimetypes uses image/x-ms-bmp as the type for bmp files

2017-12-05 Thread Jonathan Watt

Jonathan Watt  added the comment:

Using image/x-ms-bmp because that's all that IE7 supports makes no sense. 
Chrome doesn't support image/x-ms-bmp (it only supports the official IANA type 
image/bmp), so if the concern is over browser support then it's clear that 
Chrome (the browser with the most market share) should trump IE7 (a browser 
that stopped getting support/security updates at the beginning of 2016, and has 
virtually no browser share).

--
nosy: +jwatt

___
Python tracker 

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



[issue32222] pygettext doesn't extract docstrings for functions with type annotated params

2017-12-05 Thread Toby Harradine

Change by Toby Harradine :


Added file: https://bugs.python.org/file47317/pygettext_output.pot

___
Python tracker 

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



[issue32222] pygettext doesn't extract docstrings for functions with type annotated params

2017-12-05 Thread Toby Harradine

New submission from Toby Harradine :

### Expected Behaviour
When running pygettext with the -D CLI flag, all module, class, method and 
function docstrings should be extracted and outputted to the .pot file.

### Actual Behaviour
In the case of functions whose parameters have PEP 484 type annotations, their 
docstrings are not being extracted. I have attached two files, one .py file and 
its corresponding .pot file, as examples of this behaviour.

--
components: Demos and Tools
files: test_typehinted_funcs.py
messages: 307652
nosy: Toby Harradine
priority: normal
severity: normal
status: open
title: pygettext doesn't extract docstrings for functions with type annotated 
params
type: behavior
versions: Python 3.5, Python 3.6
Added file: https://bugs.python.org/file47316/test_typehinted_funcs.py

___
Python tracker 

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



[issue32221] Converting ipv6 address to string representation using getnameinfo() is wrong.

2017-12-05 Thread Марк Коренберг

Change by Марк Коренберг :


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

___
Python tracker 

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



[issue32221] Converting ipv6 address to string representation using getnameinfo() is wrong.

2017-12-05 Thread Марк Коренберг

New submission from Марк Коренберг :

https://github.com/python/cpython/pull/4724


`recvfrom` from multicast socket is painfull slow. In fact, it returns sender 
address in form:

`('fe80::941f:f6ff:fe04:c560%qwe', 42133, 0, 78)`
which is superfluous, since interface-name part (`%qwe`) is not actually used. 
Actually, scopeid (`78`) signify interface/scope/zone_id. This tuple can be 
used for `.sendto()` either with this interface-name-part or without.

The problem is in the performance. For each `recvrfom()`, `getnameinfo()` 
internally converts interface index to interface name using three syscalls, 
i.e. `socket(), getsockopt()?, close()` , which slows down receiving (I have 
not measured result, but see additional syscalls in `strace`).

In order to convert from tuple to string-based full address one may use 
`getnameinfo()`:
As you can see, initial interface is ignored (but without my patch it is also 
validated uselessly):
```
In[1]: socket.getnameinfo(('fe80::941f:f6ff:fe04:c560%qwe', 42133, 0, 78), 
socket.NI_NUMERICHOST)
Out[1]: ('fe80::941f:f6ff:fe04:c560%qwe', '42133')
In[2]: socket.getnameinfo(('fe80::941f:f6ff:fe04:c560', 42133, 0, 78), 
socket.NI_NUMERICHOST)
Out[2]: ('fe80::941f:f6ff:fe04:c560%qwe', '42133')
```

--
components: Library (Lib)
messages: 307651
nosy: socketpair
priority: normal
severity: normal
status: open
title: Converting ipv6 address to string representation using getnameinfo() is 
wrong.
type: performance
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



[issue32220] multiprocessing: passing file descriptor using reduction breaks duplex pipes on darwin

2017-12-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

See https://bugs.python.org/issue6560 for the original issue delineating the 
problems we had with fd passing on macOS.

I don't know whether Apple finally fixed the underlying issue.  If that was the 
case, I assume we might be seeing "unexpected successes" in test_socket?  Ned, 
Ronald, is that right?

Nate, if you want to investigate the underlying issue and see whether the 
workaround is still needed and/or another workaround is possible, your help is 
welcome.

--
components: +macOS
nosy: +ned.deily, pitrou, ronaldoussoren

___
Python tracker 

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



[issue32220] multiprocessing: passing file descriptor using reduction breaks duplex pipes on darwin

2017-12-05 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
nosy: +davin

___
Python tracker 

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



[issue32220] multiprocessing: passing file descriptor using reduction breaks duplex pipes on darwin

2017-12-05 Thread Nate

New submission from Nate :

In multiprocessing/reduction.py, there is a hack workaround in the sendfds() 
and recvfds() methods for darwin, as determined by the "ACKNOWLEDGE" constant. 
There is a reference to issue #14669 in the code related to why this was added 
in the first place. This bug exists in both 3.6.3 and the latest 3.7.0a2.

When a file descriptor is received, this workaround/hack sends an 
acknowledgement message to the sender. The problem is that this completely 
breaks Duplex pipes depending on the timing of the acknowledgement messages, as 
your "sock.send(b'A')" and "sock.recv(1) != b'A'" calls are being interwoven 
with my own messages.

Specifically, I have a parent process with child processes. I send socket file 
descriptors from the parent to the children, and am also duplexing messages 
from the child processes to the parent. If I am in the process of 
sending/receiving a message around the same time as your workaround is 
performing this acknowledge step, then your workaround corrupts the pipe. 

In a multi-process program, each end of a pipe must only be read or written to 
by a single process, but this workaround breaks this requirement. A different 
workaround must be found for the original bug that prompted this "acknowledge" 
step to be added, because library code must not be interfering with the duplex 
pipe.

--
components: Library (Lib)
messages: 307649
nosy: frickenate
priority: normal
severity: normal
status: open
title: multiprocessing: passing file descriptor using reduction breaks duplex 
pipes on darwin
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue32219] SSLWantWriteError being raised by blocking SSL socket

2017-12-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

You might want to add debugging code in _ssl__SSLSocket_shutdown_impl() 
(Modules/_ssl.c) and see what happens exactly.

Does your socket have a timeout?  If not, you may want to ask the OpenSSL 
mailing-list whether it's possible for SSL_shutdown to return 
SSL_ERROR_WANT_WRITE on a blocking socket...

PS: it seems the _ssl module doesn't retry I/O routines on EINTR. See also 
https://stackoverflow.com/questions/24188013/openssl-and-signals

--
components: +Library (Lib)
nosy: +pitrou
type:  -> behavior
versions: +Python 3.7

___
Python tracker 

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



[issue27645] Supporting native backup facility of SQLite

2017-12-05 Thread Lele Gaifax

Lele Gaifax  added the comment:

Just to keep the door open, I'm willing to to whatever is needed to see this 
accepted and merged.

--

___
Python tracker 

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