[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-07-25 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue34229] Possible access to unintended variable in "cpython/Objects/sliceobject.c" line 116

2018-07-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue14266] pyunit script as shorthand for python -m unittest

2018-07-25 Thread Berker Peksag


Berker Peksag  added the comment:

I agree with Ned. I've been using "python -m foo" instead of "foo" more in the 
past few years.

pyvenv has been deprecated in Python 3.6 and its documentation now uses "python 
-m venv".

+1 for closing this as "rejected".

--

___
Python tracker 

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



[issue34230] crashes in pysqlite_build_row_cast_map() on memory allocation failure

2018-07-25 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


--
pull_requests: +7996

___
Python tracker 

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



[issue34230] crashes in pysqlite_build_row_cast_map() on memory allocation failure

2018-07-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Better error handling in sqlite3

___
Python tracker 

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



[issue22374] Replace contextmanager example and improve explanation

2018-07-25 Thread Berker Peksag


Berker Peksag  added the comment:

The old tag() example has been replaced with a different example in 
https://github.com/python/cpython/commit/bde782bb594edffeabe978abeee2b7082ab9bc2a
 (bpo-33468)

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Add try-finally contextlib.contextmanager example

___
Python tracker 

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



[issue34230] crashes in pysqlite_build_row_cast_map() on memory allocation failure

2018-07-25 Thread Sergey Fedoseev


New submission from Sergey Fedoseev :

pysqlite_build_row_cast_map() can crash on memory allocation failure:

1. it doesn't check that PyList_New() returns non-NULL
2. Py_DECREF() borrowed reference when

--
components: Extension Modules
messages: 322396
nosy: sir-sigurd
priority: normal
severity: normal
status: open
title: crashes in pysqlite_build_row_cast_map() on memory allocation failure
type: crash

___
Python tracker 

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



[issue34229] Possible access to unintended variable in "cpython/Objects/sliceobject.c" line 116

2018-07-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Good catch!

--
components: +Interpreter Core
keywords: +easy (C)
nosy: +serhiy.storchaka
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue34229] Possible access to unintended variable in "cpython/Objects/sliceobject.c" line 116

2018-07-25 Thread Petru-Florin Mihancea


New submission from Petru-Florin Mihancea :

While experimenting with a CodeSonar plugin we develop, we noticed a potential 
bug in file "cpython/Objects/sliceobject.c" line 116 function 
PySlice_GetIndices.

if (r->start == Py_None) {
*start = *step < 0 ? length-1 : 0;
} else {
if (!PyInt_Check(r->start) && !PyLong_Check(r->step)) return -1;//HERE
*start = PyInt_AsSsize_t(r->start);
if (*start < 0) *start += length;
}

Shouldn't start field of r be used in the second check (instead of step)?

In a related potential issue, in line 123, shouldn't r->stop be checked in the 
second verification?

Thanks,
Petru Florin Mihancea

--
messages: 322394
nosy: pet...@gmail.com
priority: normal
severity: normal
status: open
title: Possible access to unintended variable in 
"cpython/Objects/sliceobject.c" line 116
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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ecf411c59e33d3760dbfebf6d5b4b205bcc29d5a by Victor Stinner in 
branch 'master':
bpo-34170: Enhance _PyCoreConfig_Read() (GH-8468)
https://github.com/python/cpython/commit/ecf411c59e33d3760dbfebf6d5b4b205bcc29d5a


--

___
Python tracker 

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



[issue34227] Weighted random.sample() (weighted sampling without replacement)

2018-07-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
assignee:  -> rhettinger
nosy: +mark.dickinson, rhettinger
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



[issue34226] cgi.parse_multipart() requires undocumented CONTENT-LENGTH in Python 3.7

2018-07-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue33028] tempfile.TemporaryDirectory incorrectly documented

2018-07-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

On a similar note SpooledTemporaryFile is also documented as a function though 
it's a class. Ref : 
https://docs.python.org/3.8/library/tempfile.html#tempfile.SpooledTemporaryFile

--
nosy: +xtreak

___
Python tracker 

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



[issue9226] erroneous behavior when creating classes inside a closure

2018-07-25 Thread Tal Einat


Tal Einat  added the comment:

See additional discussion in the duplicate issue19979.

--
nosy: +taleinat

___
Python tracker 

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



[issue31823] Opaque default value for close_fds argument in Popen.__init__

2018-07-25 Thread Tal Einat


Tal Einat  added the comment:

ISTM that the docs need to be fixed for both 3.7+ and for 3.6.

The signature is indeed awkward for 3.6, but it's too minor a detail to address 
considering it's no longer relevant for 3.7 and later.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
keywords: +easy
nosy: +docs@python, taleinat
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



