[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2017-02-15 Thread Zero Piraeus

Changes by Zero Piraeus :


--
nosy: +zero.piraeus

___
Python tracker 

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



[issue29562] test_getgroups of test_posix fails (on OS X 10.10)

2017-02-15 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

The Mac OS 10.10 man page for initgroups(3) says:

"Processes should not use the group ID numbers from getgroups(2) to determine a 
user's group membership.  The list obtained from getgroups() may only be a 
partial list of a user's group membership.  Membership checks should use the 
mbr_gid_to_uuid(3), mbr_uid_to_uuid(3), and mbr_check_membership(3) functions."
(http://www.manpagez.com/man/3/initgroups/ -- not official Apple page, but it 
matches what I see in my OS.)

When the man page says, "The list obtained from getgroups() may only be a 
partial list of a user's group membership.", and the list from `id -G` is 
presumably a complete list, should we understand that Apple is saying their 
getgroups(2) implementation isn't POSIX-compliant? If so, maybe we should skip 
test_getgroups on Mac OS X systems?

Or, should we consider rewriting os_getgroups_impl() to use a Mac-specific 
implementation on Mac OS X?

--

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Jerry Dimitrov

Jerry Dimitrov added the comment:

Thanks for the documentation reference. Can we at least add this link reference 
[1] as a note or something like that into those documentation sections: [2] 
https://docs.python.org/2/library/stdtypes.html#string-formatting and  [3] 
https://docs.python.org/3/library/string.html#string-formatting

I couldn't fine the printf specific documentation at first, so this is why I 
created the report.

Regards,
Jerry

--

___
Python tracker 

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



[issue29562] test_getgroups of test_posix fails (on OS X 10.10)

2017-02-15 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

I guess I didn't state the things I find odd about what the new test_getgroups 
results. 

1. `os.getgroups()` used to return group (395, 'com.apple.access_ftp'), but no 
longer does.  I don't see a reason why.

2. `os.getgroups()` is returning 2 fewer group id's than `id -G`, even as the 
total number of groups is reduced.  This is not the behaviour of an API limited 
by {NGROUPS_MAX}.

--

___
Python tracker 

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



[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2017-02-15 Thread Ethan Furman

Ethan Furman added the comment:

To get the above code snippet to fail properly:
- remove the @classattr line
- prepend from enum import Enum, Flag, IntFlag, auto

--

___
Python tracker 

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



[issue29347] Python could crash while creating weakref for a given object

2017-02-15 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +90

___
Python tracker 

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



[issue29470] ssl: SNI callbacks should not modify context objects

2017-02-15 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

yes, after i've modified my tool and ensured i know the correct way of doing 
it. one of the problems i'm dealing with is not carting around a global 
variable holding prebuilt contexts. i find it unappealing.

--

___
Python tracker 

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



[issue29347] Python could crash while creating weakref for a given object

2017-02-15 Thread Xiang Zhang

Xiang Zhang added the comment:

Ping.

--

___
Python tracker 

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



[issue28806] Improve the netrc library

2017-02-15 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +89

___
Python tracker 

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



[issue29562] test_getgroups of test_posix fails (on OS X 10.10)

2017-02-15 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

Some diagnosis.

Group `com.apple.sharepoint.group.1` appears to be related to a certain kind of 
file sharing, but I don't have hard evidence. 

Its only member was a test user I created as part of screen sharing with Apple 
Support. 
```
% dscacheutil -q group -a name com.apple.sharepoint.group.1
name: com.apple.sharepoint.group.1
password: *
gid: 701
users: testuser
```

I removed File Sharing for this user's home directory.

1. Open System Preferences... Sharing. 
2. Click on "File Sharing", which is checked. In the right pane, a list of 
shared folders appears.
3. Click on the entry "Testuser Public Folder" in the Shared Folders list.
4. Click on the "-" button below the Shared Folders list. The "Testuser Public 
Folder" entry disappears.

Having done that, the group `com.apple.sharepoint.group.1` no longer appeared.

```
% dscacheutil -q group -a name com.apple.sharepoint.group.1
%
```

Interestingly, `test_getgroups` still failed, and still had a discrepancy of 
two groups from the output of `id -G`.

```
% ./python.exe -m unittest -v test.test_posix.PosixTester.test_getgroups
test_getgroups (test.test_posix.PosixTester) ... FAIL

==
FAIL: test_getgroups (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File "/Users/jdlh/workspace/cpython/Lib/test/test_posix.py", line 841, in 
test_getgroups
self.assertEqual(len(symdiff), 0, msg)
AssertionError: 2 != 0 : id -G and posix.groups() should have zero difference.
Groups in id -G but not posix.groups(): [(395, 'com.apple.access_ftp'), (398, 
'com.apple.access_screensharing')]
Groups in posix.groups() but not id -G: []
(Effective GID (20) was disregarded.)

--
Ran 1 test in 0.013s

FAILED (failures=1)
```

Earlier, group `com.apple.access_ftp` was not part of the difference. Now it 
is. The output of `id -G` didn't change. The implementation of 
`posix.getgroups()` didn't change. It calls getgroups (2), I believe: 
https://github.com/python/cpython/blob/master/Modules/posixmodule.c#L6078-L6103

That makes me think that the behaviour of getgroups (2) in Mac OS is behaving 
differently than we expect. 

`man 2 getgroups` gives documentation. (I can't find this page at an apple URL, 
but http://www.manpagez.com/man/2/getgroups/ seems to have the same content.) 
It says, 

>>> "To provide compatibility with applications that use getgroups() in 
>>> environments where users may be in more than {NGROUPS_MAX} groups, a 
>>> variant of getgroups(), obtained when compiling with either the macros 
>>> _DARWIN_UNLIMITED_GETGROUPS or _DARWIN_C_SOURCE defined, can be used that 
>>> is not limited to {NGROUPS_MAX} groups.  However, this variant only returns 
>>> the user's default group access list and not the group list modified by a 
>>> call to setgroups(2) (either in the current process or an ancestor 
>>> process).  Use of setgroups(2) is highly discouraged, and there is no 
>>> foolproof way to determine if it has been previously called."

I don't know how to determine if my copy of Mac OS X 10.10 was complied with 
either of these two macros. 

On my system, I chased NGROUPS_MAX down to /usr/include/sys/syslimits.h:84, 
where it is set to 16. That is more than the number of groups `id -G` is 
reporting, so I don't see how that is relevant.

```% id -G
20 507 12 61 80 98 399 33 100 204 395 398
```

This is 12 groups, whereas before it was 13 groups (see my message from 
2017-02-15 02:03). This is unsurprising.  However, the number of groups 
returned by posix.getgroups() has also shrunk by 1:

```% ./python.exe -c 'import grp,os; g={i: (n, p, i, mem) for (n, p, i, mem) in 
grp.getgrall()}; print(sorted([(i, g[i][0]) for i in os.getgroups()]) )'
[(12, 'everyone'), (20, 'staff'), (33, '_appstore'), (61, 'localaccounts'), 
(80, 'admin'), (98, '_lpadmin'), (100, '_lpoperator'), (204, '_developer'), 
(399, 'com.apple.access_ssh'), (507, 'xampp')]
```

Notice that group (395, 'com.apple.access_ftp') is no longer being returned by 
os.getgroups().  This is as a consequence of a different group being deleted.

The test_getgroups comment asserts: "# 'id -G' and 'os.getgroups()' should 
return the same groups, ignoring order, duplicates, and the effective gid." 
https://github.com/python/cpython/blob/master/Lib/test/test_posix.py#L819-L820

I'm getting skeptical about that claim. Does Mac OS X actually guarantee that 
'id -G' and 'getgroups(2)' return the same groups?

--

___
Python tracker 

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



[issue22807] uuid.uuid1() should use uuid_generate_time_safe() if available

2017-02-15 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
assignee:  -> barry

___
Python tracker 

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



[issue29577] Enum: mixin classes don't mix well with already mixed Enums

2017-02-15 Thread Ethan Furman

New submission from Ethan Furman:

Consider:

class AllEnum(Enum):
@classattr
def ALL(cls):
members = list(cls)
all_value = None
if members:
all_value = members[0]
for member in members[1:]:
all_value |= member
cls.ALL = all_value
return all_value

class Color(AllEnum, Flag):
RED = auto()
BLUE = auto()
GREEN = auto()

class IntColor(AllEnum, IntFlag):
RED = auto()
BLUE = auto()
GREEN = auto()



The Color class works fine, but the IntColor fails.  This is due to the way the 
base data type and __new__ method is discovered.  If we switch the order of the 
bases

  class IntColor(IntFlag, AllEnum)

it works, but having to put the mixin class last is both bizarre and unworkable 
when the mixin should be overriding behavior.

--
assignee: ethan.furman
components: Library (Lib)
messages: 287910
nosy: barry, eli.bendersky, ethan.furman
priority: normal
severity: normal
status: open
title: Enum: mixin classes don't mix well with already mixed Enums
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



[issue29576] Improve some deprecations in the importlib

2017-02-15 Thread Brett Cannon

Changes by Brett Cannon :


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



[issue29576] Improve some deprecations in the importlib

2017-02-15 Thread Brett Cannon

Brett Cannon added the comment:


New changeset 1d4601c2c6952d03fc4dda2b041be9aa8713c0bc by Brett Cannon in 
branch 'master':
bpo-29576: add explicit deprecation for importlib.abc.find_loader() and 
find_module() (GH-32)
https://github.com/python/cpython/commit/1d4601c2c6952d03fc4dda2b041be9aa8713c0bc


--
nosy: +brett.cannon

___
Python tracker 

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



[issue29576] Improve some deprecations in the importlib

2017-02-15 Thread Matthias Bussonnier

New submission from Matthias Bussonnier:

A couple of function in importlib are marked as deprecated in the documentation 
but do not raise deprecation warnings.

As the same time it would be great to improve some deprecation warnings and 
docstring to include the version since when this is deprecated. 

This should be take care of by https://github.com/python/cpython/pull/32

--
assignee: docs@python
components: Documentation
messages: 287908
nosy: docs@python, mbussonn
priority: normal
pull_requests: 88
severity: normal
status: open
title: Improve some deprecations in the importlib
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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-02-15 Thread INADA Naoki

INADA Naoki added the comment:


New changeset 72dccde884d89586b0cafd990675b7e21720a81f by GitHub in branch 
'master':
bpo-29548: Fix some inefficient call API usage (GH-97)
https://github.com/python/cpython/commit/72dccde884d89586b0cafd990675b7e21720a81f


--

___
Python tracker 

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



[issue29470] ssl: SNI callbacks should not modify context objects

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

David Ford: would you mind to directly propose a doc patch?

--

___
Python tracker 

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



[issue29533] urllib2 works slowly with proxy on windows

2017-02-15 Thread Julia Dolgova

Julia Dolgova added the comment:

Surely noone is concerned that programms written on python could work better 
when addressing to "python.org"?

--

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset b300c660d34d2027d443098ea605a8e0eb51d383 by GitHub in branch 
'3.6':
Backport36 doc fixes: PR#68 and PR#124 (#125)
https://github.com/python/cpython/commit/b300c660d34d2027d443098ea605a8e0eb51d383


--

___
Python tracker 

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



[issue29563] Update Devguide about building documentation.

2017-02-15 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for moving the issue, Jim!

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



[issue29566] binhex() creates files with mixed line endings

2017-02-15 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue29324] test_aead_aes_gcm fails on Kernel 4.9

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

@matejcik: would you mind to create a pull request for your patch?

--

___
Python tracker 

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



[issue29470] ssl: SNI callbacks should not modify context objects

2017-02-15 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

@Christian, that was years ago and there were few examples available of people 
that had tried to make an SNI capable server. in several cases, people were 
monkey patching to make a callback. .set_servername_callback() didn't formally 
show up in ssl mod until 3.4.

i disagree that the documentation is very clear about this. there's one direct 
reference to usage which is worded as "A typical use of this callback is 
to...". that doesn't imply 'very clear' :}

i cannot recall anything anywhere that says one must not modify the context 
after it is used. 18.2.3 implies that a context is a long lived object, longer 
lived than a socket. it's clear that several people including myself, have 
mistakenly tried modifying the context after it was built. until now, it 
worked, probably purely by coincidence.

as a matter of fact, i used to change more than just the key loaded. i changed 
the ciphers, options, and verify_flags when i knew the incoming IP was 
incapable of supporting modern ciphers and options. i also modified the verify 
paths to support a messed up corporate environment.

i suggest the 18.2.3 documentation be modified to be clear about:
a) if, when, and how a context can be modified after creation
b) an SNI example that changes contexts and explicitly indicates (a)

