[issue31870] add timeout parameter for get_server_certificate in ssl.py

2018-02-25 Thread Christian Heimes

Christian Heimes  added the comment:

It's too late to land a new feature in 3.7.

--
stage: patch review -> needs patch
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue32949] Simplify "with"-related opcodes

2018-02-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This will not solve issue29988 but will open a way for solving it at least for 
synchronous "with" (swap POP_BLOCK and the following LOAD_CONST and disable 
interrupting after POP_BLOCK).

--
nosy: +ncoghlan

___
Python tracker 

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



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-25 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

from idlelib.pyparse import Parser
import timeit
code='def f():\n'
print(timeit.timeit("statement",  # for example
"p=Parser(4,4)", globals = globals()))

statement microseconds
Parser.1  # test timeit code
Parser() 2.2
p.set_code('')   1.4
p.set_code(code) 1.8
'('.translate(map1) 1.5 or 2.2 depending on ParseMap

Translate time is longer for real code and Parser() instance creation time must 
be well less than 1/10, maybe 1/100 of any answer time.  If we don't reuse 
instances, though, set_code should be part of __init__ (and tests changed).  
Either change is low priority.

--

___
Python tracker 

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



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-25 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

As I mentioned before, Parser.set_code strongly suggests that Parser instances 
were intended to be reused.  But you discovered the bug that prevented this, at 
least for one code result.  With that fixed, it should be possible to have one 
Parser instance per editor.

Since hyperparser is used to match each ), ], and } we could look at that too.

--

___
Python tracker 

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



[issue32876] HTMLParser raises exception on some inputs

2018-02-25 Thread Ezio Melotti

Change by Ezio Melotti :


--
assignee:  -> ezio.melotti

___
Python tracker 

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



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-25 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

If you [view] a message, there is an unlink button at the bottom for the author 
(and believe) and tracker gardeners.  I did this for the duplicate and 
incomplete messages.

In the future, lets put timing data for an idea on a separate issue for the 
idea.  This puts everything about the idea in a one place.  It is OK if we 
close the separate issue as rejected because the data show the idea not 
worthwhile.  

Unfortunately, there is no way to just move a message to another issue.  But it 
can be copied to another and unlinked from the first.

--

___
Python tracker 

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