[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-07-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7993

___
Python tracker 

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



[issue29842] Make Executor.map work with infinite/large inputs correctly

2018-07-25 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

In response to Max's comments:

>But consider the case where input is produced slower than it can be processed 
>(`iterables` may fetch data from a database, but the callable `fn` may be a 
>fast in-memory transformation). Now suppose the `Executor.map` is called when 
>the pool is busy, so there'll be a delay before processing begins. In this 
>case, the most efficient approach is to get as much input as possible while 
>the pool is busy, since eventually (when the pool is freed up) it will become 
>the bottleneck. This is exactly what the current implementation does.

I'm not sure the "slow input iterable, fast task, competing tasks from other 
sources" case is all that interesting. Uses of Executor.map in the first place 
are usually a replacement for complex task submission; perhaps my viewpoint is 
blinkered, but I see the Executors used for *either* explicit use of submit 
*or* map, rather than mixing and matching (you might use it for both, but 
rarely interleave usages). Without a mix and match scenario (and importantly, a 
mix and match scenario where enough work is submitted before the map to occupy 
all workers, and very little work is submitted after the map begins to space 
out map tasks such that additional map input is requested while workers are 
idle), the smallish default prefetch is an improvement, simply by virtue of 
getting initial results more quickly.

The solution of making a dedicated input thread would introduce quite a lot of 
additional complexity, well beyond what I think it justifiable for a relatively 
niche use case, especially one with many available workarounds, e.g.

1. Raising the prefetch count explicitly

2. Having the caller listify the iterable (similar to passing an arbitrarily 
huge prefetch value, with the large prefetch value having the advantage of 
sending work to the workers immediately, while listifying has the advantage of 
allowing you to handle any input exceptions up front rather than receiving them 
lazily during processing)

3. Use cheaper inputs (e.g. the query string, not the results of the DB query) 
and perform the expensive work as part of the task (after all, the whole point 
is to parallelize the most expensive work)

4. Using separate Executors so the manually submitted work doesn't interfere 
with the mapped work, and vice versa

5. Making a separate ThreadPoolExecutor to generate the expensive input values 
via its own map function (optionally with a larger prefetch count), e.g. 
instead of

with SomeExecutor() as executor:
for result in executor.map(func, (get_from_db(query) for query in queries)):

do:

with SomeExecutor() as executor, ThreadPoolExecutor() as inputexec:
inputs = inputexec.map(get_from_db, queries)
for result in executor.map(func, inputs):

Point is, yes, there will still be niche cases where Executor.map isn't 
perfect, but this patch is intentionally a bit more minimal to keep the Python 
code base simple (no marshaling exceptions across thread boundaries) and avoid 
extreme behavioral changes; it has some smaller changes, e.g. it necessarily 
means input-iterator-triggered exceptions can be raised after some results are 
successfully produced, but it doesn't involve adding more implicit threading, 
marshaling exceptions across threads, etc.

Your proposed alternative, with a thread for prefetching inputs, a thread for 
sending tasks, and a thread for returning results creates a number of problems:

1. As you mentioned, if no prefetch limit is imposed, memory usage remains 
unbounded; if the input is cheap to generate and slow to process, memory 
exhaustion is nearly guaranteed for infinite inputs, and more likely for "very 
large" inputs. I'd prefer the default arguments to be stable in (almost) all 
cases, rather than try to maximize performance for rare cases at the expense of 
stability in many cases.

2. When input generation is CPU bound, you've just introduced an additional 
source of unavoidable GIL contention; granted, after the GIL fixes in 3.2, GIL 
contention tends to hurt less (before those fixes, I could easily occupy 1.9 
cores doing 0.5 cores worth of actual work with just two CPU bound threads). 
Particularly in the ProcessPoolExecutor case (where avoiding GIL contention is 
the goal), it's a little weird if you can end up with unavoidable GIL 
contention in the main process.

3. Exception handling from the input iterator just became a nightmare; in a 
"single thread performs input pulls and result yield" scenario, the exceptions 
from the input thread naturally bubble to the caller of Executor.map (possibly 
after several results have been produced, but eventually). If a separate thread 
is caching from the input iterator, we'd need to marshal the exception from 
that thread back to the thread running Executor.map so it's visible to the 
caller, and providing a traceback that is both accurate and useful is not 
obvious.

--


[issue33139] Bdb doesn't find instruction in linecache after pdb.set_trace() following os.chdir("/tmp")

2018-07-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Seems related : https://bugs.python.org/issue31121

--
nosy: +xtreak

___
Python tracker 

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



[issue19979] Missing nested scope vars in class scope (bis)

2018-07-25 Thread Tal Einat


Tal Einat  added the comment:

This does indeed seem to be a duplicate of issue9226.

--
nosy: +taleinat
resolution:  -> duplicate
stage: test needed -> resolved
status: pending -> closed
superseder:  -> erroneous behavior when creating classes inside a closure

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-25 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7992

___
Python tracker 

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



[issue32663] SMTPUTF8SimTests are not actually being run

2018-07-25 Thread Segev Finer


Change by Segev Finer :


--
nosy: +Segev Finer

___
Python tracker 

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



[issue34223] PYTHONDUMPREFS=1 ./python -c pass does crash

2018-07-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Seems like this is the same as https://bugs.python.org/issue30156. 

Relevant commit : 
https://github.com/python/cpython/commit/7822f151b68e40376af657d267ff774439d9adb9
 . 
Comment on the commit : 
https://github.com/python/cpython/commit/7822f151b68e40376af657d267ff774439d9adb9#commitcomment-21880815

Python 3.5.1 works fine but Python 3.5.2rc1 will crash.

# Python 3.5.2rc1 crash

$ git checkout v3.5.2rc1 && git clean -xdf && time ./configure --with-pydebug 
&& make -s -j4 && PYTHONDUMPREFS=1 ./python -c pass
(...)
0x7f8915f0b258 [1] 
0x7f8915f0d3d8 [1] {'__setattr__': , '__doc__': 'Thread-local data', '__delattr__': , '__getattribute__': , '__new__': }
0x7f8915f09260 [1] (,)
0x8ad8e0 [6] 
0x7f8915f0b1d8 [1] 
0x7f8915f05270 [1] 9099904
0x7f8915f00298 [1] 'Thread-local dummy'
0x7f8915f06d78 [1] (, )
0x7f8915f0d368 [1] {'__doc__': 'Thread-local dummy'}
0x7f8915f091f8 [1] (,)
0x8ada80 [2] 
0x7f8915f0d218 [1] {'_filters_mutated': None, 'warn': None, 'warn_explicit': 
None, '__spec__': None, '_defaultaction': None, '__loader__': None, 'filters': 
None, '__package__': None, '__doc__': None, '_onceregistry': None, '__name__': 
None}
0x7f8915f0b158 [1]
0x7f8915f0d190 [1] '_warnings'
0x7f8915f65e28 [1] [1]8258 segmentation fault (core dumped)  
PYTHONDUMPREFS=1 ./python -c pass


# Python 3.5.1 works fine

$ git checkout v3.5.1 && git clean -xdf && time ./configure --with-pydebug && 
make -s -j4 && PYTHONDUMPREFS=1 ./python -c pass
(...)
0x7f60ba2e51e0 [58] str
0x7f60ba2e5178 [67] str
0x7f60ba2e5110 [58] str
0x7f60ba2e50a8 [58] str
0x7f60ba2e5040 [38] str
0x7f60ba2e3350 [22] str
0x7f60ba2e32e0 [51] str
0x7f60ba2e3270 [156] str
0x7f60ba2e3200 [22] str
0x7f60ba2e3190 [22] str
0x7f60ba2e3120 [6] str
0x7f60ba2e30c8 [1] dict
0x7f60ba2e4040 [142] str
0x7f60ba2e3058 [1] dict
0x7f60ba2e2058 [352] tuple
0x8986e0 [423] type


Thanks

--

___
Python tracker 

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



[issue34228] Allow PYTHONTRACEMALLOC=0 and -X tracemalloc=0 to disable explicitly tracemalloc

2018-07-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 60b04c9f6fb87522a62ab6b95db9f8a09aef42d4 by Victor Stinner in 
branch 'master':
bpo-34228: Allow PYTHONTRACEMALLOC=0 (GH-8467)
https://github.com/python/cpython/commit/60b04c9f6fb87522a62ab6b95db9f8a09aef42d4


--

___
Python tracker 

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



[issue34221] Any plans to combine collections.OrderedDict with dict

2018-07-25 Thread iMath

New submission from iMath :

Since Python 3.7,dicts remember the order that items were inserted, so any 
plans to combine collections.OrderedDict with dict?
https://docs.python.org/3/library/collections.html?#collections.OrderedDict
https://docs.python.org/3/library/stdtypes.html#dict 

BTW, I think it would be better to move "Dictionaries preserve insertion order" 
part at the end of the doc of 
https://docs.python.org/3/library/stdtypes.html#dict 
up below the doc for 
class dict(**kwarg)
class dict(mapping, **kwarg)
class dict(iterable, **kwarg)
so that people won't miss the feature when consulting the doc

--
messages: 322349
nosy: redstone-cold
priority: normal
severity: normal
status: open
title: Any plans to combine collections.OrderedDict with dict
type: enhancement

___
Python tracker 

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



[issue34223] PYTHONDUMPREFS=1 ./python -c pass does crash

2018-07-25 Thread STINNER Victor


New submission from STINNER Victor :

It seems like Python has an invalid object somewhere. PYTHONDUMPREFS=1 makes 
Python crash at exit.

$ PYTHONDUMPREFS=1 ./python -c pass
(...)
0x7f1992292448 [1] (, )
0x7f1992241aa8 [1] {'__doc__': 'Thread-local dummy'}
0x7f199222c740 [1] (,)
0x9c98a0 [2] 
0x7f1992217dc0 [1] 
Segmentation fault (core dumped)

--
components: Interpreter Core
messages: 322353
nosy: vstinner
priority: normal
severity: normal
status: open
title: PYTHONDUMPREFS=1 ./python -c pass does crash
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



[issue34226] cgi.parse_multipart() requires undocumented CONTENT-LENGTH in Python 3.7

2018-07-25 Thread Chih-Hsuan Yen


New submission from Chih-Hsuan Yen :

In Python 3.7, cgi.parse_multipart() requires "CONTENT-LENGTH" in the second 
parameter `pdict`. This is not necesary in Python 3.6.

For example, the following code runs with 3.6:

$ python3.6
Python 3.6.6 (default, Jun 27 2018, 13:11:40) 
[GCC 8.1.1 20180531] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cgi, io
>>> data = b'--heyDavid\r\nContent-Disposition: form-data; 
>>> name="cfield"\r\n\r\njust a string\r\n\r\n--heyDavid--\r\n'
>>> cgi.parse_multipart(io.BytesIO(data), {"boundary": b"heyDavid"})
{'cfield': [b'just a string\r\n']}

While not on 3.7:

$ python3.7
Python 3.7.0 (default, Jul 15 2018, 10:44:58) 
[GCC 8.1.1 20180531] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cgi, io
>>> data = b'--heyDavid\r\nContent-Disposition: form-data; 
>>> name="cfield"\r\n\r\njust a string\r\n\r\n--heyDavid--\r\n'
>>> cgi.parse_multipart(io.BytesIO(data), {"boundary": b"heyDavid"})
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.7/cgi.py", line 220, in parse_multipart
headers['Content-Length'] = pdict['CONTENT-LENGTH']
KeyError: 'CONTENT-LENGTH'

I looked into the source code of CPython, and found CONTENT-LENGTH in nowhere 
but cgi.py and test_cgi.py. I guess it has the same meaning as the 
Content-Length header in HTTP or CONTENT_LENGTH environment variable in CGI? It 
would be great to document such a backward-incompatible behavior.

Environment: Arch Linux with Python 3.6.6 from [extra] repo and 3.7.0 from 
[staging] repo.

CC the author and the reviewer of issue29979, where relevant codes are 
introduced.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 322362
nosy: docs@python, orsenthil, quentel, yan12125
priority: normal
severity: normal
status: open
title: cgi.parse_multipart() requires undocumented CONTENT-LENGTH in Python 3.7
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



[issue34225] distutils._msvccompiler should trim INCLUDE/LIB directories

2018-07-25 Thread Steve Dower


New submission from Steve Dower :

_msvccompiler reads the INCLUDE and LIB environment variables when building and 
adds each directory to the command line. However, if any of these end with 
os.sep (specifically, '\'), then it will escape the quoting and break the 
entire command.

We should rstrip(os.sep) on each item from this list.

--
assignee: steve.dower
components: Distutils, Windows
messages: 322361
nosy: dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: distutils._msvccompiler should trim INCLUDE/LIB directories
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue34220] Serialization of email message without header line length limit and a non-ASCII subject fails with TypeError

2018-07-25 Thread Grigory Statsenko

New submission from Grigory Statsenko :

I have the following code that creates a simple email message with a) a 
pure-ASCII subject, b) non-ASCII subject
(I made it into a unittest):