i don't see any value to not being clear about it, and it's disingenuous to 
leave nooses hiding in shadows for devs to hang themselves with :-]

--

___
Python tracker 

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



[issue29556] Remove unused #include

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 72e81d00eee685cfe33aaddf2aa9feef2d07591f by Victor Stinner in 
branch 'master':
bpo-29556: Remove unused #include  (#98)
https://github.com/python/cpython/commit/72e81d00eee685cfe33aaddf2aa9feef2d07591f


--

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 02e3357e089f37c23d0f3d1ebee9aa3d7a1492a9 by Victor Stinner in 
branch '3.6':
bpo-29521 update Misc/ACKS (#110)
https://github.com/python/cpython/commit/02e3357e089f37c23d0f3d1ebee9aa3d7a1492a9


--

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 85064db281545d587992df61154e76439138319f by Victor Stinner in 
branch 'master':
bpo-29521 update Misc/ACKS (#106)
https://github.com/python/cpython/commit/85064db281545d587992df61154e76439138319f


--

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset de553b8210882823d3df3f1ef6882eba3f8accf3 by Victor Stinner in 
branch '3.5':
bpo-29521 update Misc/ACKS (#111)
https://github.com/python/cpython/commit/de553b8210882823d3df3f1ef6882eba3f8accf3


--

___
Python tracker 

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



[issue29561] Interactive mode gives sys.ps2 not sys.ps1 after comment-only line

2017-02-15 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

Thank you for the analysis, Eryk Sun.

You wrote, "the interpreter is correctly conveying that it's still tokenizing 
the input; it hasn't compiled or executed any code." I think one important 
question for this issue is, what meaning should the choice of prompt convey?  
That breaks down into, 1. what meaning does the user believe it conveys, and 2. 
what meaning does the present behaviour of the code imply?

"it's still tokenizing the input" translates to a meaning, sys.ps1 indicates 
the interpreter just finished executing and has no input, while sys.ps2 
indicates the interpreter is tokenizing input and awaiting a chance to execute.

I think my intuition is, and the bash shell's behaviour says, sys.ps1 indicates 
the interpreter is ready to start a new statement, and sys.ps2 indicates the 
interpreter is in the midst of a compound statement.

--

___
Python tracker 

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



[issue29531] Update Doc/README.txt to README.rst

2017-02-15 Thread Roger Sachan

Changes by Roger Sachan :


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



[issue29575] doc 17.2.1: basic Pool example is too basic

2017-02-15 Thread Joachim

New submission from Joachim:

The »basic example of data parallelism using Pool« is too basic. It 
demonstrates the syntax, but otherwise makes no sense, and therefore is 
potentially confusing. It is blatant nonsense to run 5 processes when there are 
only 3 data to be treated. Let me suggest the following:


from multiprocessing import Pool
import time

def f(x):
time.sleep(1)
return x*x

if __name__ == '__main__':
start_time = time.time()
with Pool(4) as p:
print(p.map(f, range(20)))
print("elapsed wall time: ", time.time()-start_time)

The sleep command makes f representative for a function that takes significant 
time to execute. Printing the elapsed time shows the user that the 20 calls of 
f have indeed taken place in parallel.

--
assignee: docs@python
components: Documentation
messages: 287895
nosy: docs@python, j5w6
priority: normal
severity: normal
status: open
title: doc 17.2.1: basic Pool example is too basic
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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good point. The test used locale.getlocale() and it returned returned ('en_IN', 
'ISO8859-1').

Following patch makes the test using locale.getpreferredencoding(False), the 
same encoding as was reported at the header of test report.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file46641/test_re_locale_flag.patch

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

> Following patch ...

Seriously? Not a GitHub pull request? ;-) (old habit?)

--

___
Python tracker 

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



[issue29574] python-3.6.0.tgz permissions borked

2017-02-15 Thread Dave Anderson

Dave Anderson added the comment:

Sorry, should have shown sudo ls -l output for 3.6:

[vagrant@developer tmp]$ sudo ls -l Python-3.6.0
total 1016
-rw-r--r--  1 caturra games  10910 Dec 22 18:21 aclocal.m4
-rwxr-xr-x  1 caturra games  42856 Dec 22 18:21 config.guess
-rwxr-xr-x  1 caturra games  35740 Dec 22 18:21 config.sub
-rwxr-xr-x  1 caturra games 481627 Dec 22 18:21 configure
-rw-r--r--  1 caturra games 158661 Dec 22 18:21 configure.ac
drwxr--r-- 18 caturra games   4096 Dec 22 18:23 Doc
drwxr--r--  2 caturra games   4096 Dec 22 18:21 Grammar
drwxr--r--  2 caturra games   4096 Dec 22 18:21 Include
-rwxr-xr-x  1 caturra games   7122 Dec 22 18:21 install-sh
drwxr--r-- 33 caturra games   4096 Dec 22 18:21 Lib
-rw-r--r--  1 caturra games  12767 Dec 22 18:21 LICENSE
drwxr--r--  8 caturra games   4096 Dec 22 18:21 Mac
-rw-r--r--  1 caturra games  58829 Dec 22 18:21 Makefile.pre.in
drwxr--r--  2 caturra games   4096 Dec 22 18:21 Misc
drwxr--r-- 13 caturra games   4096 Dec 22 18:21 Modules
drwxr--r--  4 caturra games   4096 Dec 22 18:21 Objects
drwxr--r--  2 caturra games   4096 Dec 22 18:21 Parser
drwxr--r--  5 caturra games   4096 Dec 22 18:21 PC
drwxr--r--  2 caturra games   4096 Dec 22 18:21 PCbuild
drwxr--r--  2 caturra games   4096 Dec 22 18:21 Programs
-rw-r--r--  1 caturra games  41250 Dec 22 18:21 pyconfig.h.in
drwxr--r--  3 caturra games   4096 Dec 22 18:21 Python
-rw-r--r--  1 caturra games   8434 Dec 22 18:21 README
-rw-r--r--  1 caturra games 101041 Dec 22 18:21 setup.py
drwxr--r-- 24 caturra games   4096 Dec 22 18:21 Tools
[vagrant@developer tmp]$

--

___
Python tracker 

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



[issue29574] python-3.6.0.tgz permissions borked

2017-02-15 Thread Dave Anderson

New submission from Dave Anderson:

Downloaded https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz

Extracted on CentOS6 with sudo tar -xf Python-3.6.0.tgz

Result: 

[vagrant@developer tmp]$ ls -l Python-3.6.0
ls: cannot access Python-3.6.0/Tools: Permission denied
ls: cannot access Python-3.6.0/config.guess: Permission denied
ls: cannot access Python-3.6.0/pyconfig.h.in: Permission denied
ls: cannot access Python-3.6.0/config.sub: Permission denied
ls: cannot access Python-3.6.0/configure.ac: Permission denied
ls: cannot access Python-3.6.0/Python: Permission denied
ls: cannot access Python-3.6.0/Objects: Permission denied
ls: cannot access Python-3.6.0/PCbuild: Permission denied
ls: cannot access Python-3.6.0/Include: Permission denied
ls: cannot access Python-3.6.0/aclocal.m4: Permission denied
ls: cannot access Python-3.6.0/configure: Permission denied
ls: cannot access Python-3.6.0/Misc: Permission denied
ls: cannot access Python-3.6.0/Makefile.pre.in: Permission denied
ls: cannot access Python-3.6.0/setup.py: Permission denied
ls: cannot access Python-3.6.0/Lib: Permission denied
ls: cannot access Python-3.6.0/PC: Permission denied
ls: cannot access Python-3.6.0/Doc: Permission denied
ls: cannot access Python-3.6.0/README: Permission denied
ls: cannot access Python-3.6.0/Programs: Permission denied
ls: cannot access Python-3.6.0/install-sh: Permission denied
ls: cannot access Python-3.6.0/LICENSE: Permission denied
ls: cannot access Python-3.6.0/Modules: Permission denied
ls: cannot access Python-3.6.0/Grammar: Permission denied
ls: cannot access Python-3.6.0/Parser: Permission denied
ls: cannot access Python-3.6.0/Mac: Permission denied
total 0
-? ? ? ? ?? aclocal.m4
-? ? ? ? ?? config.guess
-? ? ? ? ?? config.sub
-? ? ? ? ?? configure
-? ? ? ? ?? configure.ac
d? ? ? ? ?? Doc
d? ? ? ? ?? Grammar
d? ? ? ? ?? Include
-? ? ? ? ?? install-sh
d? ? ? ? ?? Lib
-? ? ? ? ?? LICENSE
d? ? ? ? ?? Mac
-? ? ? ? ?? Makefile.pre.in
d? ? ? ? ?? Misc
d? ? ? ? ?? Modules
d? ? ? ? ?? Objects
d? ? ? ? ?? Parser
d? ? ? ? ?? PC
d? ? ? ? ?? PCbuild
d? ? ? ? ?? Programs
-? ? ? ? ?? pyconfig.h.in
d? ? ? ? ?? Python
-? ? ? ? ?? README
-? ? ? ? ?? setup.py
d? ? ? ? ?? Tools
[vagrant@developer tmp]$

Same operation with Python 3.5.2 tgz file downloaded from same location:

[vagrant@developer tmp]$ ls -l Python-3.5.2
total 1008
-rw-r--r--  1 1000 1000   8464 Jun 25  2016 aclocal.m4
-rwxr-xr-x  1 1000 1000  42856 Jun 25  2016 config.guess
-rwxr-xr-x  1 1000 1000  35740 Jun 25  2016 config.sub
-rwxr-xr-x  1 1000 1000 474932 Jun 25  2016 configure
-rw-r--r--  1 1000 1000 155069 Jun 25  2016 configure.ac
drwxrwxr-x 18 1000 1000   4096 Jun 25  2016 Doc
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 Grammar
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 Include
-rwxr-xr-x  1 1000 1000   7122 Jun 25  2016 install-sh
drwxrwxr-x 46 1000 1000  12288 Jun 25  2016 Lib
-rw-r--r--  1 1000 1000  12767 Jun 25  2016 LICENSE
drwxrwxr-x  8 1000 1000   4096 Jun 25  2016 Mac
-rw-r--r--  1 1000 1000  58449 Jun 25  2016 Makefile.pre.in
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 Misc
drwxrwxr-x 11 1000 1000   4096 Jun 25  2016 Modules
drwxrwxr-x  4 1000 1000   4096 Jun 25  2016 Objects
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 Parser
drwxrwxr-x  4 1000 1000   4096 Jun 25  2016 PC
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 PCbuild
drwxrwxr-x  2 1000 1000   4096 Jun 25  2016 Programs
-rw-r--r--  1 1000 1000  41897 Jun 25  2016 pyconfig.h.in
drwxrwxr-x  3 1000 1000   4096 Jun 25  2016 Python
-rw-r--r--  1 1000 1000   8060 Jun 25  2016 README
-rw-r--r--  1 1000 1000  99778 Jun 25  2016 setup.py
drwxrwxr-x 22 1000 1000   4096 Jun 25  2016 Tools
[vagrant@developer tmp]$

--
components: Build
messages: 287891
nosy: Dave_Anderson
priority: normal
severity: normal
status: open
title: python-3.6.0.tgz permissions borked
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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.

--
keywords: +patch
stage:  -> patch review
versions:  -Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file46640/format-percent.patch

___
Python tracker 

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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2017-02-15 Thread Jakub Stasiak

Changes by Jakub Stasiak :


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



[issue29563] Update Devguide about building documentation.

2017-02-15 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

Per request from Brett Cannon, I've moved this issue to 
https://github.com/python/devguide/issues/116 . Please continue the discussion 
there.

--

___
Python tracker 

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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2017-02-15 Thread Jakub Stasiak

Changes by Jakub Stasiak :


--
pull_requests: +87

___
Python tracker 

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



[issue29517] "Can't pickle local object" when uses functools.partial with method and args...

2017-02-15 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue29573] NamedTemporaryFile with delete=True should not fail if file already deleted

2017-02-15 Thread Richard Xia

New submission from Richard Xia:

Here is a very short program to demonstrate what I'm seeing:

>>> import tempfile
>>> import os
>>> with tempfile.NamedTemporaryFile(delete=True) as fp:
... print(fp.name)
... os.system('rm {}'.format(fp.name))
/tmp/tmpomw0udc6
0
Traceback (most recent call last):
  File "", line 3, in 
  File "/usr/local/lib/python3.6/tempfile.py", line 502, in __exit__
self.close()
  File "/usr/local/lib/python3.6/tempfile.py", line 509, in close
self._closer.close()
  File "/usr/local/lib/python3.6/tempfile.py", line 446, in close
unlink(self.name)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpomw0udc6'


In my specific use case, I am shelling out to another program (binutils' 
objcopy) and passing the path of the NamedTemporaryFile as the output file. 
objcopy apparently deletes the output file if it encounters an error, which 
causes NamedTemporaryFile's exit method to fail when it tries to delete the 
file.

While I can work around this by using delete=False and manually doing the 
cleanup on my own, it's less elegant than being able to rely on the normal 
context manager exit.

--
components: IO
messages: 287888
nosy: richardxia
priority: normal
severity: normal
status: open
title: NamedTemporaryFile with delete=True should not fail if file already 
deleted
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue29517] "Can't pickle local object" when uses functools.partial with method and args...