[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2018-02-25 Thread Nick Coghlan

Nick Coghlan  added the comment:

With issue 17611 merged (which moves stack unwinding to the compiler), I expect 
the exact details of this problem to have changed, but the general problem 
still exists: Ctrl-C may lead to __exit__ (or __aexit__) not being called even 
after __enter__ (or __aenter__) returns successfully, and this may happen even 
for context managers implemented with uninterruptible methods (e.g. in C in 
CPython without calling back into any Python code).

--

___
Python tracker 

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



[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-25 Thread Eric V. Smith

Eric V. Smith  added the comment:

I'm going to close this. Steven: if you gain support for a parameter name 
change, please open another issue.

--
priority: release blocker -> normal
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8

___
Python tracker 

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



[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5672

___
Python tracker 

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



[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-25 Thread Eric V. Smith

Eric V. Smith  added the comment:


New changeset dbf9cff48a4ad0fd58e1c623ce1f36c3dd3d5f38 by Eric V. Smith in 
branch 'master':
bpo-32929: Dataclasses: Change the tri-state hash parameter to the boolean 
unsafe_hash. (#5891)
https://github.com/python/cpython/commit/dbf9cff48a4ad0fd58e1c623ce1f36c3dd3d5f38


--

___
Python tracker 

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



[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-25 Thread Guido van Rossum

Guido van Rossum  added the comment:

@steven.daprano the name was +1'ed by many people in the python-dev discussion 
as sending the right message. So I'm reluctant to change it. If you can cause a 
landslide of support for `_hash` there we can change it in b3.

--

___
Python tracker 

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



[issue29237] Create enum for pstats sorting options

2018-02-25 Thread Ethan Furman

Ethan Furman  added the comment:

Thanks for catching that!

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



[issue19894] zipfile ignores deflate level settings in zipinfo object

2018-02-25 Thread bbayles

bbayles  added the comment:

This was fixed in issue 21417, in Github PR 5385:

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

--
nosy: +bbayles

___
Python tracker 

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



[issue17286] Make subprocess handling text output with universal_newlines more obious

2018-02-25 Thread bbayles

bbayles  added the comment:

This is fixed in 3.7 with the `text` parameter. See GitHub PR 4049: 
https://github.com/python/cpython/pull/4049

--
nosy: +bbayles

___
Python tracker 

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



[issue32953] Dataclasses: frozen should not be inherited

2018-02-25 Thread Eric V. Smith

Eric V. Smith  added the comment:

A related issue is that dataclasses derived from frozen dataclasses are 
automatically "promoted" to being frozen.

>>> @dataclass(frozen=True)
... class A:
... i: int
...
>>> @dataclass
... class B(A):
... j: int
...
>>> b = B(1, 2)
>>> b.j = 3
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\home\eric\local\python\cpython\lib\dataclasses.py", line 452, in 
_frozen_setattr
raise FrozenInstanceError(f'cannot assign to field {name!r}')
dataclasses.FrozenInstanceError: cannot assign to field 'j'

If this can't be addressed before 3.7, maybe it should be an error to declare B 
as non-frozen and then we can properly fix it in a future release.

--

___
Python tracker 

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



[issue32953] Dataclasses: frozen should not be inherited

2018-02-25 Thread Eric V. Smith

New submission from Eric V. Smith :

Reported by Raymond Hettinger:

When working on the docs for dataclasses, something unexpected came up.  If a 
dataclass is specified to be frozen, that characteristic is inherited by 
subclasses which prevents them from assigning additional attributes:

>>> @dataclass(frozen=True)
class D:
x: int = 10

>>> class S(D):
pass

>>> s = S()
>>> s.cached = True
Traceback (most recent call last):
  File "", line 1, in 
s.cached = True
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/dataclasses.py",
 line 448, in _frozen_setattr
raise FrozenInstanceError(f'cannot assign to field {name!r}')
dataclasses.FrozenInstanceError: cannot assign to field 'cached'

Other immutable classes in Python don't behave the same way:


>>> class T(tuple):
pass

>>> t = T([10, 20, 30])
>>> t.cached = True

>>> class F(frozenset):
pass

>>> f = F([10, 20, 30])
>>> f.cached = True

>>> class B(bytes):
pass

>>> b = B()
>>> b.cached = True


Raymond

--
assignee: eric.smith
components: Library (Lib)
messages: 312866
nosy: eric.smith, rhettinger
priority: normal
severity: normal
status: open
title: Dataclasses: frozen should not be inherited
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue29237] Create enum for pstats sorting options

2018-02-25 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Can this one be closed since it was an enhancement and doesn't need to be 
backported?

--
nosy: +csabella

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-02-25 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks!

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



[issue32945] sorted(generator) is slower than sorted(list-comprehension)

2018-02-25 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

FYI, here is the disassembly of the inner code objects.  It shows where the 
difference in speed arises:

>>> from dis import dis
>>> def f():
lc = [i for i in [1, 2]]
ge = (i for i in [1, 2])
return lc, ge

>>> for obj in f.__code__.co_consts:
if type(obj) == type(f.__code__):
print(obj)
dis(obj)


 at 0x113d881e0, file "", line 2>
  2   0 BUILD_LIST   0
  2 LOAD_FAST0 (.0)
>>4 FOR_ITER 8 (to 14)
  6 STORE_FAST   1 (i)
  8 LOAD_FAST1 (i)
 10 LIST_APPEND  2   <-- Append directly
 12 JUMP_ABSOLUTE4
>>   14 RETURN_VALUE
 at 0x1035afe40, file "", line 3>
  3   0 LOAD_FAST0 (.0)
>>2 FOR_ITER10 (to 14)
  4 STORE_FAST   1 (i)
  6 LOAD_FAST1 (i)
  8 YIELD_VALUE  <-- Pass data through 
iterator
 10 POP_TOP  <-- Dispose of None from 
send()
 12 JUMP_ABSOLUTE2
>>   14 LOAD_CONST   0 (None)
 16 RETURN_VALUE

The list comprehension builds the list directly with the high-speed 
specialized, LIST_APPEND opcode.

The generator runs YIELD_VALUE and POP_TOP but the work isn't done.  There 
needs to be a context switch to list_extend() which then extract the value from 
the iterator and finally appends it to the list.

Executive summary: there is overhead when passing data through the iterator 
protocol.

--

___
Python tracker 

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



[issue5840] "Thread State and the Global Interpreter Lock" section of the docs doesn't cover TLS APIs

2018-02-25 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I believe this issue is superseded by PEP539 and issue25658?

--
nosy: +csabella

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-02-25 Thread miss-islington

miss-islington  added the comment:


New changeset ecaa372f74eeb6c032791c520af6b23e527d335f by Miss Islington (bot) 
in branch '2.7':
bpo-32500: Correct the documentation for PySequence_Size() and 
PySequence_Length() (GH-5767)
https://github.com/python/cpython/commit/ecaa372f74eeb6c032791c520af6b23e527d335f


--

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-02-25 Thread miss-islington

miss-islington  added the comment:


New changeset 139e64694f546982a8cc801dda30670abadb8d06 by Miss Islington (bot) 
in branch '3.7':
bpo-32500: Correct the documentation for PySequence_Size() and 
PySequence_Length() (GH-5767)
https://github.com/python/cpython/commit/139e64694f546982a8cc801dda30670abadb8d06


--

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-02-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5671

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-02-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5670

___
Python tracker 

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



[issue13474] Mention of "-m" Flag Missing From Doc on Execution Model

2018-02-25 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +easy
type:  -> enhancement
versions: +Python 3.7, Python 3.8 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-25 Thread Ned Deily

Ned Deily  added the comment:

What's the status of this issue?  We need to make a decision soon about what to 
do for 3.7.0.

--

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2018-02-25 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks!

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

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2018-02-25 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset b7c1a94f94305d82fc77f833fd68cc8616991bd4 by Mariatta (Cheryl 
Sabella) in branch '2.7':
[2.7] bpo-25059: Clarify the print separator usage in tutorial (GH-5879)
https://github.com/python/cpython/commit/b7c1a94f94305d82fc77f833fd68cc8616991bd4


--

___
Python tracker 

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



[issue32911] Doc strings no longer stored in body of AST

2018-02-25 Thread Ned Deily

Ned Deily  added the comment:

Is this going to get resolved in time for 3.7.0b2?  If we need to change this 
behavior, I really do not want to delay this for b3 which is when the 3.7.0 ABI 
freezes; otherwise such a major behavior change would likely need to wait until 
3.8.

--
priority: normal -> release blocker

___
Python tracker 

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



[issue32378] test_npn_protocols broken with LibreSSL 2.6.1+

2018-02-25 Thread Christian Heimes

Christian Heimes  added the comment:

NPN issue has been fixed in BPO #30622.

Thanks for your help!

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Fix NPN guard for OpenSSL 1.1

___
Python tracker 

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



[issue29413] ssl.SSLSocket.unwrap() is not flexible enough

2018-02-25 Thread Christian Heimes

Change by Christian Heimes :


--
assignee:  -> christian.heimes
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue17123] Add OCSP support to ssl module

2018-02-25 Thread Christian Heimes

Change by Christian Heimes :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue25115] SSL_set_verify_depth not exposed by the ssl module

2018-02-25 Thread Christian Heimes

Christian Heimes  added the comment:

Both Alex and I agree that verify depth is not the right solution to solve your 
problem. I'd rather not add more APIs unless they are useful for general 
audience. OpenSSL has a good default for verify depth.

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



[issue27876] Add SSLContext.set_version_range(minver, maxver=None)

2018-02-25 Thread Christian Heimes

Christian Heimes  added the comment:

My issue #32609 provides a better implementation.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Add setter and getter for min/max protocol ersion

___
Python tracker 

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



[issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates

2018-02-25 Thread Christian Heimes

Christian Heimes  added the comment:

BPO #31372 and #18369 provide the necessary bits and pieces for your request. I 
didn't have enough time to finish both in time for 3.7 feature freeze. Hostname 
verification improvements and TLS 1.3 were more important.

I'm closing this issue because ssl.wrap_socket() is deprecated and will be 
removed in the future.

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



[issue26471] load_verify_locations(cadata) should load AUX ASN.1 to supported trusted certs

2018-02-25 Thread Christian Heimes

Change by Christian Heimes :


--
priority: high -> normal
versions: +Python 3.8 -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



[issue21541] Provide configure option --with-ssl for compilation with custom openssl

2018-02-25 Thread Christian Heimes

Christian Heimes  added the comment:

Python 3.7+ uses 
https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html to detect 
OpenSSL. It provides --with-openssl=DIR or can utilize pkg-config.

I'm closing this feature issue as duplicate of #32598.

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Use autoconf to detect OpenSSL and libssl features

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2018-02-25 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
pull_requests: +5669

___
Python tracker 

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



[issue12345] Add math.tau

2018-02-25 Thread Mark Dickinson

Change by Mark Dickinson :


--
pull_requests:  -5653

___
Python tracker 

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



[issue18369] X509 cert class for ssl module

2018-02-25 Thread Christian Heimes

Christian Heimes  added the comment:

I won't be able to land this in time for b2. It's most done but not production 
ready. I have only a limited amount of time and will use it to fix TLS 1.3 bits 
and pieces.

Rescheduling for 3.8

--
priority: deferred blocker -> normal
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



[issue32819] match_hostname() error reporting bug

2018-02-25 Thread Christian Heimes

Change by Christian Heimes :


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



[issue32952] Add __qualname__ for attributes of Mock instances

2018-02-25 Thread Sergey Kostyuk

New submission from Sergey Kostyuk :

Good day. I have a question (or proposal, if you like)

For now Mocks from unittest.mock module allows to mimic an interface of a some 
class or object instance. They pass isinstance checks, they allows to wrap 
callables with respect to their arguments. But there is a thing they don't 
mimic: a value of the __qualname__ attribute for a mock itself and its mocked 
attributes.

So, here is the proposal: copy the value of __qualname__ attribute from the 
wrapped (mocked) instance for all of the attributes of a Mock.

I don't know if it's reasonable enough to be implemented at all but it can be 
handy in some situations.

An example of the current and desired behaviour is provided in the attached 
file. And sorry for my English

--
components: Tests
files: qualname_for_mocks.py
messages: 312849
nosy: s_kostyuk
priority: normal
severity: normal
status: open
title: Add __qualname__ for attributes of Mock instances
type: enhancement
versions: Python 3.8
Added file: https://bugs.python.org/file47462/qualname_for_mocks.py

___
Python tracker 

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



[issue31454] Include "import as" in tutorial

2018-02-25 Thread miss-islington

miss-islington  added the comment:


New changeset 76349471adfa4366a92438c88fd05a0e1e94c59b by Miss Islington (bot) 
in branch '2.7':
bpo-31454: Include information about "import X as Y" in Modules tutorial 
(GH-4041)
https://github.com/python/cpython/commit/76349471adfa4366a92438c88fd05a0e1e94c59b


--

___
Python tracker 

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



[issue31454] Include "import as" in tutorial

2018-02-25 Thread miss-islington

miss-islington  added the comment:


New changeset e48e6499bbad56f7cc665efa25ae4847f51dbc38 by Miss Islington (bot) 
in branch '3.7':
bpo-31454: Include information about "import X as Y" in Modules tutorial 
(GH-4041)
https://github.com/python/cpython/commit/e48e6499bbad56f7cc665efa25ae4847f51dbc38


--

___
Python tracker 

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



[issue31454] Include "import as" in tutorial

2018-02-25 Thread miss-islington

miss-islington  added the comment:


New changeset 5a07608d0855e4104e4070328155b52010dec4e7 by Miss Islington (bot) 
in branch '3.6':
bpo-31454: Include information about "import X as Y" in Modules tutorial 
(GH-4041)
https://github.com/python/cpython/commit/5a07608d0855e4104e4070328155b52010dec4e7


--
nosy: +miss-islington

___
Python tracker 

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



[issue32872] backport of #32305 causes regressions in various packages

2018-02-25 Thread Ned Deily

Ned Deily  added the comment:

Thanks, Barry!  I don't see that either action is ideal but I am concerned 
about breaking third-party packages and 2 (already known) breakages is 
worrisome.  And thanks, @doko, for bringing the matter up.

--

___
Python tracker 

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



[issue32872] backport of #32305 causes regressions in various packages

2018-02-25 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I'd personally prefer to keep the fix (I ran into some problems w/3.6), but 
I'll defer to the RM.  I'll revert the change for 3.6, but I want to test it 
with importlib_resources first, since I'll probably have to spin a new release 
of that package too.

--

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2018-02-25 Thread miss-islington

miss-islington  added the comment:


New changeset b9678d3aa156996947655ed66b554f6307b29546 by Miss Islington (bot) 
in branch '3.6':
bpo-25059: Clarify the print separator usage in tutorial (GH-5879)
https://github.com/python/cpython/commit/b9678d3aa156996947655ed66b554f6307b29546


--

___
Python tracker 

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



[issue31454] Include "import as" in tutorial

2018-02-25 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks everyone. I've merged Marios's PR. The backport PRs have started and 
will automerge.

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



[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2018-02-25 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

In msg151730, R. David Murry said "Terry's [first] patch with the ("{}") 
removed should be committed, though."
In msg151738, Eric V. Smith said "I agree with your comment about Terry's 
patch."

My second patch removed "{}" but also made more text changes, explained in 
msg151757.  Someone should re-review

--

___
Python tracker 

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



[issue31454] Include "import as" in tutorial

2018-02-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5668

___
Python tracker 

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



[issue31454] Include "import as" in tutorial

2018-02-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5667

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2018-02-25 Thread miss-islington

miss-islington  added the comment:


New changeset ddf2485103c1e56ba4f290641247dfa07fcbe7f3 by Miss Islington (bot) 
in branch '3.7':
bpo-25059: Clarify the print separator usage in tutorial (GH-5879)
https://github.com/python/cpython/commit/ddf2485103c1e56ba4f290641247dfa07fcbe7f3


--
nosy: +miss-islington

___
Python tracker 

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



[issue31454] Include "import as" in tutorial

2018-02-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5666

___
Python tracker 

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



[issue32872] backport of #32305 causes regressions in various packages

2018-02-25 Thread Ned Deily

Ned Deily  added the comment:

OK, I agree with Brett and Nick.  Barry, are you OK with reverting this change 
for 3.6?  If so, can you do the honors?

--
stage:  -> needs patch

___
Python tracker 

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



[issue31454] Include "import as" in tutorial

2018-02-25 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset fbee88244e8921afdb29fde51a9a010a8ae18277 by Mariatta (Mario 
Corchero) in branch 'master':
bpo-31454: Include information about "import X as Y" in Modules tutorial 
(GH-4041)
https://github.com/python/cpython/commit/fbee88244e8921afdb29fde51a9a010a8ae18277


--

___
Python tracker 

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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-25 Thread Ned Deily

Ned Deily  added the comment:

What's the status of this issue?  3.7.0b2 is tagging in 48 hours or so.

--
versions: +Python 3.8

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2018-02-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5665

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-25 Thread Ned Deily

Ned Deily  added the comment:

What's the status of this issue?  3.7.0b2 is tagging in 48 hours or so and 
3.6.5rc1 is in less than 2 weeks.

--

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2018-02-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5664

___
Python tracker 

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



[issue25059] Mistake in input-output tutorial regarding print() seperator

2018-02-25 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 84c4b0cc67ceb4b70842b78c718b6e8214874d6a by Mariatta (Cheryl 
Sabella) in branch 'master':
bpo-25059: Clarify the print separator usage in tutorial (GH-5879)
https://github.com/python/cpython/commit/84c4b0cc67ceb4b70842b78c718b6e8214874d6a


--
nosy: +Mariatta

___
Python tracker 

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



[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-25 Thread Eric V. Smith

Eric V. Smith  added the comment:

I've been focused on getting the code fix in for the next beta release on 
2018-02-26, and leaving the possible parameter name change for later. I don't 
feel strongly about the parameter name. Right now it's unsafe_hash, per Guido's 
original proposal.

--

___
Python tracker 

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



[issue31454] Include "import as" in tutorial

2018-02-25 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

> PR 4041 looks good to me. Mariatta, do you have time to look at Mario's patch?

Sorry I just saw this now, months later.
Looks good to me. I can merge and backport once the CI passed.
Thanks!

--

___
Python tracker 

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



[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-25 Thread Eric V. Smith

Change by Eric V. Smith :


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

___
Python tracker 

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



[issue32932] better error message when __all__ contains non-str objects

2018-02-25 Thread Brett Cannon

Brett Cannon  added the comment:

This is only for `import *`, though, right? So I would argue you're already 
tossing import perf out the window if you're willing to pollute your namespace 
like that.

--

___
Python tracker 

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



[issue31355] Remove Travis CI macOS job: rely on buildbots

2018-02-25 Thread Brett Cannon

Brett Cannon  added the comment:

Awesome, thanks for taking the time to verify all of that! And I agree with 
your logic to not bother backporting.

--

___
Python tracker 

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



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-25 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Looking at the creation of the instances of pyparse.PyParse() and 
hyperparser.HyperParser(), I was a little surprised that they (the instances) 
are local variables to the methods and aren't instance variables.  Since they 
are called fairly often, wouldn't it be more efficient to use an instance 
variable (for example self.hp in calltips instead of hp) and update the 
attributes when something like open_calltips() is executed?  Maybe the overhead 
of creating a class is neglible compared to the storage of not destroying it 
every time?

--

___
Python tracker 

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



[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-25 Thread Eric V. Smith

Eric V. Smith  added the comment:

if unsafe_hash:
# If there's already a __hash__, raise TypeError, otherwise add 
__hash__.
if has_explicit_hash:
hash_action = 'exception'
else:
hash_action = 'add'
else:
# unsafe_hash is False (the default).
if has_explicit_hash:
# There's already a __hash__, don't overwrite it.
hash_action = ''
else:
if eq and frozen:
# It's frozen and we added __eq__, generate __hash__.
hash_action = 'add'
elif eq and not frozen:
# It's not frozen but has __eq__, make it unhashable.
#  This is the default if no params to @dataclass.
hash_action = 'none'
else:
# There's no __eq__, use the base class __hash__.
hash_action = ''

--

___
Python tracker 

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



[issue32925] AST optimizer: Change a list into tuple in iterations and containment tests

2018-02-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The direct inspiration of this optimization was your note that similar 
optimization was implemented in Python.

--

___
Python tracker 

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



[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2018-02-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
priority: normal -> low

___
Python tracker 

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



[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-25 Thread Guido van Rossum

Guido van Rossum  added the comment:

I don't know if I'm unique, but I find such a table with 4 Boolean keys
hard to understand. I'd rather see it written up as a series of nested 'if'
statements.

--

___
Python tracker 

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



[issue32945] sorted(generator) is slower than sorted(list-comprehension)

2018-02-25 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

[Antony Lee]
> so both cases are much more similar -- superficially, at least.

Try disassembling the inner code object as well -- that is where the work gets 
done and the list comprehension can take advantage of the LIST_APPEND opcode 
(rather than passing data to list_extend through an iterator which has more 
overhead).

[Stefan Behnel]
> The difference is that comprehensions are generally more efficient than 
> generators, simply because they are more specialised.

Yes, that is most succinct description of why would expect a difference.

[Steven D'Aprano]
> So I don't think this is a bug, and I don't think there's any room to 
> optimize the generator comprehension case.

I concur.

[Antony Lee]
> Feel free to close the issue if that's not the forum for this discussion, but 
> I'm still baffled by what's happening.

Yes, this discussion is more suited to a StackOverflow entry where people 
commonly ask about why Python behaves as it does.  The bug tracker is more 
suited to known regressions or provable optimizations.  (One forum is for "I'm 
baffled" and the other is for "I have an improvement").

Marking this a closed.  If some demonstrable optimization is found, feel free 
to reopen.

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



[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-25 Thread Eric V. Smith

Eric V. Smith  added the comment:

Here's the simplest way I can describe this, and it's also the table used 
inside the code.  The column "has-explicit-hash?" is trying to answer the 
question "is there a __hash__ function defined in this class?". It is set to 
False if either __hash__ is missing, or if __hash__ is None and there's an 
__eq__ function. I'm assuming that the __hash__ is implicit in the latter case.

# Decide if/how we're going to create a hash function.  Key is
#  (unsafe_hash, eq, frozen, does-hash-exist).  Value is the action to
#  take.
# Actions:
#  '':  Do nothing.
#  'none':  Set __hash__ to None.
#  'add':   Always add a generated __hash__function.
#  'exception': Raise an exception.
#
#+-- unsafe_hash?
#|  +--- eq?
#|  |  + frozen?
#|  |  |  +  has-explicit-hash?
#|  |  |  |
#|  |  |  |+---  action
#|  |  |  ||
#v  v  v  vv
_hash_action = {(False, False, False, False): (''),
(False, False, False, True ): (''),
(False, False, True,  False): (''),
(False, False, True,  True ): (''),
(False, True,  False, False): ('none'),
(False, True,  False, True ): (''),
(False, True,  True,  False): ('add'),
(False, True,  True,  True ): (''),
(True,  False, False, False): ('add'),
(True,  False, False, True ): ('exception'),
(True,  False, True,  False): ('add'),
(True,  False, True,  True ): ('exception'),
(True,  True,  False, False): ('add'),
(True,  True,  False, True ): ('exception'),
(True,  True,  True,  False): ('add'),
(True,  True,  True,  True ): ('exception'),
}

PR will be ready as soon as I clean a few things up.

--

___
Python tracker 

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



[issue32951] Prohibit direct instantiation of SSLSocket and SSLObject

2018-02-25 Thread Christian Heimes

Change by Christian Heimes :


--
keywords: +patch
pull_requests: +5662
stage: needs patch -> patch review

___
Python tracker 

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



[issue32951] Prohibit direct instantiation of SSLSocket and SSLObject

2018-02-25 Thread Christian Heimes

Christian Heimes  added the comment:

Antoine Pitrou replied:

The ssl.SSLSocket constructor was never meant to be called by user
code directly (and I don't think we document it as such).  Anyone doing
this is asking for trouble (including compatibility breakage as we
change the constructor signature).

ssl.wrap_socket() is essentially a legacy API.

I would suggest the following measures :

- Deprecate ssl.wrap_socket() and slate it to be removed around 3.8 or
3.9.  SSLContext is now is any recent 2.7 or 3.x version, so the
compatibility argument doesn't hold anymore.

- Severely de-emphasize ssl.wrap_socket() in the documentation (relegate
it in a "legacy API" section at the end), and put a warning that it's
insecure.


---
Alex Gaynor replied:

If SSLSocket.__init__ is meant to be private and not called by users,
perhaps we could clean up the API and remove all the legacy arguments it
takes, bring it down to just taking a context?

It'd break anyone who was relying on it, but they weren't supposed to be
relying on it in the first place... (Is it documented even?)

---

I have implemented Antoine's second proposal in #28124.

--

___
Python tracker 

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



[issue32951] Prohibit direct instantiation of SSLSocket and SSLObject

2018-02-25 Thread Christian Heimes

New submission from Christian Heimes :

The constructors of SSLObject and SSLSocket were never documented, tested, or 
meant to be used directly. Instead users were suppose to use ssl.wrap_socket or 
an SSLContext object. The ssl.wrap_socket() function and direct instantiation 
of SSLSocket has multiple issues. From my mail "No hostname matching with 
ssl.wrap_socket() and SSLSocket() constructor" to PSRT:

The ssl module has three ways to create a
SSLSocket object:

1) ssl.wrap_socket() [1]
2) ssl.SSLSocket() can be instantiated directly without a context [2]
3) SSLContext.wrap_socket() [3]

Variant (1) and (2) are old APIs with insecure default settings.

Variant (3) is the new and preferred way. With
ssl.create_default_context() or ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
the socket is configured securely with hostname matching and cert
validation enabled.


While Martin Panter was reviewing my documentation improvements for the
ssl module, he pointed out an issue,
https://github.com/python/cpython/pull/3530#discussion_r170407478 .
ssl.wrap_socket() and ssl.SSLSocket() default to CERT_NONE but
PROTOCOL_TLS_CLIENT is documented to set CERT_REQUIRED. After a closer
look, it turned out that the code is robust and refuses to accept
PROTOCOL_TLS_CLIENT + default values with "Cannot set verify_mode to
CERT_NONE when check_hostname is enabled.". I consider the behavior a
feature.


However ssl.SSLSocket() constructor and ssl.wrap_socket() have more
fundamental security issues. I haven't looked at the old legacy APIs in
a while and only concentrated on SSLContext. To my surprise both APIs do
NOT perform or allow hostname matching. The wrap_socket() function does
not even take a server_hostname argument, so it doesn't send a SNI TLS
extension either. These bad default settings can lead to suprising
security bugs in 3rd party code. This example doesn't fail although the
hostname doesn't match the certificate:

---
import socket
import ssl

cafile = ssl.get_default_verify_paths().cafile

with socket.socket() as sock:
ssock = ssl.SSLSocket(
sock,
cert_reqs=ssl.CERT_REQUIRED,
ca_certs=cafile,
server_hostname='www.python.org'
)
ssock.connect(('www.evil.com', 443))
---


I don't see a way to fix the issue in a secure way while keeping
backwards compatibility. We could either modify the default behavior of
ssl.wrap_socket() and SSLSocket() constructor, or drop both features
completely. Either way it's going to break software that uses them.
Since I like to get rid of variants (1) and (2), I would favor to remove
them in favor of SSLContext.wrap_socket(). At least we should implement
my documentation bug 28124 [4] and make ssl.wrap_socket() less
prominent. I'd appreciate any assistance.

By the way, SSLObject is sane because it always goes through
SSLContext.wrap_bio(). Thanks Benjamin!

Regards,
Christian


[1] https://docs.python.org/3/library/ssl.html#ssl.wrap_socket
[2] https://docs.python.org/3/library/ssl.html#ssl.SSLSocket
[3] https://docs.python.org/3/library/ssl.html#ssl.SSLContext.wrap_socket
[4] https://bugs.python.org/issue28124

--
assignee: christian.heimes
components: SSL
messages: 312823
nosy: alex, christian.heimes, dstufft, janssen, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Prohibit direct instantiation of SSLSocket and SSLObject
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue12345] Add math.tau

2018-02-25 Thread Guido van Rossum

Change 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



[issue32622] Implement loop.sendfile

2018-02-25 Thread miss-islington

miss-islington  added the comment:


New changeset 632c1cb57176d268d65a9fd7b00582f32e0884ee by Miss Islington (bot) 
in branch '3.7':
bpo-32622: Native sendfile on windows (GH-5565)
https://github.com/python/cpython/commit/632c1cb57176d268d65a9fd7b00582f32e0884ee


--
nosy: +miss-islington

___
Python tracker 

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



[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2018-02-25 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

>From the examples in msg220401, issue28385 changed it to print the object type 
>in the message. 

>>> format([], 'd')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported format string passed to list.__format__
>>> format((), 'd')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported format string passed to tuple.__format__


Would the change left on this issue be to create a PR for Terry's documetation 
patch?

Thanks!

--
nosy: +csabella
versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue32622] Implement loop.sendfile

2018-02-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5661

___
Python tracker 

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



[issue32622] Implement loop.sendfile

2018-02-25 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset a19fb3c6aaa7632410d1d9dcb395d7101d124da4 by Andrew Svetlov in 
branch 'master':
bpo-32622: Native sendfile on windows (#5565)
https://github.com/python/cpython/commit/a19fb3c6aaa7632410d1d9dcb395d7101d124da4


--

___
Python tracker 

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



[issue32759] multiprocessing.Array do not release shared memory

2018-02-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28124] Rework SSL module documentation

2018-02-25 Thread Christian Heimes

Change by Christian Heimes :


--
keywords: +patch
pull_requests: +5660
stage: needs patch -> patch review

___
Python tracker 

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



[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate

2018-02-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Aren't they were moved in issue25612? Is there something that should be done in 
this issue?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate

2018-02-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue32017] profile.Profile() has no method enable()

2018-02-25 Thread bbayles

bbayles  added the comment:

I've made a pull request that clarifies things in the docs.

As csabella notes, there are some more differences that could be pointed out. 
The 'subcalls' and 'builtins' arguments could be explained as well.

Nonetheless, I think the PR does fix some definitely incorrect aspects of the 
existing documentation and is at least an improvement.

--

___
Python tracker 

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



[issue32017] profile.Profile() has no method enable()

2018-02-25 Thread bbayles

Change by bbayles :


--
keywords: +patch
pull_requests: +5659
stage: needs patch -> patch review

___
Python tracker 

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



[issue13607] Move generator specific sections out of ceval.

2018-02-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue13607] Move generator specific sections out of ceval.

2018-02-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The WHY_* codes are gone in 3.8 (see issue17611). Exception state was moved 
from frame to generator in 3.7 (see issue25612).

Can some parts of the patch be applied to the current code? Or it is completely 
outdated?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32950] profiling python gc

2018-02-25 Thread Luavis

New submission from 강성일 (Luavis) :

There is way to logging python garbage collection event. but no way to 
profiling it.

--
messages: 312816
nosy: 강성일 (Luavis)
priority: normal
severity: normal
status: open
title: profiling python gc
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



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

2018-02-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Finally it is merged, and seems successfully. Thank you all involved, and first 
at all Mark, the original author.

This unblocked further changes, issue32489 and issue32949. And we can try 
implement other ideas.

Changes in the f_lineno setter fixed crashes in issue17288 and issue28883. But 
while writing tests for it I found other crashers, will open new issues soon.

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



[issue32017] profile.Profile() has no method enable()

2018-02-25 Thread bbayles

bbayles  added the comment:

I'm afraid that profile.Profile and cProfile.Profile behave pretty differently, 
and there's not a good way to bring the methods from the C version to the 
Python version.

The example at [1] shows a cProfile.Profile object being instantiated and 
enabled. At this point the profiler is tracing execution - until the disable() 
method is called, any activity is recorded.

profile.Profile doesn't work this way. Creating a profile.Profile object 
doesn't cause activity to be recorded. It doesn't do anything until you call 
one of its run* methods.

This is because the C version uses PyEval_SetProfile ([2]) to take advantage of 
CPython's "low-level support for attaching profiling and execution tracing 
facilities" ([3]). I don't think we can do that from the Python version.

There is already a precedent for showing differences between cProfile.Profile 
and profile.Profile in the existing docs - see [4].


[1] https://docs.python.org/3/library/profile.html#profile.Profile
[2] 
https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Modules/_lsprof.c#L693
[3] https://docs.python.org/3/c-api/init.html#profiling-and-tracing
[4] https://docs.python.org/3/library/profile.html#using-a-custom-timer

--
nosy: +bbayles

___
Python tracker 

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



[issue32949] Simplify "with"-related opcodes

2018-02-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue32949] Simplify "with"-related opcodes

2018-02-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

There are some issues with "with"-related opcodes.

All other opcodes has constant stack effect for particular control flow. For 
example FOR_ITER always has the stack effect 1 if not jump (pushes the next 
item) and -1 if jumps (pops the iterator). The only exceptions are 
WITH_CLEANUP_START which pushes 1 or 2 values depending on TOS, and 
WITH_CLEANUP_FINISH which pops 2 or 3 values depending on values pushed by 
preceding WITH_CLEANUP_START. This breaks consistency and may make debugging 
harder.

WITH_CLEANUP_START duplicates a one of values on the stack without good 
reasons. Even the comment in the initial commit exposed uncertainty in this.

The proposed PR simplifies WITH_CLEANUP_START and WITH_CLEANUP_FINISH. They 
will be now executed only when the exception is raised. In normal case they 
will be replaced with calling a  function `__exit__(None, None, None)`.

LOAD_CONST   0 ((None, None, None))
CALL_FUNCTION_EX 0
POP_TOP

WITH_CLEANUP_FINISH will be merged with the following END_FINALLY.

This PR is inspired by PR 5112 by Mark Shannon, but Mark goes further.

In addition to simplifying the implementation and the mental model, the PR adds 
a tiny bit of performance gain.

$ ./python -m perf timeit -s 'class CM:' -s '  def __enter__(s): pass' -s '  
def __exit__(*args): pass' -s 'cm = CM()' -- 'with cm: pass'

Unpatched:  Mean +- std dev: 227 ns +- 6 ns
Patched:Mean +- std dev: 205 ns +- 10 ns

--
components: Interpreter Core
messages: 312813
nosy: Mark.Shannon, benjamin.peterson, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Simplify "with"-related opcodes
type: performance
versions: Python 3.8

___
Python tracker 

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



[issue30622] Fix NPN guard for OpenSSL 1.1

2018-02-25 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset df1732a4734190fefc8814687895fc1168716c37 by Christian Heimes in 
branch '2.7':
[2.7] bpo-30622: Fix NPN for OpenSSL 1.1.1-pre1 (GH-5876) (#5882)
https://github.com/python/cpython/commit/df1732a4734190fefc8814687895fc1168716c37


--

___
Python tracker 

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



[issue30622] Fix NPN guard for OpenSSL 1.1

2018-02-25 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset a79591cfb81dde65bb2f891d62de0161c23a4ff4 by Christian Heimes in 
branch '3.6':
[3.6] bpo-30622: Fix NPN for OpenSSL 1.1.1-pre1 (GH-5876) (#5881)
https://github.com/python/cpython/commit/a79591cfb81dde65bb2f891d62de0161c23a4ff4


--

___
Python tracker 

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



[issue32948] clang compiler warnings on Travis

2018-02-25 Thread Christian Heimes

New submission from Christian Heimes :

I'm seeing a bunch of compile errors on 2.7 branch, 
https://travis-ci.org/python/cpython/jobs/345906584


/home/travis/build/python/cpython/Modules/_heapqmodule.c:600:21: warning: 
illegal character encoding in string literal [-Winvalid-source-encoding]
[explanation by Franois Pinard]\n\
^~~~
Include/Python.h:174:60: note: expanded from macro 'PyDoc_STRVAR'
#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
   ^
Include/Python.h:176:24: note: expanded from macro 'PyDoc_STR'
#define PyDoc_STR(str) str
   ^
1 warning generated.

clang -pthread -fno-strict-aliasing -OPT:Olimit=0 -g -O2 -g -O0 -Wall 
-Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE  -c 
./Modules/pwdmodule.c -o Modules/pwdmodule.o
./Modules/posixmodule.c:363:13: warning: comparison of constant 
9223372036854775807 with expression of type 'uid_t' (aka 'unsigned int') is 
always true [-Wtautological-constant-out-of-range-compare]
if (uid <= LONG_MAX)
~~~ ^  
./Modules/posixmodule.c:371:13: warning: comparison of constant 
9223372036854775807 with expression of type 'gid_t' (aka 'unsigned int') is 
always true [-Wtautological-constant-out-of-range-compare]
if (gid <= LONG_MAX)
~~~ ^  
clang -pthread -fno-strict-aliasing -OPT:Olimit=0 -g -O2 -g -O0 -Wall 
-Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE  -c 
./Modules/_sre.c -o Modules/_sre.o
clang -pthread -fno-strict-aliasing -OPT:Olimit=0 -g -O2 -g -O0 -Wall 
-Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE  -c 
./Modules/_codecsmodule.c -o Modules/_codecsmodule.o
./Modules/pwdmodule.c:115:17: warning: comparison of unsigned expression < 0 is 
always false [-Wtautological-compare]
if (uid < 0)
~~~ ^ ~
1 warning generated.

/home/travis/build/python/cpython/Modules/grpmodule.c:102:17: warning: 
comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if (gid < 0)
~~~ ^ ~
1 warning generated.

/cpython/Modules/nismodule.c -o 
build/temp.linux-x86_64-2.7-pydebug/home/travis/build/python/cpython/Modules/nismodule.o
/home/travis/build/python/cpython/Modules/nismodule.c:404:15: warning: 
  explicitly assigning value of variable of type 'nismaplist *' (aka
  'struct nismaplist *') to itself [-Wself-assign]
for (maps = maps; maps; maps = maps->next) {
  ^ 
1 warning generated.

/cpython/Modules/_cursesmodule.c -o 
build/temp.linux-x86_64-2.7-pydebug/home/travis/build/python/cpython/Modules/_cursesmodule.o
/home/travis/build/python/cpython/Modules/_cursesmodule.c:1082:15: warning: 
  implicit conversion from 'chtype' (aka 'unsigned long') to 'int' changes
  value from 18446744073709551615 to -1 [-Wconstant-conversion]
rtn = mvwinch(self->win,y,x);
~ ^~
/usr/include/curses.h:1247:58: note: expanded from macro 'mvwinch'
  ...(wmove((win),(y),(x)) == ERR ? NCURSES_CAST(chtype, ERR) : winch(win))
^
/usr/include/curses.h:222:34: note: expanded from macro 'NCURSES_CAST'
#define NCURSES_CAST(type,value) (type)(value)
 ^
1 warning generated.

--
components: Extension Modules
messages: 312810
nosy: christian.heimes
priority: low
severity: normal
stage: needs patch
status: open
title: clang compiler warnings on Travis
type: compile error
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



[issue28883] Python 3.5.2 crashers (from PyPy)

2018-02-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

C5 is fixed in 3.8 by issue17611.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue17288] cannot jump from a return after setting f_lineno

2018-02-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Example in msg183254 doesn't crash Python 3.8.

--

___
Python tracker 

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



[issue30622] Fix NPN guard for OpenSSL 1.1

2018-02-25 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset 961774184eb950e2547ab0d42653439adc735924 by Christian Heimes 
(Miss Islington (bot)) in branch '3.7':
[3.7] bpo-30622: Fix NPN for OpenSSL 1.1.1-pre1 (GH-5876) (#5880)
https://github.com/python/cpython/commit/961774184eb950e2547ab0d42653439adc735924


--

___
Python tracker 

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



  1   2   >