import email.generator
import email.policy
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from unittest import TestCase


def create_message(subject, sender, recipients, body):
msg = MIMEMultipart()
msg.set_charset('utf-8')
msg.policy = email.policy.SMTP
msg.attach(MIMEText(body, 'html'))
msg['Subject'] = subject
msg['From'] = sender
msg['To'] = ';'.join(recipients)
return msg

class TestEmailMessage(TestCase):
def _make_message(self, subject):
return create_message(
subject=subject, sender='m...@site.com',
recipients=['m...@site.com'], body='Some text',
)

def test_ascii_message_no_len_limit(self):
# very long subject consisting of a single word
subject = 'Q' * 100
msg = self._make_message(subject)
self.assertTrue(str(msg))

def test_non_ascii_message_no_len_limit(self):
# very long subject consisting of a single word
subject = 'Ц' * 100
msg = self._make_message(subject)
self.assertTrue(str(msg))


The ASCII one passes, while the non-ASCII version fails with the following 
exception:

Traceback (most recent call last):
  File "/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/unittest/case.py", 
line 59, in testPartExecutor
yield
  File "/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/unittest/case.py", 
line 605, in run
testMethod()
  File "/home/grigory/PycharmProjects/smtptest/test_message.py", line 36, in 
test_non_ascii_message_no_len_limit
self.assertTrue(str(msg))
  File "/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/email/message.py", 
line 135, in __str__
return self.as_string()
  File "/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/email/message.py", 
line 158, in as_string
g.flatten(self, unixfrom=unixfrom)
  File "/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/email/generator.py", 
line 116, in flatten
self._write(msg)
  File "/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/email/generator.py", 
line 195, in _write
self._write_headers(msg)
  File "/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/email/generator.py", 
line 222, in _write_headers
self.write(self.policy.fold(h, v))
  File "/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/email/policy.py", 
line 183, in fold
return self._fold(name, value, refold_binary=True)
  File "/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/email/policy.py", 
line 205, in _fold
return value.fold(policy=self)
  File 
"/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/email/headerregistry.py", 
line 258, in fold
return header.fold(policy=policy)
  File 
