[issue29337] BytesWarning at compile time

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch fixes the issue.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file46370/constant-key-bytes-warning.patch

___
Python tracker 

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



[issue29336] merge tuples in module

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Following patch uses _PyCode_ConstantKey() as a key. This allows supporting 
integers, floats, bytes, etc.

But I think we can go further and merge constants recursively.

See also issue28813.

--
nosy: +rhettinger
Added file: http://bugs.python.org/file46371/merge-constants.patch

___
Python tracker 

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



[issue28489] Fix comment in tokenizer.c

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There are just 8 legal combinations if ignore case:

>>> import tokenize
>>> sorted({x.lower() for x in tokenize._all_string_prefixes() if x})
['b', 'br', 'f', 'fr', 'r', 'rb', 'rf', 'u']

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29338] Output the text signature in the help of a class

2017-01-21 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Pydoc outputs the text signature for C functions. It defines parameters and 
default values and is a part of function description.

Help on built-in function format in module builtins:

format(value, format_spec='', /)
Return value.__format__(format_spec)

format_spec defaults to the empty string

When builtin or extension class is converted to Argument Clinic, the generated 
docstring and text signature of __new__ or __init__ methods usually is used as 
class docstring and text signature. But pydoc doesn't output the text signature 
for classes. The important part of information is lost.

For example, for just converted builtin enumerate class:

Help on class enumerate in module builtins:

class enumerate(object)
 |  Return an enumerate object.
 |  
 |iterable
 |  an object supporting iteration
 |  
 |  The enumerate object yields pairs containing a count (from start, which
 |  defaults to zero) and a value yielded by the iterable argument.
 |  
 |  enumerate is useful for obtaining an indexed list:
 |  (0, seq[0]), (1, seq[1]), (2, seq[2]), ...
 |  
 |  Methods defined here:
 |  
 |  __getattribute__(self, name, /)
 |  Return getattr(self, name).
 |  
 |  __iter__(self, /)
 |  Implement iter(self).
 |  
 |  __new__(*args, **kwargs) from builtins.type
 |  Create and return a new object.  See help(type) for accurate signature.
 |  
 |  __next__(self, /)
 |  Implement next(self).
 |  
 |  __reduce__(...)
 |  Return state information for pickling.

The iterable and start parameters of the constructor are referred but not 
defined.

--
components: Argument Clinic, Library (Lib)
messages: 285946
nosy: larry, ncoghlan, rhettinger, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Output the text signature in the help of a class
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



[issue12067] Doc: remove errors about mixed-type comparisons.

2017-01-21 Thread Martin Panter

Martin Panter added the comment:

Here is a port of the documentation to Python 2. Main differences:

* Default rules for order comparisons are different
* Not all kinds of objects inherit from object()
* str(), unicode() compatibility
* xrange() only seems to have default comparability
* NAN, “binary sequences” and sets not listed

--
Added file: http://bugs.python.org/file46372/expressions-py2.7.diff

___
Python tracker 

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



[issue28489] Fix comment in tokenizer.c

2017-01-21 Thread Eric V. Smith

Eric V. Smith added the comment:

Right, that's basically what _all_string_prefixes() does: it starts with the 6 
unique prefixes that are case- and order- independent ('b', 'r', 'u', 'f', 
'br', 'fr'), and adds the cased and ordered versions.

If you're saying that we should list those 8, and say "with all combinations of 
case", then I think we'd better off listing the 6 and saying "with all 
combinations of case and order". That's mainly because if "fbr" gets added, 
then the list of ordered ones gets larger.

But it's just a comment. I think we should just commit Ryan's last patch.

--

___
Python tracker 

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



[issue29104] Left bracket remains in format string result when '\' preceeds it

2017-01-21 Thread Serhiy Storchaka

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



[issue28489] Fix comment in tokenizer.c

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

No, I'm just saying that the list of combinations is not so large. Ryan's patch 
LGTM.

--

___
Python tracker 

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