2017-02-15 Thread DAVID ALEJANDRO Pineda

DAVID ALEJANDRO Pineda added the comment:

Now
I try again with different ways to run a method with args, without args works 
fine to insert in the executor.
I find there are big differences with file functools betwen versions 3.5.1 to 
3.6.0.
 Here a more simple example for test the functools:
https://github.com/dpineiden/async_multiprocessing

--

___
Python tracker 

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



[issue28334] netrc does not work if $HOME is not set

2017-02-15 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +86

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Merged and backported to 3.5 and 3.6.

Thanks all :)

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




[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset bb53a27a5d56a4f33c3fc8eebb486b34808c92b7 by GitHub in branch 
'3.5':
[cherry-pick for 3.5] bpo-29481: add versionadded 3.5.4 to typing.Deque docs 
(#109)
https://github.com/python/cpython/commit/bb53a27a5d56a4f33c3fc8eebb486b34808c92b7


--

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 7224a049b88ed37c510861528147e0db54911bb7 by GitHub in branch 
'3.6':
bpo-29481: add versionadded 3.6.1 to typing.Deque docs (#108)
https://github.com/python/cpython/commit/7224a049b88ed37c510861528147e0db54911bb7


--

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 36da1c3589e1bc4246cccf6bd0094a110416a43a by GitHub in branch 
'master':
bpo-29481: add versionadded 3.6.1 to typing.Deque docs (#107)
https://github.com/python/cpython/commit/36da1c3589e1bc4246cccf6bd0094a110416a43a


--

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Matthew Barnett

Matthew Barnett added the comment:

The report says "==  encodings: locale=UTF-8, FS=utf-8".

It says that "test_locale_caching" was skipped, but also that 
"test_locale_flag" failed.

--

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-15 Thread Eryk Sun

Eryk Sun added the comment:

ctypes defines arrays as a pointer FFI type because they degenerate as pointers 
in C calls. But it's generally wrong to set a pointer FFI type for an array in 
the `elements` of a struct's FFI type. An integer array in a struct that's 16 
bytes or less should be packed in one or two general-purpose registers (rdi, 
rsi, rdx, rcx, r8, r9). 

For the example 16-byte struct, classify_argument() in ffi64.c expects to 
classify two 8-byte words. But the struct's FFI type only has one element, 
which we've incorrectly defined as a pointer element. Thus the second word is 
left at the default classification X86_64_NO_CLASS. Back in ffi_call() it 
expects two classified words, so it aborts when it sees X86_64_NO_CLASS.

I think we can special-case small arrays in PyCStructUnionType_update_stgdict 
when assigning the `elements` of the FFI type of a struct or union. If we have 
an array that's 32 bytes or less, unpack it as individual FFI elements, e.g. a 
c_ushort * 8 array would be stored as 8 ffi_type_uint16 elements in the 
struct's FFI type.

--
nosy: +eryksun

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Locale encoding is ISO8859-1. This test is skipped on non 8-bit locale.

This is a problem with tests, not with the re module. I don't have a solution.

--
components: +Tests
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Matthew Barnett

Matthew Barnett added the comment:

I'm just wondering whether the problem is just due to the locale's encoding 
being UTF-8. The locale support in re really only works with encodings that use 
1 byte/character.

--

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-15 Thread Eryk Sun

Eryk Sun added the comment:

Our support of passing structs and unions by value is really bad. Passing this 
particular struct by value is also broken on 64-bit Unix, but instead because 
it's small. It crashes Python due to an abort(). See issue 22273.

--
nosy: +eryksun
priority: normal -> high
stage:  -> needs patch
versions: +Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-15 Thread Eryk Sun

Changes by Eryk Sun :


--
stage:  -> needs patch

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-15 Thread Eryk Sun

Changes by Eryk Sun :


--
priority: normal -> high
versions: +Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue28837] 2to3 does not wrap zip correctly

2017-02-15 Thread Stuart Berg

Changes by Stuart Berg :


--
pull_requests: +85

___
Python tracker 

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



[issue29572] Upgrade installers to OpenSSL 1.0.2k

2017-02-15 Thread Zachary Ware

New submission from Zachary Ware:

It's that time once again (as of a few weeks ago).  This one doesn't seem to be 
a high severity update, though.  Also, it seems that 1.1.0e is due tomorrow; 
I'm not sure if that means 1.0.2l will also come out tomorrow, so we'll want to 
hold off until at least then anyway.  This is mostly just a reminder for now.

--
assignee: christian.heimes
components: Installation, SSL, Windows, macOS
messages: 287877
nosy: christian.heimes, ned.deily, paul.moore, ronaldoussoren, steve.dower, 
tim.golden, zach.ware
priority: high
severity: normal
status: open
title: Upgrade installers to OpenSSL 1.0.2k
type: security
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
type:  -> behavior

___
Python tracker 

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



[issue29536] test_hashlib failure on Ubuntu 16.04

2017-02-15 Thread Christian Heimes

Christian Heimes added the comment:

Yeah, somehow you ended up with a broken vector file. Your file contains HTTP 
with JavaScript redirect. Did you attempt to download test data from a hotel or 
airport wifi?

You can safely remove Lib/test/data and start over.

--
nosy: +christian.heimes
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



[issue29470] ssl: SNI callbacks should not modify context objects

2017-02-15 Thread Christian Heimes

Christian Heimes added the comment:

It's not a bug in Python's ssl module. If I understand David's approach 
correctly, then he is using the SNI callback the wrong way. By using it the 
wrong way he has discovered a threading bug in OpenSSL. There is some kind of 
race condition going on in which two threads free and replace the RSA private 
key at the same time.

I'm -1 to try to make the SSLContext object magically read-only.

David, which examples did you read? The documentation 
https://docs.python.org/3/library/ssl.html#ssl.SSLContext.set_servername_callback
 is pretty clear:

A typical use of this callback is to change the ssl.SSLSocket‘s 
SSLSocket.context attribute to a new object of type SSLContext representing a 
certificate chain that matches the server name.

Apache mod_ssl does it correctly, the first hit on stack overflow, too. 
https://stackoverflow.com/questions/511/how-to-implement-server-name-indication-sni

--

___
Python tracker 

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



[issue29536] test_hashlib failure on Ubuntu 16.04

2017-02-15 Thread Sachin Kumar

Sachin Kumar added the comment:

@Xiang
I tried that command earlier but that returned around 8 failed test cases. I 
think it is due to a fault with my connection. Although I can replicate this 
error every time. I've tried over 5 times already.


@Martin
I compared the data. My file has been attached. Deleting the files fixed the 
issue. Can all the test files be deleted safely, since some other tests are 
failing too?

--
Added file: http://bugs.python.org/file46639/blake2b.txt

___
Python tracker 

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



[issue29563] Update Devguide about building documentation.

2017-02-15 Thread Brett Cannon

Brett Cannon added the comment:

Would you mind moving this issue over to 
https://github.com/python/devguide/issues where we track devguide issues, Jim?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Xiang Zhang

Xiang Zhang added the comment:

Or even not fix it in develop branch.

--

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Xiang Zhang

Xiang Zhang added the comment:

The documentation[1] explicitly states using % to do string format could be 
error-prone and recommends using str.format(). So +1 on no change in 
maintenance branches.

[1] 
https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue29470] ssl: SNI callbacks should not modify context objects

2017-02-15 Thread STINNER Victor

Changes by STINNER Victor :


--
title: [python] Error in `/usr/bin/python': free(): invalid size: 
0x7f628400d0e0; ssl SNI callbacks should not modify context objects -> ssl: 
SNI callbacks should not modify context objects

___
Python tracker 

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



[issue29564] ResourceWarning: suggest to enable tracemalloc in the message

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

To be clear: warnings should only suggest to enable tracemalloc if 
tracemalloc.is_tracing() is False.

It is possible to tracemalloc is tracing, but failed (for different reasons) to 
track where the memory of the resource was allocated.

--
title: ResourceWarning tracking is attaching incorrect file:position to 
unclosed socket -> ResourceWarning: suggest to enable tracemalloc in the message

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

David Ford (FirefighterBlu3) added the comment:
> @stinner your traceback suggestion was highly useful and much appreciated. i 
> have spent several dozen hours researching ResourceWarnings in the past and 
> tearing my hair out because the emitted warning was very much useless. i 
> couldn't even make educated guesses about the code as socket pairs were used 
> randomly.

So did I. Why do you think that I implemented this feature? :-D

> i strongly approve of mentioning the tracemalloc / traceback in the warning, 
> and i would also very much encourage saying "this filename:position could be 
> completely wrong" or do away with it all together.

I dislike removing filename:line information: in some cases, the
information is valid and helps to understand a warning.

Ok, let's go to add a line suggestion to enable tracemalloc. Is there
someone here interested to propose a pull request? It should only be
done in Python 3.7 and later 3.6, it's a new feature in Python 3.6.

--

___
Python tracker 

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



[issue29557] binhex documentation claims unknown bug

2017-02-15 Thread Georg Brandl

Georg Brandl added the comment:

I don't remember anything specific about this, sorry.

--

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-15 Thread Jaysinh shukla

New submission from Jaysinh shukla:

Description:
A test case is failing while running `./python -m test -v test_re`.

Traceback:
$>./python -m test -v test_re
== CPython 3.7.0a0 (default, Feb 15 2017, 22:28:32) [GCC 5.4.0 20160609]
==   Linux-4.4.0-62-generic-x86_64-with-debian-stretch-sid little-endian
==   hash algorithm: siphash24 64bit
==  cwd: /home/bigj/Jaysinh/cpython_git/cpython/build/test_python_613
==  encodings: locale=UTF-8, FS=utf-8
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
Run tests sequentially
0:00:00 [1/1] test_re
test_re_benchmarks (test.test_re.ExternalTests)
re_tests benchmarks ... ok
test_re_tests (test.test_re.ExternalTests)
re_tests test suite ... ok
test_overlap_table (test.test_re.ImplementationTest) ... ok
test_bytes (test.test_re.PatternReprTests) ... ok
test_inline_flags (test.test_re.PatternReprTests) ... ok
test_locale (test.test_re.PatternReprTests) ... ok
test_long_pattern (test.test_re.PatternReprTests) ... ok
test_multiple_flags (test.test_re.PatternReprTests) ... ok
test_quotes (test.test_re.PatternReprTests) ... ok
test_single_flag (test.test_re.PatternReprTests) ... ok
test_unicode_flag (test.test_re.PatternReprTests) ... ok
test_unknown_flags (test.test_re.PatternReprTests) ... ok
test_without_flags (test.test_re.PatternReprTests) ... ok
test_anyall (test.test_re.ReTests) ... ok
test_ascii_and_unicode_flag (test.test_re.ReTests) ... ok
test_backref_group_name_in_exception (test.test_re.ReTests) ... ok
test_basic_re_sub (test.test_re.ReTests) ... ok
test_big_codesize (test.test_re.ReTests) ... ok
test_bigcharset (test.test_re.ReTests) ... ok
test_bug_113254 (test.test_re.ReTests) ... ok
test_bug_114660 (test.test_re.ReTests) ... ok
test_bug_117612 (test.test_re.ReTests) ... ok
test_bug_1661 (test.test_re.ReTests) ... ok
test_bug_16688 (test.test_re.ReTests) ... ok
test_bug_20998 (test.test_re.ReTests) ... ok
test_bug_2537 (test.test_re.ReTests) ... ok
test_bug_29444 (test.test_re.ReTests) ... ok
test_bug_3629 (test.test_re.ReTests) ... ok
test_bug_418626 (test.test_re.ReTests) ... ok
test_bug_448951 (test.test_re.ReTests) ... ok
test_bug_449000 (test.test_re.ReTests) ... ok
test_bug_449964 (test.test_re.ReTests) ... ok
test_bug_462270 (test.test_re.ReTests) ... ok
test_bug_527371 (test.test_re.ReTests) ... ok
test_bug_581080 (test.test_re.ReTests) ... ok
test_bug_612074 (test.test_re.ReTests) ... ok
test_bug_6509 (test.test_re.ReTests) ... ok
test_bug_6561 (test.test_re.ReTests) ... ok
test_bug_725106 (test.test_re.ReTests) ... ok
test_bug_725149 (test.test_re.ReTests) ... ok
test_bug_764548 (test.test_re.ReTests) ... ok
test_bug_817234 (test.test_re.ReTests) ... ok
test_bug_926075 (test.test_re.ReTests) ... ok
test_bug_931848 (test.test_re.ReTests) ... ok
test_bytes_str_mixing (test.test_re.ReTests) ... ok
test_category (test.test_re.ReTests) ... ok
test_character_set_errors (test.test_re.ReTests) ... ok
test_compile (test.test_re.ReTests) ... ok
test_constants (test.test_re.ReTests) ... ok
test_dealloc (test.test_re.ReTests) ... ok
test_debug_flag (test.test_re.ReTests) ... ok
test_dollar_matches_twice (test.test_re.ReTests)
$ matches the end of string, and just before the terminating ... ok
test_empty_array (test.test_re.ReTests) ... ok
test_enum (test.test_re.ReTests) ... ok
test_error (test.test_re.ReTests) ... ok
test_expand (test.test_re.ReTests) ... ok
test_finditer (test.test_re.ReTests) ... ok
test_flags (test.test_re.ReTests) ... ok
test_getattr (test.test_re.ReTests) ... ok
test_getlower (test.test_re.ReTests) ... ok
test_group (test.test_re.ReTests) ... ok
test_group_name_in_exception (test.test_re.ReTests) ... ok
test_groupdict (test.test_re.ReTests) ... ok
test_ignore_case (test.test_re.ReTests) ... ok
test_ignore_case_range (test.test_re.ReTests) ... ok
test_ignore_case_set (test.test_re.ReTests) ... ok
test_inline_flags (test.test_re.ReTests) ... ok
test_issue17998 (test.test_re.ReTests) ... ok
test_keep_buffer (test.test_re.ReTests) ... ok
test_keyword_parameters (test.test_re.ReTests) ... ok
test_large_search (test.test_re.ReTests) ... ok
test_large_subn (test.test_re.ReTests) ... ok
test_locale_caching (test.test_re.ReTests) ... skipped 'test needs 
en_US.iso88591 locale'
test_locale_flag (test.test_re.ReTests) ... FAIL
test_lookahead (test.test_re.ReTests) ... ok
test_lookbehind (test.test_re.ReTests) ... ok
test_match_getitem (test.test_re.ReTests) ... ok
test_match_repr (test.test_re.ReTests) ... ok
test_misc_errors (test.test_re.ReTests) ... ok
test_multiple_repeat (test.test_re.ReTests) ... ok
test_not_literal (test.test_re.ReTests) ... ok
test_nothing_to_repeat (test.test_re.ReTests) ... ok
test_other_escapes (test.test_re.ReTests) ... ok
test_pattern_compare (test.test_re.ReTests) ... ok
test_pattern_compare_bytes (test.test_re.ReTests) ... ok
test_pickling 

[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0; ssl SNI callbacks should not modify context objects

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

> Do you modify the SSLContext object in your SNI callback? That's the wrong 
> way to do it. You have to create a SSLContext object for each certificate/key 
> pair at startup and then change the socket's context attribute.

Would it be possible to prevent bugs? For example, make SSLContext "read only" 
while the SNI callback is called? Or my question doesn't make sense? :-) I 
don't know well how OpenSSL works.

At least, we should warn users in the ssl documentation to mention such crash?

--

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

> # builtin min and max doesn't support FASTCALL
> (...): 1.16x slower (+16%)

Hum, the slowdown is not negligible, even if functools.reduce() is rarely used.

Do you think that it would be insane to have two code paths instead?

* New FASTCALL path if func suports FASTCALL calling _PyObject_FastCall()
* Current code path using cached args tuple otherwise

For example, you can use args==NULL marker for the FASTCALL path. Maybe we need 
a _PyObject_SupportFastCall() function which would return 1 for Python 
functions and C functions, except of C functions with METH_VARARGS flag set.

My expectation is a speedup for functions supporting FASTCALL, but *no 
slowdown* for functions not supporting FASTCALL.

--

property_descr_get() also caches args tuple. I started my work on FASTCALL 
because this optimization caused bugs (but also because I wanted to make Python 
faster, but that's a different topic ;-)).

In the past, the _pickle module also used cached args tuple, but the cache was 
removed because it was vulnerable to race conditions.

For this issue, I suggest to leave functools.reduce() unchanged, but open a new 
issue to discuss what to do with code still using a cached args tuple.

My long term goal with FASTCALL was to remove completely cached tuple used to 
call functions. I wrote tp_fastcall for that, but tp_fastcall (issue #29259) 
was rejected. The rejected tp_fastcall blocked my long term plan, we have to 
find a different approach.

Maybe we should add support for FASTCALL for a little bit more functions, and 
later simply remove the optimization (hack, cached tuple)?

--

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, it is what I want. Current behavior is just an artefact of the 
implementation. I have doubts that any other implementation of printf-like 
formatting has such behavior.

Bytes formatting starves from the same issue.

>>> b'% %' % {}
b'%'

But there are differences:

>>> '%12%' % ()
'%'
>>> b'%12%' % ()
b'   %'

--

___
Python tracker 

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



[issue28814] Deprecation notice on inspect.getargvalues() is incorrect

2017-02-15 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
nosy: +mbussonn

___
Python tracker 

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



[issue29570] Windows Buildbot 2.7 is broken

2017-02-15 Thread STINNER Victor

New submission from STINNER Victor:

Example of failure:
http://buildbot.python.org/all/builders/AMD64%20Windows8%202.7/builds/67/steps/test/logs/stdio

FAIL: test_incrementaldecoder (test.test_codecencodings_iso2022.Test_ISO2022_KR)
=> failure with newline, maybe caused by the migration to GitHub: see issue 
#29530

ERROR: test_bug_1727780 (test.test_random.WichmannHill_TestBasicOps)
ImportError: No module named random
=> ... no idea, can it be related to the commit 
0f48ecddfb79ef541500ecfcbda0b4178af1cc29 which only changes a comment!?

--
components: Tests, Windows
keywords: buildbot
messages: 287863
nosy: haypo, inada.naoki, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows Buildbot 2.7 is broken
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



[issue28814] Deprecation notice on inspect.getargvalues() is incorrect

2017-02-15 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +83

___
Python tracker 

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



[issue20438] inspect: Deprecate getfullargspec?

2017-02-15 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +84

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread R. David Murray

R. David Murray added the comment:

I don't think we should change the behavior in maintenance branches.  I take it 
what you want to do is make it so that if the parser ends up thinking it is 
seeing '%%' but there is stuff between the two %s, that's an error?

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-02-15 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +82

___
Python tracker 

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



[issue29557] binhex documentation claims unknown bug

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

File flags are saved in binhex format, therefore it is possible to distinguish 
text files from binary files.

--

___
Python tracker 

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



[issue29557] binhex documentation claims unknown bug

2017-02-15 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I think the comment about needing translation on non-mac systems is incorrect. 
Binhex is (or rather was) a textual encoding for binary files used on classic 
MacOS.  The encoded file is more likely to be binary data than a text file and 
replacing b'\r' by the line ending of the current platform could well corrupt 
that data.

--

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In this example characters between percents are parsed as for any conversion 
specifier but ignored and '%(a) %' is formatted to '%'. '(a)' specifies a 
mapping key, ' ' is a conversion flag, the second '%' is a conversion type.

>>> '%(a) d' % {'a': 123}
' 123'
>>> '%(a) %' % {'a': 123}
'%'

This behavior is explicable but looks weird and errorprone. I'm not sure about 
changing behavior in maintained branches (technically this may be not a bug), 
but I think it is worth to make this an error in the developed branch.

--
nosy: +benjamin.peterson, larry, ned.deily, rhettinger, serhiy.storchaka
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue29569] threading.Timer class: Continue periodical execution till action returns True

2017-02-15 Thread slytomcat

New submission from slytomcat:

I think that functionality of threading.Timer class can be easily extended to 
generate the sequence of runs with specified period. The idea comes from the 
GLib.timeout_add function. 

Run method of threading.Timer should look like:

def run(self):
"""Continue execution after wait till function returns True"""
while(not self.finished.wait(self.interval)):
if not self.function(*self.args, **self.kwargs):
break
self.finished.set()

--
components: Library (Lib)
messages: 287858
nosy: slytomcat
priority: normal
severity: normal
status: open
title: threading.Timer class: Continue periodical execution till action returns 
True
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



[issue29569] threading.Timer class: Continue periodical execution till action returns True

2017-02-15 Thread slytomcat

Changes by slytomcat :


--
pull_requests: +81

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-02-15 Thread Jerry Dimitrov

New submission from Jerry Dimitrov:

Hello everyone,
This is my first bug report to the python project, so please excuse me if the 
metadata for this particular issue is not 100% accurate.

Today I noticed (with the help from couple of people in IRC) a strange behavior 
in the python string formatting functionality.

Consider the following code snippets:

```
'%(a)s %(b)' % {'a': '1', 'b': '2'}

# result:
Traceback (most recent call last):
  File "", line 1, in 
ValueError: incomplete format
```


```
'%(a) %(b)s' % {'a': '1', 'b': '2'}

# result:
'%(b)s'

# expected result:
Traceback (most recent call last):
  File "", line 1, in 
ValueError: incomplete format
```

It seems that there is some kind of inconsistent (undefined) behavior, during 
the parsing of the type character for the formatted string (tested across all 
major python 2.x/3.x versions).

According to the documentation for string formatting and the relevant PEPs, 
there is no additional info about this particular case.

I want to say thank you to Yhg1s, JustASlacker, Jerub and lz1irq for 
discovering this 'bug/feature' and the additional information about it.

Please let me know if this is a bug, since I am not 100% sure if this is the 
case.
Thanks in advance for your time!

Best Regards,
Jerry

--
components: Interpreter Core
messages: 287857
nosy: Jerry Dimitrov
priority: normal
severity: normal
status: open
title: undefined parsing behavior with the old style string formatting
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-15 Thread Andrew Nester

Andrew Nester added the comment:

Ive just added alternative PR that drops inner brackets. So we've got options 
to choose!

--

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-15 Thread Andrew Nester

Changes by Andrew Nester :


--
pull_requests: +80

___
Python tracker 

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



[issue29442] Use argparse and drop dirty optparse hacks in setup.py

2017-02-15 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Aha the fix is simple => issue29567

--

___
Python tracker 

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



[issue29567] Allow argparse to be used in setup.py

2017-02-15 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
pull_requests: +78

___
Python tracker 

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



[issue29567] Allow argparse to be used in setup.py

2017-02-15 Thread Chi Hsuan Yen

New submission from Chi Hsuan Yen:

When proposing a fix for issue29442, I got another issue - argparse can't be 
used in setup.py for native (non-cross) builds because argparse imports gettext 
and gettext imports struct. I'll propose a fix for that.

--
components: Build
messages: 287854
nosy: Chi Hsuan Yen
priority: normal
severity: normal
status: open
title: Allow argparse to be used in setup.py
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



[issue23109] French quotes in the documentation are often ungrammatical

2017-02-15 Thread A.M. Kuchling

A.M. Kuchling added the comment:

It looks like there's nothing left to do for this ticket.

--
nosy: +akuchling
resolution:  -> fixed
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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-15 Thread Brian Curtin

Brian Curtin added the comment:

Dropping the inner brackets sounds like a better move to me.

--
nosy: +bethard, brian.curtin

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-15 Thread Christoph Stahl

Christoph Stahl added the comment:

Hi,

I thought a bit about the problem and came up with the following:

The | in the usage is de facto an XOR operator. Exactly one of the options can 
be used. The XOR operator has the associative property, meaning:

  (A XOR B) XOR C = A XOR (B XOR C)

So translated to the | this means:
  
  [[ -a | -b ] | -c ] = [ -a | [ -b | -c ]]

usually one writes:

  [ -a | -b | -c ]

So I propose dropping the inner brackets altogether.

--

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread Martin Panter

Martin Panter added the comment:

The file position is often useful when the cleanup is deterministic. Example:

def f1():
file1 = open("/dev/null")

def f2():
file2 = open("/dev/null")
del file2  # ResourceWarning

f1()  # ResourceWarning at function exit
f2()

In the these cases, the line number can identify the affected code:

demo.py:8: ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' 
mode='r' encoding='UTF-8'>
  f1()  # ResourceWarning at function exit
demo.py:6: ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' 
mode='r' encoding='UTF-8'>
  del file2  # ResourceWarning

--

___
Python tracker 

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



[issue29566] binhex() creates files with mixed line endings

2017-02-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

binhex.binhex() creates files with mixed line endings in Python 3. The header 
line '(This file must be converted with BinHex 4.0)' is separated from the data 
by LFs, but the data is split for lines by CRs.

>>> import binhex
>>> with open('inp', 'wb') as f: f.write(bytes(range(256)))
... 
256
>>> binhex.binhex('inp', 'outp')
>>> for line in open('outp', 'rb').read().splitlines(True): print(repr(line))
... 
b'(This file must be converted with BinHex 4.0)\r'
b'\r'
b':!fPZF!!rN!J!N!3"!*!&*VF!!3)$"!8\'"`J*#JX-$3i2%"%5%a39\'4SE("d\n'

[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0; ssl SNI callbacks should not modify context objects

2017-02-15 Thread David Ford (FirefighterBlu3)

Changes by David Ford (FirefighterBlu3) :


--
title: [python] Error in `/usr/bin/python': free(): invalid size: 
0x7f628400d0e0 -> [python] Error in `/usr/bin/python': free(): invalid 
size: 0x7f628400d0e0; ssl SNI callbacks should not modify context objects

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-15 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

yes, i create a context and then when a request comes in, i load the 
appropriate key. this is how most [all?] SNI capable python server examples 
show how to do it, or did, at the time I wrote this module a few years ago. 
from that time, ~py 3.2 until now, it worked perfectly.

thank you for this information, i'll rewrite my callback accordingly. perhaps 
18.2.5.3 in https://docs.python.org/3/library/ssl.html can be updated to inform 
developers how to change their socket.context in an SNI callback

--
resolution:  -> not a bug

___
Python tracker 

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



[issue29558] Provide run_until_complete inside loop

2017-02-15 Thread Javier Domingo

Javier Domingo added the comment:

Yes, indeed it is. Would it be possible to reconsider this functionality? It 
plays a key role when trying to rewrite full applications to async.

Rewriting the full stack of libraries at once is impossible, but the patching 
can easily be done in many cases.

--

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

@stinner your traceback suggestion was highly useful and much appreciated. i 
have spent several dozen hours researching ResourceWarnings in the past and 
tearing my hair out because the emitted warning was very much useless. i 
couldn't even make educated guesses about the code as socket pairs were used 
randomly.

i strongly approve of mentioning the tracemalloc / traceback in the warning, 
and i would also very much encourage saying "this filename:position could be 
completely wrong" or do away with it all together.

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-15 Thread Christian Heimes

Christian Heimes added the comment:

Do you modify the SSLContext object in your SNI callback? That's the wrong way 
to do it. You have to create a SSLContext object for each certificate/key pair 
at startup and then change the socket's context attribute.

--

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

i quite understand the way objects can be associated with reference counts by 
using a, a.b, c=a.b, d=a, etc etc, and how they increase/decrease and when the 
GC can prune the objects. yes, the root issue is the unclosed web socket and 
i've already filed a bug with Twilio.

@Martin,

/usr/lib/python3.6/site-packages/psycopg2/extras.py:314: ResourceWarning: 
unclosed 

/usr/lib/python3.6/site-packages/psycopg2/extras.py:314 is unrelated to the 
resource in question. there is nothing in psycopg2 that can have any direct or 
indirect reference to the tcp/443 socket used by the twilio by any path in the 
code all the way back to glibc under python. nothing in psycopg2 and twilio 
down to _ssl/glibc have any associated references.

the reference link between the two is at best as vague as connecting the water 
in the garden hose to the condensation on the hot shower mirror.

the pg socket is created and used which will fetch a result that has no 
reference to the socket used by that query method. regardless, the socket is a 
completely different IP/port pair. there is nothing in the pool, connection, 
cursor, or query that will ever be used by twilio. psycopg2 has nothing to do 
with any of the http or httplib2 modules.

after the pgsql query is completed, the twilio module gets used. a new https 
socket is created. the only data every seen by the twilio module that has a 
reference to any objected created by the psycopg2 module is the r.delivery_id 
which is a UUID value derived from the pgsql database. it has no references to 
its parent chain of objects and the twilio module doesn't derive any objects 
from it.

to be more obtuse about it, if i replace the r.delivery_id with a quoted string 
i manually insert, the ResourceWarning is now logged against asyncio/events.py. 
the traceback is still the same. 

/usr/lib/python3.6/asyncio/events.py:126: ResourceWarning: unclosed 

  self._callback(*self._args)

this one happens to exist in the stack trace albeit even further up the call 
chain.

if the ResourceWarning is unable to emit an accurate file:pos, then it 
shouldn't print it at all and instead, use the stack print as mentioned by 
@STINNER. at least at this point, the developer has a legitimate stack to 
wander through and isn't going on a wild goose chase in an unrelated file.

i argue that printing a completely unrelated file:pos is definitely a bug. if 
it is likely to emit a wholly unrelated file:pos, it shouldn't be printed at 
all. unreliable information is just useless.

--

___
Python tracker 

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



[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread STINNER Victor

STINNER Victor added the comment:

FYI the implementation of the ResourceWarning traceback was not as simple as I 
expected :-) I just wrote a blog post about, search for "ResourceWarning 
warnings now come with a traceback" in:
https://haypo.github.io/contrib-cpython-2016q1.html

--

___
Python tracker 

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



  1   2   >