"/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/email/_header_value_parser.py",
 line 144, in fold
return _refold_parse_tree(self, policy=policy)
  File 
"/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/email/_header_value_parser.py",
 line 2645, in _refold_parse_tree
part.ew_combine_allowed, charset)
  File 
"/home/grigory/.pyenv/versions/3.6.4/lib/python3.6/email/_header_value_parser.py",
 line 2722, in _fold_as_ew
first_part = to_encode[:text_space]
TypeError: slice indices must be integers or None or have an __index__ method


The problem is that _fold_as_ew treats maxlen as an integer, but it can also 
have inf and None as valid values. In my case it's inf, but None can also get 
there if the HTTP email policy is used and its max_line_length value is not 
overridden when serializing.
I am supposing that the correct behavior in both of these cases should be no 
wrapping at all. And/or maybe one of these (inf & None) should be converted to 
the other at some point, so only one special case has to handled in the 
low-level code

This behavior is new in Python 3.6. It works in 3.5.
Also fails in 3.7 and 3.8

--
components: email
messages: 322348
nosy: altvod, barry, r.david.murray
priority: normal
severity: normal
status: open
title: Serialization of email message without header line length limit and a 
non-ASCII subject fails with TypeError
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33524] non-ascii characters in headers causes TypeError on email.policy.Policy.fold

2018-07-25 Thread R. David Murray


Change by R. David Murray :


--
nosy: +altvod
versions: +Python 3.7, Python 3.8 -Python 3.6

___
Python tracker 

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



[issue34227] Weighted random.sample() (weighted sampling without replacement)

2018-07-25 Thread Piotr Jurkiewicz


Change by Piotr Jurkiewicz :


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

___
Python tracker 

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