[issue29267] Cannot override some flags in CFLAGS from the command-line

2017-01-21 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Please try:
make CFLAGS_NODIST=-std=gnu99

--
nosy: +xdegaye

___
Python tracker 

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



[issue12067] Doc: remove errors about mixed-type comparisons.

2017-01-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29328] struct module should support variable-length strings

2017-01-21 Thread Mark Dickinson

Mark Dickinson added the comment:

A couple of questions that haven't been brought up yet:

1. Do you have any thoughts on how alignment should behave for '@'-style 
structs containing variable-length strings? I suspect the easiest solution may 
be simply to disallow that combination, and only allow variable-length strings 
for "standard" struct types (those with a format string starting with one of 
"=", "<", ">", "!"), where alignment isn't an issue.

2. For the Struct object, what should the .size attribute give for a 
variable-length struct? (Or should accessing the attribute raise an exception?)

3. Any thoughts about how the internal representation of the Struct object 
would need to change? I guess you'd want to drop the "offset" field of the 
"formatcode" struct, and compute the offsets on the fly during packing and 
unpacking (or would you try to keep the offset for the non-variable-length 
cases?). You'd probably also want to find a way to encode the information about 
whether the struct is variable-length or not in the PyStructObject struct. A 
key requirement here is that there should be no substantial performance 
regression for packing / unpacking with structs that don't use the 
variable-length feature. It doesn't seem likely to me that getting rid of the 
precalculated offset would cause such a regression, but it's something that 
should be checked.

--

___
Python tracker 

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



[issue29273] test___all__ alters utf8 locale setting

2017-01-21 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The rationale supporting this change is sound and the patch LGTM.

--
nosy: +xdegaye

___
Python tracker 

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



[issue29328] struct module should support variable-length strings

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If you want to add the support variable-size fields, this is incompatible with 
the struct module design.

If you want to add the support of variable-length strings inside fixed-size 
fields (as with the 'p' format unit), I think this case is not enough common.

After getting so much negative responses from core developers well-versed in 
internals of the struct module, I think this issue should be closed.

--

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b33012ef1417 by Mark Dickinson in branch 'default':
Issue #29282: add fused multiply-add function, math.fma.
https://hg.python.org/cpython/rev/b33012ef1417

--
nosy: +python-dev

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Cross fingers...

--

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-21 Thread Mark Dickinson

Mark Dickinson added the comment:

Failures on the Windows buildbot 
(http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Non-Debug%203.x/builds/238/steps/test/logs/stdio)
 shown below.

It looks as though Windows is emulating the FMA operation on this machine (and 
not doing a particularly good job of it). That means that if we want to support 
Windows (and we do), we may have to emulate ourselves, preferably using 
something a bit more efficient than the fractions.Fraction module.

I'll let the buildbots complete, to see what else fails, and then roll back the 
commit. The patch clearly isn't good enough in its current state.


==
ERROR: test_fma_overflow (test.test_math.FMATests)
--
Traceback (most recent call last):
  File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_math.py", line 