[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-25 Thread Tim Golden


Tim Golden  added the comment:


New changeset ff64add8d4be2e37c552ba702f629b0b6639cd33 by Tim Golden in branch 
'master':
bpo-34195: Fix case-sensitive comparison in test_nt_helpers (GH-8448)
https://github.com/python/cpython/commit/ff64add8d4be2e37c552ba702f629b0b6639cd33


--

___
Python tracker 

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



[issue34220] Serialization of email message without header line length limit and a non-ASCII subject fails with TypeError

2018-07-25 Thread R. David Murray


R. David Murray  added the comment:

Thanks for the report.  This is a duplicate of #33524.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> non-ascii characters in headers causes TypeError on 
email.policy.Policy.fold

___
Python tracker 

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



[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2018-07-25 Thread Tal Einat


Tal Einat  added the comment:

Ivan, can you supply a PR or would you like someone else to do so?

--
nosy: +taleinat

___
Python tracker 

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



[issue34227] Weighted random.sample() (weighted sampling without replacement)

2018-07-25 Thread Piotr Jurkiewicz


New submission from Piotr Jurkiewicz :

Function random.choices(), which appeared in Python 3.6, allows to perform 
weighted random sampling with replacement. Function random.sample() performs 
random sampling without replacement, but cannot do it weighted.

I propose to enhance random.sample() to perform weighted sampling. That way all 
four possibilities will be supported:

- non-weighted sampling with replacement: random.choices(..., weights=None) 
(exists)

- weighted sampling with replacement: random.choices(..., weights=weights) 
(exists)

- non-weighted sampling without replacement: random.sample(..., weights=None) 
(exists)

- weighted sampling without replacement: random.sample(..., weights=weights) 
(NEW)

Rationale:

Weighted sampling without replacement is a popular problem. There are lot of 
questions on StackOverflow and similar sites how to implement it. 
Unfortunately, many proposed solutions are wrong, for example:

https://stackoverflow.com/a/353510/2178047
https://softwareengineering.stackexchange.com/a/233552/161807

or have excessive computational complexity (e.g. quadratic). There are lot of 
suggestions to use numpy.random.choice() to do that, which supports all four 
possibilities with a single function:

numpy.random.choice(a, size=None, replace=True, p=None)

But of course this is an overkill to install numpy just to do that.

I think that this should be possible with stdlib, without the need to implement 
it by yourself or to install numpy. Especially, that it can be implemented in 2 
lines (plus 4 lines of error checking), as you can see in the PR.

--
components: Library (Lib)
messages: 322367
nosy: piotrjurkiewicz
priority: normal
severity: normal
status: open
title: Weighted random.sample() (weighted sampling without replacement)
type: enhancement

___
Python tracker 

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



[issue33193] Cannot create a venv on Windows when directory path contains dollar character

2018-07-25 Thread Anton Patrushev


Anton Patrushev  added the comment:

The same problem is reproducible with different but obvious way on Python 2.7.

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



[issue34228] Allow PYTHONTRACEMALLOC=0 and -X tracemalloc=0 to disable explicitly tracemalloc

2018-07-25 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue13041] argparse: terminal width is not detected properly

2018-07-25 Thread Berker Peksag


Change by Berker Peksag :


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

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-25 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-34228 "Allow PYTHONTRACEMALLOC=0 and -X tracemalloc=0 to disable 
explicitly tracemalloc" that I need to write unit tests on Python 
initiallization.

--

___
Python tracker 

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



[issue34223] PYTHONDUMPREFS=1 ./python -c pass does crash

2018-07-25 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Python 3.4 seems fine

➜  cpython git:(57b85d3) ./python
Python 3.4.9rc1+ (default, Jul 25 2018, 14:39:07)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

➜  cpython git:(57b85d3) time PYTHONDUMPREFS=1 ./python -c pass
(...)
0x7fbe97f52110 [57] str
0x7fbe97f520a8 [57] str
0x7fbe97f52040 [39] str
0x7fbe97f50350 [23] str
0x7fbe97f502e0 [48] str
0x7fbe97f50270 [143] str
0x7fbe97f50200 [24] str
0x7fbe97f50190 [24] str
0x7fbe97f50120 [8] str
0x7fbe97f500c8 [1] dict
0x7fbe97f51040 [138] str
0x7fbe97f50058 [1] dict
0x7fbe97f4f058 [154] tuple
0x86c6e0 [381] type
0x86cb00 [31] type
PYTHONDUMPREFS=1 ./python -c pass  0.08s user 0.08s system 45% cpu 0.342 total


Thanks

--

___
Python tracker 

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



[issue29097] [Windows] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2018-07-25 Thread Alexander Belopolsky


Alexander Belopolsky  added the comment:


New changeset 973649342cee3869409f341ff0f0e3d2b1547c2a by Alexander Belopolsky 
(Miss Islington (bot)) in branch '3.7':
bpo-29097: Forego fold detection on windows for low timestamp values (GH-2385) 
(GH-8466)
https://github.com/python/cpython/commit/973649342cee3869409f341ff0f0e3d2b1547c2a


--

___
Python tracker 

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



[issue33121] recv returning 0 on closed connection not documented

2018-07-25 Thread Tal Einat


Tal Einat  added the comment:

My guess would be the docs for socket.recv()[1], which indeed don't mention 
what the return value is after a socket has been closed, nor can I find that 
info elsewhere on that page.

Those docs for socket generally avoid going into detail, including specifically 
regarding returned values.  Apparently the approach is that this general note 
about the class explains where to look for more info:

"Socket objects have the following methods. Except for makefile(), these 
correspond to Unix system calls applicable to sockets."

Given this, I don't think adding this one small detail would be in line with 
the existing approach to documenting the socket class.


..[1]: https://docs.python.org/3/library/socket.html#socket.socket.recv

--
nosy: +taleinat

___
Python tracker 

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



[issue29097] [Windows] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2018-07-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7990

___
Python tracker 

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



[issue29097] [Windows] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6

2018-07-25 Thread Alexander Belopolsky


Alexander Belopolsky  added the comment:


New changeset 96d1e69a12ed8ab80203277e1abdaf573457a964 by Alexander Belopolsky 
(Ammar Askar) in branch 'master':
bpo-29097: Forego fold detection on windows for low timestamp values (GH-2385)
https://github.com/python/cpython/commit/96d1e69a12ed8ab80203277e1abdaf573457a964


--

___
Python tracker 

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



[issue34228] Allow PYTHONTRACEMALLOC=0 and -X tracemalloc=0 to disable explicitly tracemalloc

2018-07-25 Thread STINNER Victor


New submission from STINNER Victor :

Currently, -X tracemalloc=0 command line option is reject as an invalid value. 
I would like to allow to explicitly disable tracemalloc. That's useful to 
ignore the PYTHONTRACEMALLOC environment variable:

"PYTHONTRACEMALLOC=1 python3 -X tracemalloc=0" would not enable tracemalloc at 
startup.

--
components: Library (Lib)
messages: 322369
nosy: vstinner
priority: normal
severity: normal
status: open
title: Allow PYTHONTRACEMALLOC=0 and -X tracemalloc=0 to disable explicitly 
tracemalloc
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



[issue34223] PYTHONDUMPREFS=1 ./python -c pass does crash

2018-07-25 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Can reproduce this on Python 3.5 and 3.6 too

# Python 3.5

➜  cpython git:(f497e74) $ ./python
Python 3.5.6rc1+ (remotes/upstream/3.5:f497e74, Jul 25 2018, 14:32:33)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
➜  cpython git:(f497e74) $ PYTHONDUMPREFS=1 ./python -c pass
(...)
0x7f9bac534478 [1] 'Thread-local data'
0x7f9bac538d78 [1] (, )
0x7f9bac5343a0 [1] 
0x7f9bac53d358 [1] 
0x7f9bac53d2d8 [1] 
0x7f9bac53d258 [1] 
0x7f9bac541288 [1] {'__getattribute__': , '__delattr__': , '__new__': , '__setattr__': , '__doc__': 'Thread-local data'}
0x7f9bac53b398 [1] (,)
0x8b1a00 [6] 
0x7f9bac53d1d8 [1] 
0x7f9bac537270 [1] 9116576
0x7f9bac534400 [1] 'Thread-local dummy'
0x7f9bac538c28 [1] (, )
0x7f9bac541218 [1] {'__doc__': 'Thread-local dummy'}
0x7f9bac53b330 [1] (,)
0x8b1ba0 [2] 
0x7f9bac598ef8 [1] [1]15208 segmentation fault (core dumped)  
PYTHONDUMPREFS=1 ./python -c pass

# Python 3.6


cpython git:(a096cc6) $ ./python
Python 3.6.6+ (remotes/upstream/3.6:a096cc6, Jul 25 2018, 14:28:43)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

➜  cpython git:(a096cc6) $ PYTHONDUMPREFS=1 ./python -c pass
0x7fab5a968758 [1] 
0x7fab5a965310 [1] 9142112
0x7fab5a962568 [1] 'Thread-local dummy'
0x7fab5a960c28 [1] (, )
0x7fab5a962508 [1] {'__doc__': 'Thread-local dummy'}
0x7fab5a95f128 [1] (,)
0x8b7f60 [2] 
0x7fab5a9622b0 [1] {'__name__': None, '__doc__': None, '__package__': None, 
'__loader__': None, '__spec__': None, 'warn': None, 'warn_explicit': None, 
'_filters_mutated': None, 'filters': None, '_onceregistry': None, 
'_defaultaction': None}
0x7fab5a9686d8 [1]
0x7fab5a966740 [1] '_warnings'
0x7fab5a9497a8 [1] [1]2975 segmentation fault (core dumped)  
PYTHONDUMPREFS=1 ./python -c pass



Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue34195] test_nt_helpers fails with case difference in drive letter

2018-07-25 Thread Tim Golden


Tim Golden  added the comment:

Test fixed to ignore case and volume differences between paths

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



[issue12458] Tracebacks should contain the first line of continuation lines

2018-07-25 Thread Doug


Change by Doug :


--
nosy: +beck

___
Python tracker 

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



[issue32663] SMTPUTF8SimTests are not actually being run

2018-07-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7995

___
Python tracker 

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



[issue34225] distutils._msvccompiler should trim INCLUDE/LIB directories

2018-07-25 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue33092] The bytecode for f-string formatting is inefficient.

2018-07-25 Thread Tal Einat


Change by Tal Einat :


--
nosy:  -taleinat

___
Python tracker 

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



[issue33092] The bytecode for f-string formatting is inefficient.

2018-07-25 Thread Tal Einat


Tal Einat  added the comment:

Mark, since you have a working version of this, perhaps you can supply some 
performance benchmark results to help in making a decision?

--
nosy: +taleinat

___
Python tracker 

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



[issue34224] python 3.7 inside venv tries to write back to read-only installation directory (Grammar3.7.0.final.0.pickle)

2018-07-25 Thread Andreas Jung


New submission from Andreas Jung :

I installed Python 3.7.0 from source inside /opt/python-3.7.0 (make install as 
root).

Then I created a virtual environment for a package and tried to develop the 
package.
Python 3.7.0 tries to create a file

/opt/python-3.7.0/lib/python3.7/lib2to3/Grammar3.7.0.final.0.pickle

which fails obviously because the installation directory is owned by root and 
is not writable for an normal user account

(my-3.7) ajung@dev ~/src/zopyx.txng3.ext (master) $ 
/opt/python-3.7.0/bin/python3 -m venv .

(my-3.7) ajung@dev ~/src/zopyx.txng3.ext (master) $ bin/python
Python 3.7.0 (default, Jul 25 2018, 16:08:13) 
[GCC 7.3.1 20180130 (Red Hat 7.3.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 


(my-3.7) ajung@dev ~/src/zopyx.txng3.ext (master) $ bin/python setup.py develop
running develop
running egg_info
writing zopyx.txng3.ext.egg-info/PKG-INFO
writing dependency_links to zopyx.txng3.ext.egg-info/dependency_links.txt
writing namespace_packages to zopyx.txng3.ext.egg-info/namespace_packages.txt
writing requirements to zopyx.txng3.ext.egg-info/requires.txt
writing top-level names to zopyx.txng3.ext.egg-info/top_level.txt
error: [Errno 13] Permission denied: 
'/opt/python-3.7.0/lib/python3.7/lib2to3/Grammar3.7.0.final.0.pickle'

--
title: python 3.7 inside venv tries to write back to installation directory -> 
python 3.7 inside venv tries to write back to read-only installation directory 
(Grammar3.7.0.final.0.pickle)
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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-25 Thread STINNER Victor


STINNER Victor  added the comment:

TODO list, open questions:

* Should isolated=1 always imply config->ignore_environment=1 and 
config->user_site_directory = 0?
* Should we rename debug to parser_debug? "debug" is a very generic term, 
whereas this flag is really specific to the parser
* Remove _Py_CheckHashBasedPycsMode: replace it with 
config._check_hash_pycs_mode?

--

___
Python tracker 

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



[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-07-25 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the PR, Aaron!

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

___
Python tracker 

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



[issue33193] Cannot create a venv on Windows when directory path contains dollar character

2018-07-25 Thread Anton Patrushev


Anton Patrushev  added the comment:

I found when this "feature" was implemented:
gitff2d9b71547d95566416fa968872910ca9c4adb1

Part of commit message:
```
in command-line options, and in two phases at that: first, we expand
'install_base' and 'install_platbase', and then the other 'install_*'
options.  This lets us do tricky stuff like
install --prefix='/tmp$sys_prefix'
...oooh, neat.
```

So this was intentional change in distutils.

The only suggestion I have to fix this issue without break something in the 
wild is to suppress exception in Lib/distutils/util.py:189 and leave variable 
without available substitutions as it is. To be on safe side this can be even 
optional and disabled by default.

I am newcomer so some guidance will be helpful.

--
nosy: +Anton Patrushev

___
Python tracker 

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



[issue34220] Serialization of email message without header line length limit and a non-ASCII subject fails with TypeError

2018-07-25 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

I took all the commits made to Lib/email from 3.5 to latest of 3.6 branch with 
`git log --oneline --format="%h" upstream/3.5..upstream/3.6 Lib/email > 
commits.txt`

I could see the test fails with a87ba60 and passes with d94ef8f. Probably 
something to do with a87ba60fe56ae2ebe80ab9ada6d280a6a1f3d552 that had a 
rewrite the email header folding algorithm as I can see from the issue 
https://bugs.python.org/issue27240

cpython git:(master) ✗ ./python
Python 3.8.0a0 (heads/bpo34193-dirty:bfdde5a, Jul 25 2018, 07:51:50)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

# commit a87ba60

cpython git:(master) $ git checkout a87ba60 Lib/email && ./python -m unittest 
bpo34220.py && git reset --quiet HEAD . && git checkout .
.E
==
ERROR: test_non_ascii_message_no_len_limit (bpo34220.TestEmailMessage)
--
Traceback (most recent call last):
  File "/home/cpython/bpo34220.py", line 35, in 
test_non_ascii_message_no_len_limit
self.assertTrue(str(msg))
  File "/home/cpython/Lib/email/message.py", line 135, in __str__
return self.as_string()
  File "/home/cpython/Lib/email/message.py", line 158, in as_string
g.flatten(self, unixfrom=unixfrom)
  File "/home/cpython/Lib/email/generator.py", line 116, in flatten
self._write(msg)
  File "/home/cpython/Lib/email/generator.py", line 195, in _write
self._write_headers(msg)
  File "/home/cpython/Lib/email/generator.py", line 222, in _write_headers
self.write(self.policy.fold(h, v))
  File "/home/cpython/Lib/email/policy.py", line 183, in fold
return self._fold(name, value, refold_binary=True)
  File "/home/cpython/Lib/email/policy.py", line 205, in _fold
return value.fold(policy=self)
  File "/home/cpython/Lib/email/headerregistry.py", line 258, in fold
return header.fold(policy=policy)
  File "/home/cpython/Lib/email/_header_value_parser.py", line 144, in fold
return _refold_parse_tree(self, policy=policy)
  File "/home/cpython/Lib/email/_header_value_parser.py", line 2645, in 
_refold_parse_tree
part.ew_combine_allowed, charset)
  File "/home/cpython/Lib/email/_header_value_parser.py", line 2722, in 
_fold_as_ew
first_part = to_encode[:text_space]
TypeError: slice indices must be integers or None or have an __index__ method

--
Ran 2 tests in 0.022s

FAILED (errors=1)

# commit d94ef8f
  
cpython git:(master) $ git checkout d94ef8f Lib/email && ./python -m unittest 
bpo34220.py && git reset --quiet HEAD . && git checkout .
..
--
Ran 2 tests in 0.017s

OK


Hope I am correct on the above approach and there are no C code related changes 
that need to be made to recompile Python.

Thanks

--

___
Python tracker 

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



[issue34224] python 3.7 inside venv tries to write back to installation directory

2018-07-25 Thread Andreas Jung


Change by Andreas Jung :


--
components: Installation
nosy: ajung
priority: normal
severity: normal
status: open
title: python 3.7 inside venv tries to write back to installation directory

___
Python tracker 

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



[issue32663] SMTPUTF8SimTests are not actually being run

2018-07-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7994

___
Python tracker 

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



[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-07-25 Thread Tal Einat


Tal Einat  added the comment:


New changeset c0f0a7669c73c0d444851dd4c5299de2479214cc by Tal Einat (Aaron Ang) 
in branch 'master':
bpo-28677: Improve phrasing of when instance attribute is referenced (GH-6208)
https://github.com/python/cpython/commit/c0f0a7669c73c0d444851dd4c5299de2479214cc


--
nosy: +taleinat

___
Python tracker 

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



[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-07-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7986

___
Python tracker 

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



[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-07-25 Thread Tal Einat


Tal Einat  added the comment:


New changeset ec02c58f5a6fdb06b769f53255fcb5d393812160 by Tal Einat (Miss 
Islington (bot)) in branch '3.7':
bpo-28677: Improve phrasing of when instance attribute is referenced (GH-6208)
https://github.com/python/cpython/commit/ec02c58f5a6fdb06b769f53255fcb5d393812160


--

___
Python tracker 

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



[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-07-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7985

___
Python tracker 

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



[issue32663] SMTPUTF8SimTests are not actually being run

2018-07-25 Thread R. David Murray


R. David Murray  added the comment:


New changeset 48ed88a93bb0bbeaae9a4cfaa533e4edf13bcb51 by R. David Murray 
(chason) in branch 'master':
bpo-32663 Make SMTPUTF8SimTests run (#5314)
https://github.com/python/cpython/commit/48ed88a93bb0bbeaae9a4cfaa533e4edf13bcb51


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



[issue34218] test_xml_etree_c leaked [68, 68, 74] references, sum=210

2018-07-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue33102] get the nth folder of a given path

2018-07-25 Thread Tal Einat


Tal Einat  added the comment:

-1 on adding this to os.path given the existence in pathlib.

--
nosy: +taleinat

___
Python tracker 

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



[issue34218] test_xml_etree_c leaked [68, 68, 74] references, sum=210

2018-07-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This test was finished 4 hours before the leak was fixed, and a hour before 
this issue was opened.

--

___
Python tracker 

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



[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-07-25 Thread miss-islington


miss-islington  added the comment:


New changeset cfadd1c2421e13d76d588982147d4fbdc71d5527 by Miss Islington (bot) 
in branch '3.6':
bpo-28677: Improve phrasing of when instance attribute is referenced (GH-6208)
https://github.com/python/cpython/commit/cfadd1c2421e13d76d588982147d4fbdc71d5527


--

___
Python tracker 

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



[issue34218] test_xml_etree_c leaked [68, 68, 74] references, sum=210

2018-07-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ee98e7bbde45fcf24d769353e29337d5ccdbaac5 by Serhiy Storchaka in 
branch 'master':
bpo-34218: Fix a leak in _elementtree.c introduced in GH-6769. (GH-8460)
https://github.com/python/cpython/commit/ee98e7bbde45fcf24d769353e29337d5ccdbaac5


--

___
Python tracker 

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



[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-07-25 Thread miss-islington


miss-islington  added the comment:


New changeset 1c8f6553ad5a7f97495972da8f35f4dabcb372d4 by Miss Islington (bot) 
in branch '2.7':
bpo-28677: Improve phrasing of when instance attribute is referenced (GH-6208)
https://github.com/python/cpython/commit/1c8f6553ad5a7f97495972da8f35f4dabcb372d4


--
nosy: +miss-islington

___
Python tracker 

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



[issue13041] argparse: terminal width is not detected properly

2018-07-25 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 74102c9a5f2327c4fc47feefa072854a53551d1f by Berker Peksag in 
branch 'master':
bpo-13041: Use shutil.get_terminal_size() in argparse.HelpFormatter (GH-8459)
https://github.com/python/cpython/commit/74102c9a5f2327c4fc47feefa072854a53551d1f


--

___
Python tracker 

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



[issue34222] Email message serialization enters an infinite loop when folding non-ASCII headers with long words

2018-07-25 Thread Grigory Statsenko

New submission from Grigory Statsenko :

(Discovered together with https://bugs.python.org/msg322348)

Email message serialization (in function _fold_as_ew) enters an infinite loop 
when folding non-ASCII headers whose words (after encoding) are longer than the 
given maxlen.

Besides being stuck in an infinite loop, it keeps appending to the `lines` 
list, so its memory usage keeps on growing also infinitely.
The code keeps appending encoded empty strings to the list like this:

lines: [
'Subject: =?utf-8?q??=',
' =?utf-8?q??=',
' =?utf-8?q??=',
' =?utf-8?q??=',
' =?utf-8?q??=',
' =?utf-8?q??=',
' '
]
(and it keeps on growing)

Here is my code that can reproduce this issue (as a unittest):


import email.generator
import email.policy
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from unittest import TestCase


def create_message(subject, sender, recipients, body):
msg = MIMEMultipart()
msg.set_charset('utf-8')
msg.policy = email.policy.SMTP
msg.attach(MIMEText(body, 'html'))
msg['Subject'] = subject
msg['From'] = sender
msg['To'] = ';'.join(recipients)
return msg


class TestEmailMessage(TestCase):
def _make_message(self, subject):
return create_message(
subject=subject, sender='m...@site.com',
recipients=['m...@site.com'], body='Some text',
)

def test_ascii_message_with_len_limit(self):
# very long subject consisting of a single word
subject = 'Q' * 100
msg = self._make_message(subject)
self.assertTrue(msg.as_string(maxheaderlen=76))

def test_non_ascii_message_with_len_limit(self):
# very long subject consisting of a single word
subject = 'Ц' * 100
msg = self._make_message(subject)
self.assertTrue(msg.as_string(maxheaderlen=76))


The ASCII test passes, but the non-ASCII one never finishes.

>From what I can tell, the problem is in line 2728 of 
>email/_header_value_parser.py:

first_part = first_part[:-excess]

where `excess` is calculated from the encoded string
(which is several times longer than the original one),
but it truncates the original (non-encoded string).
The problem arises when `excess` is actually greater than `first_part`
So, it attempts to encode the exact same part of the header and fails in every 
iteration,
instead appending an empty string to the list and encoding it as ' =?utf-8?q??='

What this amounts to is that it's now practically impossible to send emails 
with non-ACSII subjects without either disregarding the RFC recommendations and 
requirements for line length or risking hangs and memory leaks.

Just like in https://bugs.python.org/msg322348, this behavior is new in Python 
3.6. Also does not work in 3.7 and 3.8

--
components: email
messages: 322351
nosy: altvod, barry, r.david.murray
priority: normal
severity: normal
status: open
title: Email message serialization enters an infinite loop when folding 
non-ASCII headers with long words
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue34227] Weighted random.sample() (weighted sampling without replacement)

2018-07-25 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal

___
Python tracker 

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



[issue33102] get the nth folder of a given path

2018-07-25 Thread Tal Einat


Tal Einat  added the comment:

I'm closing this as "wontfix".

Amjad, if you'd like to discuss this further, please bring it up on 
python-ideas.

Serhiy, as the expert for the os.path module, FYI.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29842] Make Executor.map work with infinite/large inputs correctly

2018-07-25 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

In any event, sorry to be a pain, but is there any way to get some movement on 
this issue? One person reviewed the code with no significant concerns to 
address. There have been a duplicate (#30323) and closely related (#34168) 
issues opened that this would address; I'd really like to see Executor.map made 
more bulletproof against cases that plain map handles with equanimity.

Even if it's not applied as is, something similar (with prefetch count defaults 
tweaked, or, at the expense of code complexity, a separate worker thread to 
perform the prefetch to address Max's concerns) would be a vast improvement 
over the status quo.

--

___
Python tracker 

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



[issue34218] test_xml_etree_c leaked [68, 68, 74] references, sum=210

2018-07-25 Thread STINNER Victor


STINNER Victor  added the comment:

Is this issue really fixed? 
https://buildbot.python.org/all/#builders/1/builds/295 still detects leaks.

--
nosy: +vstinner

___
Python tracker 

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



[issue34220] Serialization of email message without header line length limit and a non-ASCII subject fails with TypeError

2018-07-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34224] python 3.7 inside venv tries to write back to read-only installation directory (Grammar3.7.0.final.0.pickle)

2018-07-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Seems related : https://bugs.python.org/issue15317

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue33102] get the nth folder of a given path

2018-07-25 Thread Tal Einat


Change by Tal Einat :


--
resolution:  -> wont fix
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



[issue34168] RAM consumption too high using concurrent.futures (Python 3.7 / 3.6 )

2018-07-25 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Note: While this particular use case wouldn't be fixed (map returns in order, 
not as completed), applying the fix from #29842 would make many similar use 
cases both simpler to implement and more efficient/possible.

That said, no action has been taken on #29842 (no objections, but no action 
either), so I'm not sure what to do to push it to completion.

--
nosy: +josh.r

___
Python tracker 

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



[issue34218] test_xml_etree_c leaked [68, 68, 74] references, sum=210

2018-07-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34218] test_xml_etree_c leaked [68, 68, 74] references, sum=210

2018-07-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Looks like a regression introduced in issue29209 
(02ec92fa7b1dddc23d479ee0b87dc283793505a8).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2018-07-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue13041] argparse: terminal width is not detected properly

2018-07-25 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests: +7983

___
Python tracker 

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



[issue34219] distutils: build_ext -D wrongly assume defining a symbol with no value

2018-07-25 Thread monson


Change by monson :


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

___
Python tracker 

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



[issue34219] distutils: build_ext -D wrongly assume defining a symbol with no value

2018-07-25 Thread monson


New submission from monson :

`python setup.py build_ext -D zero,one=v1,two=k2=v2` will generate preprocessor 
argument `-D zero=1 -D one=v1=1 -D two=k2=v2=1`.
Expect `-D zero=1 -D one=v1 -D two=k2=v2`.

--
components: Library (Lib)
messages: 322344
nosy: monson
priority: normal
severity: normal
status: open
title: distutils: build_ext -D wrongly assume defining a symbol with no value
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue34218] test_xml_etree_c leaked [68, 68, 74] references, sum=210

2018-07-25 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Builder x86 Gentoo Refleaks 3.x reports that test_xml_etree_c is potentially 
leaking references and blocks:

https://buildbot.python.org/all/#builders/1/builds/295

--
Ran 148 tests in 0.487s
OK
.
test_xml_etree_c leaked [68, 68, 74] references, sum=210
test_xml_etree_c leaked [51, 52, 52] memory blocks, sum=155
1 test failed again:
test_xml_etree_c
== Tests result: FAILURE then FAILURE ==

--
components: Tests
messages: 322343
nosy: pablogsal
priority: normal
severity: normal
status: open
title: test_xml_etree_c leaked [68, 68, 74] references, sum=210
type: behavior
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



[issue12743] C API marshalling doc contains XXX

2018-07-25 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests: +7981

___
Python tracker 

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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2018-07-25 Thread Michael Felt


Michael Felt  added the comment:

@pitrou: re: Is nohup required in the example you just posted or is that a red 
herring?

I just use nohup to merge stdout and stderr when grepping for messages - and 
to, ideally, have the stdout and stderr messages properly synced in the output 
stream. So, I hope "red herring" :)