1565, in test_fma_overflow
self.assertEqual(math.fma(a, b, -c),
OverflowError: overflow in fma

==
FAIL: test_fma_zero_result (test.test_math.FMATests)
--
Traceback (most recent call last):
  File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_math.py", line 
1524, in test_fma_zero_result
self.assertIsNegativeZero(math.fma(tiny, -tiny, 0.0))
  File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_math.py", line 
1642, in assertIsNegativeZero
msg="Expected a negative zero, got {!r}".format(value)
AssertionError: False is not true : Expected a negative zero, got 0.0

==
FAIL: test_random (test.test_math.FMATests)
--
Traceback (most recent call last):
  File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_math.py", line 
1623, in test_random
self.assertEqual(math.fma(a, b, c), expected)
AssertionError: 0.5506672157701096 != 0.5506672157701097

--

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b5a5f13500b9 by Mark Dickinson in branch 'default':
Issue #29282: Backed out changeset b33012ef1417
https://hg.python.org/cpython/rev/b5a5f13500b9

--

___
Python tracker 

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



[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-21 Thread Mark Dickinson

Mark Dickinson added the comment:

Also failures on Gentoo: here b is positive (possibly +inf), and c is finite, 
so we expect an infinite result. Instead, we're apparently getting a NaN. I 
don't have a good guess about what's causing this: the rest of the tests are 
passing, so it's unlikely that we're using a bad FMA emulation. Maybe an 
optimization bug?

==
ERROR: test_fma_infinities (test.test_math.FMATests)
--
Traceback (most recent call last):
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/test/test_math.py",
 line 1482, in test_fma_infinities
self.assertEqual(math.fma(math.inf, b, c), math.inf)
ValueError: invalid operation in fma

--

___
Python tracker 

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



[issue29326] Blank lines in ._pth file are not ignored

2017-01-21 Thread Steve Dower

Steve Dower added the comment:

The fix for this issue is needed in PC/getpathp.c as this is a special feature 
in path generation on Windows.

I'm not aware of any such issue with .pth files - the underscore in ._pth is 
deliberate.

--

___
Python tracker 

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



[issue16899] Add support for C99 complex type (_Complex) as ctypes.c_complex

2017-01-21 Thread Tom Krauss

Tom Krauss added the comment:

I'm trying to add support for this in cffi, which uses ctypes... apparently 
this is now supported in libffi (https://github.com/libffi/libffi, v3.2 Nov 
2014). 
It would be nice if this issue could be re-opened, or another one created for 
the same purpose.

--
nosy: +Tom Krauss

___
Python tracker 

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



[issue29338] Output the text signature in the help of a class

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch adds a text signature at the start of class description.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file46373/pydoc-class-signature.patch

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Martin, you are the one who looked at these patches for last three years. Do 
you want to take this issue to you and update Vajrasky's patches?

Now there is good performance argument for converting builtins to Argument 
Clinic.

--

___
Python tracker 

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



[issue29199] test_regrtest fails if PCBuild directory doesn't exist

2017-01-21 Thread ppperry

Changes by ppperry :


--
nosy: +ezio.melotti, michael.foord

___
Python tracker 

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



[issue29331] Simplify argument parsing in sorted() and list.sort()

2017-01-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 69bd5c497a82 by Serhiy Storchaka in branch 'default':
Issue #29331: Simplified argument parsing in sorted() and list.sort().
https://hg.python.org/cpython/rev/69bd5c497a82

--
nosy: +python-dev

___
Python tracker 

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



[issue29331] Simplify argument parsing in sorted() and list.sort()

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Victor.

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



[issue28735] Mock is equal to ANY but MagicMock is not

2017-01-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 442eb26b1ca4 by Serhiy Storchaka in branch '3.5':
Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY.
https://hg.python.org/cpython/rev/442eb26b1ca4

New changeset 4a38781538f7 by Serhiy Storchaka in branch '3.6':
Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY.
https://hg.python.org/cpython/rev/4a38781538f7

New changeset 597515fcb343 by Serhiy Storchaka in branch 'default':
Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY.
https://hg.python.org/cpython/rev/597515fcb343

--
nosy: +python-dev

___
Python tracker 

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



[issue28735] Mock is equal to ANY but MagicMock is not

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Berker.

Maybe _Call.__eq__ also should return NotImplemented in some cases, but I don't 
have a demonstrating example.

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



[issue29311] Argument Clinic: convert dict methods

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch fixes/improves docstrings of dict and OrderedDict methods.

--
nosy: +eric.snow, rhettinger
stage:  -> resolved
Added file: http://bugs.python.org/file46374/dict-docstrings.patch

___
Python tracker 

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



[issue29241] sys._enablelegacywindowsfsencoding() don't apply to os.fsencode and os.fsdecode

2017-01-21 Thread Steve Dower

Steve Dower added the comment:

Thanks for checking that.

I don't think it's worth retaining the cache on Windows in the face of the 
broken behaviour. Any real-world case where a lot of paths are being encoded or 
decoded is also likely to involve file-system access which will dwarf the 
encoding time. Further, passing bytes on Windows will result in another 
decode/encode cycle anyway, so there will be a bigger performance impact in 
using str (though even then, probably only when the str is already represented 
using 16-bit characters).

Unless somebody wants to make a case for having a more complex mechanism to 
reset the cache, I'll make the change to remove it (protected by an 'if 
sys.platform.startswith('win')' check).

--
assignee:  -> steve.dower
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



[issue29339] Interactive: Move to same indentation level as previous line

2017-01-21 Thread 12345 67890

New submission from 12345 67890:

Not sure if anyone has ever thought about this, but it would be nice if the 
interactive interpreter set the same indentation level as the previous line. Of 
course this isn't urgent, but what do others think?

--
messages: 285970
nosy: 12345 67890
priority: normal
severity: normal
status: open
title: Interactive: Move to same indentation level as previous line
type: enhancement

___
Python tracker 

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



[issue29340] SSL destructor segfaults in python3.6 threads when an unverified-cert connection is closed

2017-01-21 Thread Nick Sweeting

New submission from Nick Sweeting:

I mistakenly thought this bug was a pyOpenSSL bug, so I reported it there 
(https://github.com/pyca/pyopenssl/issues/588), but it looks like this is 
actually a bug in CPython.

See the link for a nicer formatted bug report with more details.

Code to reproduce: 
https://gist.github.com/pirate/6649314e02384274b29e04364c9d0c16

Crash dump:
https://gist.github.com/pirate/e1485110093d2d9fc49596e6ff481777

Description:
The bug is a segmentation fault when closing several secure websockets from 
inside concurrent python3.6 threads: 
```pythohn
'python3.6 libssl_bug.py' terminated by signal SIGSEGV (Address boundary error)
```

It does not occur when doing it in a single thread, only when closing multiple 
threads at once.


```python
threads = []
for _ in range(NUM_THREADS):
t = SocketThread('wss://echo.websocket.org/', ssl_opt={'cert_reqs': 0})
t.start()
threads.append(t)

sleep(4)

for t in threads:
t.keep_running = False
t.ws.close()  # libssl segfaults on python3.6 when closing a wss:// 
connection with cert_reqs=0
t.join()

```

This is my first python bug report, so apologies if I didn't get the formatting 
right or if I'm missing some info.

--
assignee: christian.heimes
components: SSL, macOS
files: libssl_bug.py
messages: 285971
nosy: Nick Sweeting, christian.heimes, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: SSL destructor segfaults in python3.6 threads when an unverified-cert 
connection is closed
type: crash
versions: Python 3.6
Added file: http://bugs.python.org/file46375/libssl_bug.py

___
Python tracker 

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



[issue28134] socket.socket(fileno=fd) does not work as documented

2017-01-21 Thread Christian Heimes

Christian Heimes added the comment:

Here is another example of how broken and dangerous fileno argument is. 
getpeername() is neither a valid IPv4 tuple nor a valid IPv6 tuple. It's all 
messed up:

>>> import socket
>>> s = socket.create_connection(('www.python.org', 443))
>>> s

>>> socket.socket(fileno=s.fileno())


--

___
Python tracker 

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



[issue29340] SSL destructor segfaults in python3.6 threads when an unverified-cert connection is closed

2017-01-21 Thread Christian Heimes

Christian Heimes added the comment:

I can reproduce the crash under Linux with OpenSSL 1.0.2j and Python 2.7, 3.5 
and 3.6. Python 2.7 doesn't crash every time, 1 out of 5 times maybe.

#0  ssl_buf_freelist_free (list=0x7fffe8003b50) at ssl_lib.c:2094
#1  0x7fffef3d68d7 in SSL_CTX_free (a=0x7fffe8006cf0) at ssl_lib.c:2182
#2  0x7fffed23c60b in context_dealloc (self=0x7fffecffa9e8) at 
/home/heimes/dev/python/3.6/Modules/_ssl.c:2787
#3  0x004c8b74 in subtype_dealloc (self=0x7fffecffa9e8) at 
Objects/typeobject.c:1222
#4  0x004a4bc7 in dict_dealloc (mp=0x7fffed00a480) at 
Objects/dictobject.c:2011
#5  0x004c8be2 in subtype_dealloc (self=0x7fffecfffce0) at 
Objects/typeobject.c:1207

--

___
Python tracker 

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



[issue29340] SSL destructor segfaults in python3.6 threads when an unverified-cert connection is closed

2017-01-21 Thread Christian Heimes

Christian Heimes added the comment:

SSL_CTX_free:

if (a->rbuf_freelist)
ssl_buf_freelist_free(a->rbuf_freelist);

(gdb) p list
$1 = (SSL3_BUF_FREELIST *) 0x7fffe8003b50
(gdb) p *list
$2 = {chunklen = 33096, len = 1, head = 0x7fffe8031c00}
(gdb) p *list->head
$3 = {next = 0x53031700}
(gdb) p *list->head->next
Cannot access memory at address 0x53031700

--

___
Python tracker 

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



[issue29241] sys._enablelegacywindowsfsencoding() don't apply to os.fsencode and os.fsdecode

2017-01-21 Thread STINNER Victor

STINNER Victor added the comment:

Can't we just update the cache when the function changes the encoding?

--

___
Python tracker 

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



[issue29340] SSL destructor segfaults in python3.6 threads when an unverified-cert connection is closed

2017-01-21 Thread Christian Heimes

Christian Heimes added the comment:

I can't reproduce the crash with OpenSSL 1.1.0 and LibreSSL 2.5.0. You might 
have found a bug in OpenSSL.

--

___
Python tracker 

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



[issue29340] SSL destructor segfaults in python3.6 threads when an unverified-cert connection is closed

2017-01-21 Thread Nick Sweeting

Nick Sweeting added the comment:

Actually I suspected it was OpenSSL first, I filed the report on their github 
issues, then went on a fun little wild goose chase that ended in the CPython 
issue tracker. :)

https://github.com/openssl/openssl/issues/2260

Thanks for helping debug this so quickly!

--

___
Python tracker 

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



[issue29182] Remove the warning in urllib docs that it doesn't do certificate validate by default.

2017-01-21 Thread Martin Panter

Martin Panter added the comment:

The warning for urllib2.urlopen() was removed in revision 1882157b298a. 
However, a couple other warnings were converted to “Changed in version 2.7.9” 
in revision fb83916c3ea1, which seems safer to me.

Removing documentation almost seems like a step backwards. The usual approach 
for new features is to document the new behaviour, and when it changed. This 
has also been done for the “context” etc parameters added in a bug fix release. 
So I suggest to document that the certificate is verified since 2.7.9, but not 
beforehand.

--
nosy: +martin.panter

___
Python tracker 

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



[issue29241] sys._enablelegacywindowsfsencoding() don't apply to os.fsencode and os.fsdecode

2017-01-21 Thread Steve Dower

Steve Dower added the comment:

How?

--

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2017-01-21 Thread Martin Panter

Martin Panter added the comment:

Will keep this in mind, but my time is rather limited, so I may not get to it 
(and I wouldn’t want to discourage other people from working on it)

--

___
Python tracker 

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



[issue29311] Argument Clinic: convert dict methods

2017-01-21 Thread Martin Panter

Martin Panter added the comment:

Patch looks good, apart from one little thing (see review)

--

___
Python tracker 

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



[issue1732367] Document the constants in the socket module

2017-01-21 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +Document socket.SOL_SOCKET

___
Python tracker 

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



[issue26273] Expose TCP_CONGESTION and TCP_USER_TIMEOUT to the socket module

2017-01-21 Thread Martin Panter

Martin Panter added the comment:

Patch looks good to me.

BTW in Issue 27409 I proposed a patch listing more of these.

--
nosy: +martin.panter

___
Python tracker 

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



[issue29182] Remove the warning in urllib docs that it doesn't do certificate validate by default.

2017-01-21 Thread Senthil Kumaran

Senthil Kumaran added the comment:

@Martin, that's a sound advice. I agree to it. I'll change it to a note 
(instead of warning) which mentions about certificate verification since 2.7.9.

--

___
Python tracker 

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



[issue29290] argparse breaks long lines on NO-BREAK SPACE

2017-01-21 Thread Xiang Zhang

Xiang Zhang added the comment:

v2 addresses the comments. I didn't receive the review notification mail so 
just saw them today. :-(

--
stage:  -> patch review
Added file: 
http://bugs.python.org/file46376/argparse-help-non-breaking-spaces-2.patch

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-21 Thread Xiang Zhang

Xiang Zhang added the comment:

Ping for review for timestamptz-3.patch.

--

___
Python tracker 

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



[issue28785] Clarify the behavior of __eq__() returning NotImplemented

2017-01-21 Thread Martin Panter

Changes by Martin Panter :


--
title: Clarify the behavior of NotImplemented -> Clarify the behavior of 
__eq__() returning NotImplemented

___
Python tracker 

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



[issue15997] NotImplemented needs to be documented

2017-01-21 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +Clarify the behavior of __eq__() returning NotImplemented

___
Python tracker 

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



[issue29092] Sync os.stat's doc and doc string

2017-01-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1f30e114cbc8 by Xiang Zhang in branch '3.5':
Issue #29092: Sync os.stat's doc and docstring on path type.
https://hg.python.org/cpython/rev/1f30e114cbc8

New changeset 409ffea5cccf by Xiang Zhang in branch '3.6':
Issue #29092: Sync os.stat's doc and docstring on path type.
https://hg.python.org/cpython/rev/409ffea5cccf

New changeset cee9d322178f by Xiang Zhang in branch 'default':
Issue #29092: Merge 3.6.
https://hg.python.org/cpython/rev/cee9d322178f

--
nosy: +python-dev

___
Python tracker 

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



[issue29092] Sync os.stat's doc and doc string

2017-01-21 Thread Xiang Zhang

Changes by Xiang Zhang :


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



[issue28663] Higher virtual memory usage on recent Linux versions

2017-01-21 Thread INADA Naoki

INADA Naoki added the comment:

@ProgVal, could you try following?
I doubt that this difference just shows rlimit behavior, not memory usage.

---
$ cat rlimit_difference_linux_versions.py 
import sys
import queue
import multiprocessing
from urllib.request import Request, urlopen
import resource
import tracemalloc

def fetch():
url = 'http://python.org/'
request = Request(url)
fd = urlopen(request)
return 'ok'

fetch()
print(tracemalloc.get_traced_memory())

$ /usr/bin/time python3 rlimit_difference_linux_versions.py 
(0, 0)
0.12user 0.01system 0:01.47elapsed 9%CPU (0avgtext+0avgdata 18372maxresident)k
0inputs+0outputs (0major+2639minor)pagefaults 0swaps

$ PYTHONTRACEMALLOC=1 /usr/bin/time python3 rlimit_difference_linux_versions.py 
(6072093, 6140554)
0.22user 0.01system 0:01.52elapsed 15%CPU (0avgtext+0avgdata 22640maxresident)k
0inputs+0outputs (0major+3942minor)pagefaults 0swaps

--
nosy: +inada.naoki

___
Python tracker 

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



[issue29341] Missing accepting path-like object in docstrings of os module functions

2017-01-21 Thread Xiang Zhang

New submission from Xiang Zhang:

PathLike objects are added in 3.6 and they are mentioned in the documentation. 
But in some os module functions' docstrings, acceptable types of path parameter 
are mentioned and they are not altered to mention path-like object. For example:

chown(path, uid, gid, *, dir_fd=None, follow_symlinks=True)
Change the owner and group id of path to the numeric uid and gid.\

  path
Path to be examined; can be string, bytes, or open-file-descriptor int.

--
messages: 285988
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: Missing accepting path-like object in docstrings of os module functions
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



[issue29341] Missing accepting path-like object in docstrings of os module functions

2017-01-21 Thread Xiang Zhang

Changes by Xiang Zhang :


--
stage:  -> needs patch

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added few minor comments on Rietveld. Technically the patch LGTM. But the 
behavior change of the timestamp converter for input without timezone offset 
perhaps needs wider discussion. We have several options:

0. Current behavior. Silently drop the timezone if there are microseconds, and 
raise an error when there are no microseconds. This is bad for many reasons, 
but some user code can depend on this.

1. Just drop the timezone, don't raise an error when there are no microseconds. 
The converter will become returning incorrect result instead of just failing on 
unexpected input. This will fix the user code that is aware of this, but 
currently fails when input doesn't have microseconds.

2. Return aware datetime for input with timezone offset (as in original patch). 
Returning aware or naive datetime depending on input can break a user code that 
is not prepared for this.

3. Raise an error for input with timezone offset, always return naive datetime 
objects from this converter. This can break the user code that depends on 
current behavior and works with the input containing the same timezone offsets.

Any option can break some code. I prefer option 3, but want to hear thoughts of 
other core developers. Maybe discuss this on Python-Dev?

--

___
Python tracker 

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



[issue29341] Missing accepting path-like object in docstrings of os module functions

2017-01-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> docs@python
components: +Documentation
keywords: +easy
nosy: +docs@python

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-21 Thread Xiang Zhang

Xiang Zhang added the comment:

> Maybe discuss this on Python-Dev?

It's fine. Could you compose a mail instead of me? I am not good at that. :-(

--

___
Python tracker 

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



[issue29290] argparse breaks long lines on NO-BREAK SPACE

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

You perhaps need to change your email provider Xiang. It fails too often.

--
assignee:  -> xiang.zhang
stage: patch review -> commit review

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm even worse at that. :-(

--

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-21 Thread Xiang Zhang

Xiang Zhang added the comment:

> I'm even worse at that. :-(

LoL. Okay I'll do that. :-)

--

___
Python tracker 

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



[issue29290] argparse breaks long lines on NO-BREAK SPACE

2017-01-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 98cde683b9c6 by Xiang Zhang in branch '3.5':
Issue #29290: argparse help messages won't wrap at non-breaking spaces.
https://hg.python.org/cpython/rev/98cde683b9c6

New changeset 1754722ec296 by Xiang Zhang in branch '3.6':
Issue #29290: Merge 3.5.
https://hg.python.org/cpython/rev/1754722ec296

New changeset c47a72627f0c by Xiang Zhang in branch 'default':
Issue #29290: Merge 3.6.
https://hg.python.org/cpython/rev/c47a72627f0c

--
nosy: +python-dev

___
Python tracker 

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



[issue29290] argparse breaks long lines on NO-BREAK SPACE

2017-01-21 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks Serhiy. 

BTW, #16623 is about 2.7 and the cause is wrap doesn't handle unicode 
non-breaking spaces right. So it's not the same thing as here.

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



[issue29335] Python 2.7 subprocess module does not check WIFSTOPPED on SIGCHLD

2017-01-21 Thread Zach Riggle

Zach Riggle added the comment:

To further clarify the report:

When the attached proof-of-concept is executed, a RuntimeException is raised, 
which has a comment "Should never happen".

The issue isn't due to SIGCHLD, but rather following a waitpid() call.  The 
code attempts to suss the exit code / reason for waitpid() returning, but does 
not check for WIFSTOPPED in its handler.

--

___
Python tracker 

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