My apologies for the belated reply.

--

___
Python tracker 

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



[issue34194] test_ssl, AIX, and defaults for _ssl connections

2018-07-25 Thread Michael Felt


Michael Felt  added the comment:

update: went back to check what worked, did not work without the environment 
variable set.

I am going to guess that pip(3) is able to make use of the environment variable 
SSL_CERT_FILE as pip download fails (in some cases) without it, but succeeds 
with it.

I thought to recall something similar while using git (mine leaning on 
python2-2.7) but I have not had the time to test it again (using git fetch and 
git pull from cpython).

--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d3b191992e0f3c1eb27cb68478b875d60e859976 by Victor Stinner in 
branch 'master':
bpo-34170: Cleanup pymain_run_python() (GH-8455)
https://github.com/python/cpython/commit/d3b191992e0f3c1eb27cb68478b875d60e859976


--

___
Python tracker 

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



[issue34194] test_ssl, AIX, and defaults for _ssl connections

2018-07-25 Thread Michael Felt


Michael Felt  added the comment:

Any comments re: environment variables - even if the answer is None!

--
versions: +Python 2.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



[issue34167] Standard library docs: prev/next skip right over 16.11

2018-07-25 Thread INADA Naoki


Change by INADA Naoki :


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



[issue34192] FunctionType.__new__ can generate functions that immediately crash

2018-07-25 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

The assertion also fails on master. I did some manual git blame work. The 
assertion passes with commit 7324b5ce8e7c031a0a3832a6a8d7c639111ae0ff. It fails 
with the next commit 078f1814f1a4413a2a0fdb8cf4490ee0fc98ef34 
(https://bugs.python.org/issue32176) that has some changes with respect to 
CO_NOFREE. The change was released with 3.7.0a3 as noted in the comment 
(https://bugs.python.org/issue32176#msg307512) and hence the assertion should 
fail on 3.7.0b3 also.

# commit 7324b5c

➜  cpython git:(7324b5c) ✗ ./python
Python 3.7.0a2+ (v3.7.0a2-334-g7324b5c:7324b5c, Jul 25 2018, 06:34:52)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
➜  cpython git:(7324b5c) ✗ ./python bpo34192.py
calling a...
Blow up the universe? y/n : n

# commit 078f181

➜  cpython git:(078f181) ✗ ./python
Python 3.7.0a2+ (v3.7.0a2-335-g078f181:078f181, Jul 25 2018, 06:36:32)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
➜  cpython git:(078f181) ✗ ./python bpo34192.py
Traceback (most recent call last):
  File "bpo34192.py", line 44, in 
assert b.__code__.co_flags == OPTIMIZED|NEWLOCALS|NOFREE
AssertionError


Thanks

--

___
Python tracker 

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