[issue33009] inspect.signature crashes on unbound partialmethods

2018-03-05 Thread Antony Lee

New submission from Antony Lee :

The following example crashes Python 3.6:

from functools import partialmethod
import inspect

class T:
g = partialmethod((lambda self, x: x), 1)

print(T().g())  # Correctly returns 1.
print(T.g(T()))  # Correctly returns 1.
print(inspect.signature(T.g))  # Crashes.

with

  File "/usr/lib/python3.6/inspect.py", line 3036, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "/usr/lib/python3.6/inspect.py", line 2786, in from_callable
follow_wrapper_chains=follow_wrapped)
  File "/usr/lib/python3.6/inspect.py", line 2254, in 
_signature_from_callable
assert first_wrapped_param is not sig_params[0]
IndexError: tuple index out of range

--
components: Library (Lib)
messages: 313309
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: inspect.signature crashes on unbound partialmethods
versions: Python 3.6

___
Python tracker 

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



[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Alexey Izbyshev

Change by Alexey Izbyshev :


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



[issue33008] urllib.request.parse_http_list incorrectly strips backslashes

2018-03-05 Thread W. Trevor King

New submission from W. Trevor King :

Python currently strips backslashes from inside quoted strings:

  $ echo 'a="b\"c",d=e' | python3 -c 'from sys import stdin; from 
urllib.request import parse_http_list; print(parse_http_list(stdin.read()))'
  ['a="b"c"', 'd=e']

It should be printing:

  ['a="b\"c"', 'd=e']

The bug is this continue [1], which should be removed.  This was not a problem 
with the original implementation [2].  It was introduced in [3] as a fix for 
#735248 with explicit tests asserting the broken behavior [3].  Stripping 
backslashes from the insides of quoted strings is not appropriate, because it 
breaks explicit unquoting with email.utils.unquote [4]:

  import email.utils
  import urllib.request
  list = r'"b\\"c"'
  entry = urllib.request.parse_http_list(list)[0]
  entry  # '"b\\"c"', should be '"b"c"'
  email.utils.unquote(entry)  # 'b"c', should be 'b\\"c'

I'm happy to file patches against the various branches if that would help, but 
as a one-line removal (plus adjusting the tests), it might be easier if a 
maintainer files the patches.

[1]: https://github.com/python/cpython/blob/v3.7.0b2/Lib/urllib/request.py#L1420
[2]: 
https://github.com/python/cpython/commit/6d7e47b8ea1b8cf82927dacc364689b8eeb8708b#diff-33f7983ed1a69d290366fe426880581cR777
[3]: 
https://github.com/python/cpython/commit/e1b13d20199f79ffd3407bbb14cc09b1b8fd70d2#diff-230a8abfedeaa9ae447490df08172b15R52
[4]: https://docs.python.org/3.5/library/email.util.html#email.utils.unquote

--
components: Library (Lib)
messages: 313308
nosy: labrat
priority: normal
severity: normal
status: open
title: urllib.request.parse_http_list incorrectly strips backslashes
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32997] Catastrophic backtracking in fpformat

2018-03-05 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 55d5bfba9482d39080f7b9ec3e6257ecd23f264f by Benjamin Peterson 
(Jamie Davis) in branch '2.7':
[2.7] closes bpo-32997: Fix REDOS in fpformat (GH-5984)
https://github.com/python/cpython/commit/55d5bfba9482d39080f7b9ec3e6257ecd23f264f


--
nosy: +benjamin.peterson
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



[issue33007] Objects referencing private-mangled names do not roundtrip properly under pickling.

2018-03-05 Thread Antony Lee

New submission from Antony Lee :

Consider the following example:

import pickle

class T:
def __init__(self):
self.attr = self.__foo

def __foo(self):
pass

print(pickle.loads(pickle.dumps(T(

This fails on 3.6 with `AttributeError: 'T' object has no attribute '__foo'` 
(i.e. there's a lookup on the unmangled name).  As a comparison, replacing 
`__foo` with `_foo` results in working code.

--
components: Library (Lib)
messages: 313306
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: Objects referencing private-mangled names do not roundtrip properly 
under pickling.
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



[issue23159] argparse: Provide equivalent of optparse.OptionParser.{option_groups, option_list, get_option}

2018-03-05 Thread Eric McDonald

Eric McDonald  added the comment:

Yes, this issue could be closed. I think the concept is still valid and perhaps 
worthy of future consideration as it is a means of unifying two different 
configuration processing mechanisms in the standard library without having 
developers reinvent that wheel every time.

I'll close it, though, if having a "stale" issue floating around is bothersome.

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



[issue33005] 3.7.0b2 Interpreter crash in dev mode (or with PYTHONMALLOC=debug) with 'python -X dev -c 'import os; os.fork()'

2018-03-05 Thread Xiang Zhang

Change by Xiang Zhang :


--
nosy: +eric.snow, vstinner, xiang.zhang

___
Python tracker 

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



[issue33004] Shutil module functions could accept Path-like objects

2018-03-05 Thread Marco Rougeth

Marco Rougeth  added the comment:

You're right @josh.r! Thank you!

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



[issue25197] Allow documentation switcher to change url to /3/ and /dev/

2018-03-05 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Yeah I believe this issue is out of date. Thanks.

--
nosy: +Mariatta
resolution:  -> out of date
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



[issue32969] Add more constants to zlib module

2018-03-05 Thread Xiang Zhang

Change by Xiang Zhang :


--
type: enhancement -> 
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue33006] docstring of filter function is incorrect

2018-03-05 Thread Pierre Thibault

New submission from Pierre Thibault :

> help(filter)

Help on built-in function filter in module __builtin__:

filter(...)
filter(function or None, sequence) -> list, tuple, or string

Return those items of sequence for which function(item) is true.  If
function is None, return the items that are true.  If sequence is a tuple
or string, return the same type, else return a list.
(END)

The second argument can be an iterable. Suggestion: Replace the docstring with 
the definition found at https://docs.python.org/2/library/functions.html#filter.

--
assignee: docs@python
components: Documentation
messages: 313302
nosy: Pierre Thibault, docs@python
priority: normal
severity: normal
status: open
title: docstring of filter function is incorrect
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



[issue32919] csv.reader() to support QUOTE_ALL

2018-03-05 Thread Pavel Shpilev

Pavel Shpilev  added the comment:

I know that CSV specification says empty field and empty string are the same, 
however, I still believe there is practical use for unconventional processing 
of such fields.

In our specific case we parse CSVs produced by Amazon Athena (based on Presto) 
in which NULL and empty string values represented as above. Following CSV specs 
dogmatically, there's no way to distinguish between the two, but pragmatically 
you can tell them apart by simply looking at values.

Brief search shows we aren't the only ones facing the issue. After giving it 
some more thought, I'd agree that csv.QUOTE_ALL doesn't make much sense here, 
but may be an extra argument to csv.reader() will do the trick? Something like 
csv.reader(detect_none_values=False/True), with False being default, and 
emphasis in the documentation that True goes against CSV specification.

--

___
Python tracker 

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



[issue33004] Shutil module functions could accept Path-like objects

2018-03-05 Thread Josh Rosenberg

Josh Rosenberg  added the comment:

I think this falls under the umbrella of #30235, which posits that Path-like 
objects should be supported by shutil (and includes notes on doc validation).

--
nosy: +josh.r

___
Python tracker 

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



[issue28788] ConfigParser should be able to write config to a given filename, not only into file object

2018-03-05 Thread Roundup Robot

Change by Roundup Robot :


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

___
Python tracker 

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



[issue31226] shutil.rmtree fails when target has an internal directory junction (Windows)

2018-03-05 Thread Vidar Fauske via Python-bugs-list

Change by Vidar Fauske :


--
keywords: +patch
pull_requests: +5764
stage: test needed -> patch review

___
Python tracker 

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



[issue32991] AttributeError in doctest.DocTestFinder.find

2018-03-05 Thread Jason R. Coombs

Jason R. Coombs  added the comment:


New changeset b9650a04a81355c8a7dcd0464c28febfb4bfc0a9 by Jason R. Coombs in 
branch 'master':
bpo-32991: Restore expectation that inspect.getfile raises TypeError on 
namespace package (GH-5980)
https://github.com/python/cpython/commit/b9650a04a81355c8a7dcd0464c28febfb4bfc0a9


--

___
Python tracker 

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



[issue32991] AttributeError in doctest.DocTestFinder.find

2018-03-05 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5763

___
Python tracker 

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread miss-islington

miss-islington  added the comment:


New changeset 96fdbacb7797a564249fd59ccf86ec153c4bb095 by Miss Islington (bot) 
in branch '3.7':
bpo-33001: Prevent buffer overrun in os.symlink (GH-5989)
https://github.com/python/cpython/commit/96fdbacb7797a564249fd59ccf86ec153c4bb095


--
nosy: +miss-islington

___
Python tracker 

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



[issue33005] 3.7.0b2 Interpreter crash in dev mode (or with PYTHONMALLOC=debug) with 'python -X dev -c 'import os; os.fork()'

2018-03-05 Thread Jason Madden

Jason Madden  added the comment:

I built a local version of master (6821e73) and was able to get some line 
numbers (they're off by one for some reason, it appears):

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib  0x7fff78972e3e __pthread_kill + 10
1   libsystem_pthread.dylib 0x7fff78ab1150 pthread_kill + 333
2   libsystem_c.dylib   0x7fff788cf312 abort + 127
3   libsystem_malloc.dylib  0x7fff789cc866 free + 521
4   python.exe  0x000100fba715 _PyRuntimeState_Fini 
+ 37 (pystate.c:90)
5   python.exe  0x000100fb9d73 Py_FinalizeEx + 547 
(pylifecycle.c:1231)
6   python.exe  0x000100fddd80 pymain_main + 5808 
(main.c:2664)
7   python.exe  0x000100fdec82 _Py_UnixMain + 178 
(main.c:2697)
8   libdyld.dylib   0x7fff78823115 start + 1

--

___
Python tracker 

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



[issue33004] Shutil module functions could accept Path-like objects

2018-03-05 Thread Marco Rougeth

New submission from Marco Rougeth :

This is issue is to suggest an enhancement to the shutil module, I believe it's 
quiet similar to the issue32642.

I was using shutil.copytree to copy some files around and I tried to pass 
Path-like objects as input but got the exception "TypeError: argument should be 
string, bytes or integer, not PosixPath".

e.g.
build_path = BASE_DIR / 'build'
static_path = BASE_DIR / 'static'
shutil.copytree(static_path, build_path)


As said in issue32642, it "wasn't obvious because Path objects appear as 
strings in normal debug output". I had a look at the shutil source code and it 
seems that it wouldn't be to hard to implement. I'd love to do it, if it makes 
sense.

--
components: Library (Lib)
messages: 313295
nosy: rougeth
priority: normal
severity: normal
status: open
title: Shutil module functions could accept Path-like objects
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33005] 3.7.0b2 Interpreter crash in dev mode (or with PYTHONMALLOC=debug) with 'python -X dev -c 'import os; os.fork()'

2018-03-05 Thread Jason Madden

New submission from Jason Madden :

At the request of Victor Stinner on twitter, I ran the gevent test suite with 
Python 3.7.0b2 with the new '-X dev' argument and discovered an interpreter 
crash. With a bit of work, it boiled down to a very simple command:

$ env -i .runtimes/snakepit/python3.7.0b2 -X dev -c 'import os; os.fork()'
*** Error in `.runtimes/snakepit/python3.7.0b2': munmap_chunk(): invalid 
pointer: 0x01c43a80 ***
=== Backtrace: =
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f5a971607e5]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x1a8)[0x7f5a9716d698]
.runtimes/snakepit/python3.7.0b2(_PyRuntimeState_Fini+0x30)[0x515d90]
.runtimes/snakepit/python3.7.0b2[0x51445f]
.runtimes/snakepit/python3.7.0b2[0x42ce40]
.runtimes/snakepit/python3.7.0b2(_Py_UnixMain+0x7b)[0x42eaab]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f5a97109830]
.runtimes/snakepit/python3.7.0b2(_start+0x29)[0x42a0d9]
=== Memory map: 
0040-00689000 r-xp  08:01 177409 
//.runtimes/versions/python3.7.0b2/bin/python3.7
00888000-00889000 r--p 00288000 08:01 177409 
//.runtimes/versions/python3.7.0b2/bin/python3.7
00889000-008f3000 rw-p 00289000 08:01 177409 
//.runtimes/versions/python3.7.0b2/bin/python3.7
008f3000-00914000 rw-p  00:00 0
01b84000-01c64000 rw-p  00:00 0  [heap]
7f5a96052000-7f5a96068000 r-xp  08:01 265946 
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f5a96068000-7f5a96267000 ---p 00016000 08:01 265946 
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f5a96267000-7f5a96268000 rw-p 00015000 08:01 265946 
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f5a96268000-7f5a96273000 r-xp  08:01 268943 
/lib/x86_64-linux-gnu/libnss_files-2.23.so
7f5a96273000-7f5a96472000 ---p b000 08:01 268943 
/lib/x86_64-linux-gnu/libnss_files-2.23.so
7f5a96472000-7f5a96473000 r--p a000 08:01 268943 
/lib/x86_64-linux-gnu/libnss_files-2.23.so
7f5a96473000-7f5a96474000 rw-p b000 08:01 268943 
/lib/x86_64-linux-gnu/libnss_files-2.23.so
7f5a96474000-7f5a9647a000 rw-p  00:00 0
7f5a9647a000-7f5a96485000 r-xp  08:01 268947 
/lib/x86_64-linux-gnu/libnss_nis-2.23.so
7f5a96485000-7f5a96684000 ---p b000 08:01 268947 
/lib/x86_64-linux-gnu/libnss_nis-2.23.so
7f5a96684000-7f5a96685000 r--p a000 08:01 268947 
/lib/x86_64-linux-gnu/libnss_nis-2.23.so
7f5a96685000-7f5a96686000 rw-p b000 08:01 268947 
/lib/x86_64-linux-gnu/libnss_nis-2.23.so
7f5a96686000-7f5a9669c000 r-xp  08:01 268927 
/lib/x86_64-linux-gnu/libnsl-2.23.so
7f5a9669c000-7f5a9689b000 ---p 00016000 08:01 268927 
/lib/x86_64-linux-gnu/libnsl-2.23.so
7f5a9689b000-7f5a9689c000 r--p 00015000 08:01 268927 
/lib/x86_64-linux-gnu/libnsl-2.23.so
7f5a9689c000-7f5a9689d000 rw-p 00016000 08:01 268927 
/lib/x86_64-linux-gnu/libnsl-2.23.so
7f5a9689d000-7f5a9689f000 rw-p  00:00 0
7f5a9689f000-7f5a968a7000 r-xp  08:01 268938 
/lib/x86_64-linux-gnu/libnss_compat-2.23.so
7f5a968a7000-7f5a96aa6000 ---p 8000 08:01 268938 
/lib/x86_64-linux-gnu/libnss_compat-2.23.so
7f5a96aa6000-7f5a96aa7000 r--p 7000 08:01 268938 
/lib/x86_64-linux-gnu/libnss_compat-2.23.so
7f5a96aa7000-7f5a96aa8000 rw-p 8000 08:01 268938 
/lib/x86_64-linux-gnu/libnss_compat-2.23.so
7f5a96acc000-7f5a96b4c000 rw-p  00:00 0
7f5a96b4c000-7f5a96b4e000 r-xp  08:01 184551 
//.runtimes/versions/python3.7.0b2/lib/python3.7/lib-dynload/_heapq.cpython-37m-x86_64-linux-gnu.so
7f5a96b4e000-7f5a96d4e000 ---p 2000 08:01 184551 
//.runtimes/versions/python3.7.0b2/lib/python3.7/lib-dynload/_heapq.cpython-37m-x86_64-linux-gnu.so
7f5a96d4e000-7f5a96d4f000 r--p 2000 08:01 184551 
//.runtimes/versions/python3.7.0b2/lib/python3.7/lib-dynload/_heapq.cpython-37m-x86_64-linux-gnu.so
7f5a96d4f000-7f5a96d51000 rw-p 3000 08:01 184551 
//.runtimes/versions/python3.7.0b2/lib/python3.7/lib-dynload/_heapq.cpython-37m-x86_64-linux-gnu.so
7f5a96d51000-7f5a96e11000 rw-p  00:00 0
7f5a96e11000-7f5a970e9000 r--p  08:01 133586 
/usr/lib/locale/locale-archive
7f5a970e9000-7f5a972a9000 r-xp  08:01 268930 
/lib/x86_64-linux-gnu/libc-2.23.so
7f5a972a9000-7f5a974a9000 ---p 001c 08:01 268930 
/lib/x86_64-linux-gnu/libc-2.23.so
7f5a974a9000-7f5a974ad000 r--p 001c 08:01 268930 
/lib/x86_64-linux-gnu/libc-2.23.so
7f5a974ad000-7f5a974af000 rw-p 001c4000 08:01 2689

[issue33003] urllib: Document parse_http_list

2018-03-05 Thread W. Trevor King

New submission from W. Trevor King :

Python has had a parse_http_list helper since urllib2 landed in 6d7e47b8ea 
(EXPERIMENTAL, 2000-01-20).  With Python3 it was moved into urllib.request, and 
the implementation hasn't changed since (at least as of 4c19b9573, 2018-03-05). 
 External projects depend on the currently undocumented function [1,2], so it 
would be nice to have some user-facing documentation for it.  If that sounds 
appealing, I'm happy to work up a pull request.

[1]: https://github.com/requests/requests/blob/v2.18.4/requests/compat.py#L42
[2]: https://github.com/requests/requests/blob/v2.18.4/requests/compat.py#L58

--
assignee: docs@python
components: Documentation
messages: 313294
nosy: docs@python, labrat
priority: normal
severity: normal
status: open
title: urllib: Document parse_http_list
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread Steve Dower

Steve Dower  added the comment:

Patches are merged, except for the ones that belong to @Larry.

Thanks again Alexey for the final round of feedback!

--
nosy: +larry

___
Python tracker 

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5762

___
Python tracker 

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread Steve Dower

Steve Dower  added the comment:


New changeset baa45079466eda1f5636a6d13f3a60c2c00fdcd3 by Steve Dower in branch 
'3.6':
[3.6] bpo-33001: Prevent buffer overrun in os.symlink (GH-5989) (GH-5990)
https://github.com/python/cpython/commit/baa45079466eda1f5636a6d13f3a60c2c00fdcd3


--

___
Python tracker 

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread Steve Dower

Steve Dower  added the comment:


New changeset 6921e73e33edc3c61bc2d78ed558eaa22a89a564 by Steve Dower in branch 
'master':
bpo-33001: Prevent buffer overrun in os.symlink (GH-5989)
https://github.com/python/cpython/commit/6921e73e33edc3c61bc2d78ed558eaa22a89a564


--

___
Python tracker 

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



[issue29417] Sort entries in foo.dist-info/RECORD

2018-03-05 Thread Éric Araujo

Éric Araujo  added the comment:

Hello!  distutils does not write dist-info directories itself; wheel, 
setuptools and other build tools do that.  Look at https://github.com/pypa to 
find the bug trackers (I forget if wheel is there or on bitbucket)

--
resolution:  -> third party
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



[issue29417] Sort entries in foo.dist-info/RECORD

2018-03-05 Thread Dawei Wang

Dawei Wang  added the comment:

This is important since for aws lambda the package can change every time.

--
nosy: +Dawei Wang

___
Python tracker 

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



[issue33002] Making a class formattable as hex/oct integer with printf-style formatting requires both __int__ and __index__ for no good reason

2018-03-05 Thread Josh Rosenberg

Josh Rosenberg  added the comment:

To be clear, this is a problem with old-style (printf-style) formatting, and 
applies to both bytes formatting and str formatting. So a class like:

class Foo:
def __index__(self):
return 1

will fail with a TypeError should you do any of:

'%o' % Foo()
'%x' % Foo()
'%X' % Foo()
b'%o' % Foo()
b'%x' % Foo()
b'%X' % Foo()

even though hex(Foo()) and oct(Foo()) work without issue.

--
title: Making a class formattable as hex/oct integer requires both __int__ and 
__index__ for no good reason -> Making a class formattable as hex/oct integer 
with printf-style formatting requires both __int__ and __index__ for no good 
reason

___
Python tracker 

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



[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2018-03-05 Thread Josh Rosenberg

Josh Rosenberg  added the comment:

Pingback from #33002, which is caused by the fact that parts of the CPython 
code base that use PyNumber_Index for type conversion still pre-check for valid 
types with PyNumber_Check, meaning that a type with __index__ and not __int__ 
gets erroneously rejected by the pre-check.

--
nosy: +josh.r

___
Python tracker 

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



[issue33002] Making a class formattable as hex/oct integer requires both __int__ and __index__ for no good reason

2018-03-05 Thread Josh Rosenberg

Josh Rosenberg  added the comment:

Note: Obviously, defining __index__ without defining __int__ is a little 
strange (it's *equivalent* to int, but can't be *coerced* to int?), so yet 
another fix would be addressing #20092 so it wouldn't be possible for a type to 
define __index__ without (implicitly) defining __int__.

--

___
Python tracker 

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



[issue33002] Making a class formattable as hex/oct integer requires both __int__ and __index__ for no good reason

2018-03-05 Thread Josh Rosenberg

New submission from Josh Rosenberg :

In Python 2, making a user-defined class support formatting using the 
integer-specific type codes required that __int__ be defined and nothing else 
(that is, '%x' % Foo() only required Foo to provide a __int__ method). In 
Python 3, this was changed to perform the conversion via __index__ for the %o, 
%x and %X format types (to match how oct and hex behave), not __int__, but the 
pre-check for validity in unicodeobject.c's mainformatlong function is still 
based on PyNumber_Check, not PyIndex_Check, and PyNumber_Check is concerned 
solely with __int__ and __float__, not __index__.

This means that a class with __index__ but not __int__ can't be used with the 
%o/%x/%X format codes (even though hex(mytype) and oct(mytype) work just fine).

It seems to me that either:

1. PyNumber_Check should be a superset of PyIndex_Check (broader change, 
probably out of scope)

or

2. mainformatlong should restrict the scope of the PyNumber_Check test to only 
being used for the non-'o'/'x'/'X' tests (where it's needed to avoid coercing 
strings and the like to integer).

Change #2 should be safe, with no major side-effects; since PyLong and 
subclasses always passed the existing PyNumber_Check test anyway, and 
PyNumber_Index already performs PyIndex_Check, the only path that needs 
PyNumber_Check is the one that ends in calling PyNumber_Long.

--
components: Interpreter Core
messages: 313285
nosy: josh.r
priority: normal
severity: normal
status: open
title: Making a class formattable as hex/oct integer requires both __int__ and 
__index__ for no good reason
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



[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

I've also checked that ABC.register() doesn't allow non-classes (and PEP 3119 
mentions that).

Looking at PyObject_IsSubclass in Objects/abstract.c, the only case in which 
its check_class() could be avoided is if there is a custom __subclasscheck__:

>>> class M(type):
...   def __subclasscheck__(cls, c):
... return c == 1 or super().__subclasscheck__(c)
...
>>> class A(metaclass=M):
...   pass
...
>>> issubclass(1, A)
True

If there is no need to support such weird __subclasscheck__, check_class() 
could be called earlier.

Note, however, that check_class() treats anything having __bases__ as a class, 
so moving the check alone is not enough to avoid the crash in all cases.

--

___
Python tracker 

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



[issue32642] add support for path-like objects in sys.path

2018-03-05 Thread Jay Yin

Jay Yin  added the comment:

I'm unsure how to regenerate the files that interact with the code for sys.path 
as travisCI states
"
Generated files not up to date
 M Python/importlib_external.h
"
since my code changes some of how the importing is handled

--

___
Python tracker 

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



[issue32993] urllib and webbrowser.open() can open w/ file: protocol

2018-03-05 Thread Brett Cannon

Change by Brett Cannon :


--
keywords: +security_issue
title: issue11662 Incomplete fix -> urllib and webbrowser.open() can open w/ 
file: protocol

___
Python tracker 

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



[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread Terry J. Reedy

Change by Terry J. Reedy :


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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread Eryk Sun

Eryk Sun  added the comment:

>> As os.symlink requires administrative privileges on most versions 
>> of Windows
>
> The current implementation requires SeCreateSymbolicLinkPrivilege on 
> ALL versions of Windows because users must pass an additional flag to 
> CreateSymbolicLink to enable non-privileged symlinks on recent Windows
> 10, which os.symlink() doesn't do (see #31512).

The change in Windows 10 to allow unprivileged creation of links will be 
supported implicitly in 3.7, but this change is more for convenience than 
necessity. SeCreateSymbolicLinkPrivilege can be granted to standard users and 
groups. On my own systems, I grant this privilege to the "Authenticated Users" 
(S-1-5-11) well-known group. This even allows administrators to create symbolic 
links without having to elevate.

--
nosy: +eryksun

___
Python tracker 

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



[issue25427] Remove the pyvenv script in Python 3.8

2018-03-05 Thread Brett Cannon

Change by Brett Cannon :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue32998] regular expression regression in python 3.7

2018-03-05 Thread Doug Hellmann

Change by Doug Hellmann :


--
nosy: +doughellmann

___
Python tracker 

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

> As os.symlink requires administrative privileges on most versions of Windows

The current implementation requires SeCreateSymbolicLinkPrivilege on ALL 
versions of Windows because users must pass an additional flag to 
CreateSymbolicLink to enable non-privileged symlinks on recent Windows 10, 
which os.symlink() doesn't do (see #31512).

--

___
Python tracker 

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



[issue32305] Namespace packages have inconsistent __file__ and __spec__.origin

2018-03-05 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
pull_requests: +5761

___
Python tracker 

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



[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread miss-islington

miss-islington  added the comment:


New changeset 6935a511670797a3aaebdf96aad3dcff66baa76e by Miss Islington (bot) 
in branch '3.6':
bpo-32984: IDLE - set __file__ for startup files (GH-5981)
https://github.com/python/cpython/commit/6935a511670797a3aaebdf96aad3dcff66baa76e


--

___
Python tracker 

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

While judging by the source code it seems that bytes in 3.5 should be fine, 
I've got a crash with the latest binary from python.org:

Python 3.5.4 (v3.5.4:3f56838, Aug  8 2017, 02:17:05) [MSC v.1900 64 bit (AMD64)]
 on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.symlink(b'x\\' * 129, b'y\\' * 129)
(Windows pop-up here)

--

___
Python tracker 

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



[issue32305] Namespace packages have inconsistent __file__ and __spec__.origin

2018-03-05 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Mar 5, 2018, at 10:33, Ned Batchelder  wrote:

> As is usual for me, I am here because some coverage.py code broke due to this 
> change.  A diff between b1 and b2 found me the code change (thanks for the 
> comment, btw!), but a What's New doesn't seem out of place.

Sounds good; I’ll work up a PR

--

___
Python tracker 

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



[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5760

___
Python tracker 

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



[issue32305] Namespace packages have inconsistent __file__ and __spec__.origin

2018-03-05 Thread Ned Batchelder

Ned Batchelder  added the comment:

As is usual for me, I am here because some coverage.py code broke due to this 
change.  A diff between b1 and b2 found me the code change (thanks for the 
comment, btw!), but a What's New doesn't seem out of place.

--

___
Python tracker 

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread Steve Dower

Change by Steve Dower :


--
pull_requests: +5759

___
Python tracker 

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread Steve Dower

Change by Steve Dower :


--
pull_requests: +5758

___
Python tracker 

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread Steve Dower

Change by Steve Dower :


--
pull_requests: +5757

___
Python tracker 

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



[issue32991] AttributeError in doctest.DocTestFinder.find

2018-03-05 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Good catch Jason.  Your fix is exactly right.  I approved your PR, which is 
against master, so it should definitely be backported to 3.7.  No need to 
backport to 3.6; we reverted the change for that release.

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread Steve Dower

Change by Steve Dower :


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

___
Python tracker 

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



[issue33001] Buffer overflow vulnerability in os.symlink on Windows

2018-03-05 Thread Steve Dower

New submission from Steve Dower :

On February 27th, 2018, the Python Security Response team was notified of a 
buffer overflow issue in the os.symlink() method on Windows. The issue affects 
all versions of Python between 3.2 and 3.6.4, including the 3.7 beta releases. 
It will be patched for the next releases of 3.4, 3.5, 3.6 and 3.7.

Scripts may be vulnerable if they use os.symlink() on Windows and an attacker 
is able to influence the location where links are created. As os.symlink 
requires administrative privileges on most versions of Windows, exploits using 
this vulnerability are likely to achieve escalation of privilege.

Besides applying the fix to CPython, scripts can also ensure that the length of 
each path argument is less than 260, and if the source is a relative path, that 
its combination with the destination is also shorter than 260 characters. That 
is:

assert (len(src) < 260 and
len(dest) < 260 and
len(os.path.join(os.path.dirname(dest), src)) < 260)
os.symlink(src, dest)

Scripts that explicitly pass the target_is_directory argument as True are not 
vulnerable. Also, scripts on Python 3.5 that use bytes for paths are not 
vulnerable, because of a combination of stack layout and added parameter 
validation.

I will be requesting a CVE for this once the patches are applied to maintenance 
branches, and then notifying the security-announce list. The patch has been 
reviewed by the PSRT and reporter, and while it prevents the buffer overflow, 
it does not raise any new errors or enable the use of long paths when creating 
symlinks.

Many thanks to Alexey Izbyshev for the report, and helping us work through 
developing the patch.

--
assignee: steve.dower
components: Windows
keywords: security_issue
messages: 313275
nosy: izbyshev, paul.moore, steve.dower, tim.golden, zach.ware
priority: critical
severity: normal
status: open
title: Buffer overflow vulnerability in os.symlink on Windows
type: security
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32305] Namespace packages have inconsistent __file__ and __spec__.origin

2018-03-05 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I guess it depends on whether you think this is a new feature or a bug fix.  
Or, OTOH, since we had to revert for 3.6, maybe it makes sense either way since 
some code will be affected.

--

___
Python tracker 

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



[issue32921] .pth files cannot contain folders with utf-8 names

2018-03-05 Thread Steve Dower

Steve Dower  added the comment:

Yes, it'll have significant side effects. The default file encoding on Windows 
is your configured code page (1252, in your case), and there's no good way 
around that default. The easiest immediate fix is to re-encode that file 
yourself.

Perhaps what we could do instead is allow the first line of a .pth file to be a 
coding comment? Then site.py can reopen the file with the specified encoding.

(FWIW, when I added the ._pth file, I explicitly made it UTF-8. But it had no 
history at that time so it was safe to do so.)

--

___
Python tracker 

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



[issue33000] IDLEX GUI consumes all RAM for scrollback buffer, uses 161Bytes / character stored

2018-03-05 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

IDLEX is an independently developed and distributed set of IDLE eXtensions.  We 
have nothing to do with it.

IDLE, as the name suggests and the doc spells out, is an Integrated  
Development and Learning Environment.  It is not a production run environment.  
For interactive development, one can close the shell window and reclaim its 
memory while keeping an editor window open.

16 million lines of screen output way outside of IDLE's intended use.  Why are 
you (mis)using it this way?

As you already discovered, an effectively infinite output stream can be sent to 
a console.  Command Prompt has a similar behavior.  If you want more saved, 
output to disk.

Or write your own gui for your simulations.  IDLE (and hence IDLEX) uses the 
tkinter wrapper of the tcl/tk GUI framework.  tcl/tk is also separately 
developed and distributed.  We just use it.  Its text widget does not come with 
any automatic size management.  But you could write your own insert wrapper 
that would delete a line for each line added after you deem the widget 'full'.

When I ran your sample with 64 bit 3.7.0b2 on Win10, the memory reported by 
Task Manager increased from 30 to 195 Mb or 165 MB net, much less than you 
report.  I once printed about 500,000 60 char lines.  I had either 12 or 24 GB 
memory at the time.

I am inclined to close this issue as 'third party' (IDLEX and tcl/tk) but I 
will let you respond first.

--

___
Python tracker 

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



[issue32968] Fraction modulo infinity should behave consistently with other numbers

2018-03-05 Thread Elias Zamaria

Elias Zamaria  added the comment:

Done.

--

___
Python tracker 

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



[issue32829] Lib/ be more pythonic

2018-03-05 Thread Дилян Палаузов

Дилян Палаузов  added the comment:

The variables got_it in distutils/command/sdist and quote in 
email/_header_value_parser can be skipped making the code shorter and faster.

--

___
Python tracker 

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



[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

> Is there any sense in accepting non-types as the first argument of 
> issubclass()?

No, though it is not (clearly) documented. The docs mention TypeError, but only 
for the second argument if my reading is correct.

In practice, issubclass() raises a TypeError if the first argument is not a 
class object:

>>> issubclass(1, int)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: issubclass() arg 1 must be a class

Though, as I mentioned above, behavior for ABCs was always weird.

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



[issue32997] Catastrophic backtracking in fpformat

2018-03-05 Thread James Davis

James Davis  added the comment:

Equivalent, probably cleaner. Comment on the PR if you want a change.

--

___
Python tracker 

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



[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread miss-islington

miss-islington  added the comment:


New changeset fd340bf9e308130736c76257ff9a697edbeb082d by Miss Islington (bot) 
in branch '3.7':
bpo-32984: IDLE - set __file__ for startup files (GH-5981)
https://github.com/python/cpython/commit/fd340bf9e308130736c76257ff9a697edbeb082d


--
nosy: +miss-islington

___
Python tracker 

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



[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is there any sense in accepting non-types as the first argument of 
issubclass()? I would add a check just in issubclass().

--
nosy: +inada.naoki, serhiy.storchaka
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



[issue32997] Catastrophic backtracking in fpformat

2018-03-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Wouldn't be easier to remove '0*' from the pattern? 0s could be stripped later 
by .lstrip('0').

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32998] regular expression regression in python 3.7

2018-03-05 Thread mike bayer

mike bayer  added the comment:

for those watching this would be the findall() case which is consistent between 
pythons:

import re

for reg in [
'VARCHAR(30) COLLATE "en_US"',
'VARCHAR(30)'
]:

print(re.findall(r'(?: COLLATE.*)?$', reg))


output (all pythons):

[' COLLATE "en_US"', '']
['']

so yes there are two matches for one and only one for the other.

--

___
Python tracker 

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



[issue33000] IDLEX GUI consumes all RAM for scrollback buffer, uses 161Bytes / character stored

2018-03-05 Thread John Brearley

New submission from John Brearley :

While running a tensorflow script in the IDLEX GUI that runs for 8 million 
steps and produce 2 lines stdout per step, my PC used all 16GB RAM and crashed 
the python process, not to mention messed up other apps, like Firefox & Norton 
AntiVirus. While the RAM was recovered, Firefox started responding, but Norton 
Antivirus didn’t, so the PC had to be rebooted. 
 
The issue is easily reproduced with the short print loop that dumps 20K lines 
of stdout, at 171 characters / line on the IDLEX GUI window. When the script is 
run in the IDLEX GUI, the Windows Task Manager shows the python process start 
at 19MB RAM consumption, then grows to 569MB RAM consumption. If I run the 
script a second time in the same IDLEX GUI window, it grows to 1.1GB RAM 
consumption. 
 
So 20K lines off output at 171 characters / line (“i: n” prefix + 2 * 80 
byte string + newline) = 3.4M total characters stored in the scrollback buffer. 
The delta memory consumed was 569MB – 19MB = 550MB. The RAM consumed / 
character is 550MB / 3.4M = 161 bytes / character. This seems excessively 
inefficient.
 
I now understand how the tensorflow script would stop after 550K iterations and 
the 550K lines of stdout in the IDLEX GUI would consume all 16GB RAM on my PC.
 
BTW, when I run the same test script in the WinPython command prompt window, it 
only consumes 4MB RAM while it runs. However the scrollback buffer is limited 
to 10K lines, wrapped at the 80 character mark, so much less data saved.
 
I haven’t found any options in IDLEX GUI to limit the scrollback buffer size.
 
My request is to review the scrollback memory storage algorithms. If nothing 
can be done to improve them, then please add a circular buffer to limit the 
memory consumption.
 
# Print loop to test memory consumption in Python IDLEX GUI.
s1 = "0123456789"
s2 = s1+s1+s1+s1+s1+s1+s1+s1
for i in range(2):
   print("i:", i, s2, s2)

I am using Python 3.6.4 on Windows 7 PC, Intel i7-4770S, 3.1GHz, 16GB RAM.

--
assignee: terry.reedy
components: IDLE
messages: 313263
nosy: jbrearley, terry.reedy
priority: normal
severity: normal
status: open
title: IDLEX GUI consumes all RAM for scrollback buffer, uses 161Bytes / 
character stored
type: resource usage
versions: Python 3.6

___
Python tracker 

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



[issue32998] regular expression regression in python 3.7

2018-03-05 Thread mike bayer

mike bayer  added the comment:

for now the quickest solution is to add "count=1" so that it only replaces once.

--

___
Python tracker 

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



[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

In debug mode, the following assertion fails:

python: ./Modules/_abc.c:642: _abc__abc_subclasscheck_impl: Assertion 
`((PyObject*)(mro))->ob_type))->tp_flags & ((1UL << 26))) != 0)' failed.

--

___
Python tracker 

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



[issue32998] regular expression regression in python 3.7

2018-03-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

In your case you can just pass 1 as the fourth parameter of re.sub().

--

___
Python tracker 

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



[issue32969] Add more constants to zlib module

2018-03-05 Thread Xiang Zhang

Change by Xiang Zhang :


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

___
Python tracker 

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



[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Alexey Izbyshev

New submission from Alexey Izbyshev :

Demo:

>>> from abc import ABC
>>> issubclass(1, ABC)
Segmentation fault (core dumped)

The stack trace is attached.

Before reimplementation of abc in C, the result was confusing too:

Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)]
 on win32
>>> from abc import ABC
>>> issubclass(1, ABC)
Traceback (most recent call last):
  File "", line 1, in 
  File "abc.py", line 230, in __subclasscheck__
  File "_weakrefset.py", line 84, in add
TypeError: cannot create weak reference to 'int' object

--
components: Extension Modules
files: stack-trace.txt
messages: 313259
nosy: izbyshev, levkivskyi
priority: normal
severity: normal
status: open
title: issubclass(obj, abc.ABC) causes a segfault
type: crash
versions: Python 3.8
Added file: https://bugs.python.org/file47470/stack-trace.txt

___
Python tracker 

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



[issue32998] regular expression regression in python 3.7

2018-03-05 Thread mike bayer

mike bayer  added the comment:

also, removing the "?" is not an option for me.   I need the brackets to be 
placed prior to the "COLLATE" subsection, but unconditionally even if the 
"COLLATE" section is not present. Looking at the change the behavior seems 
wrong to me.   The regexp states, "match the end of the string, plus an 
optional "COLLATE" clause, into a capturing expression.  replace everything 
here, e.g. the capturing part as well as the dollar sign part, with a single 
instance of FOO plus the captured part".   It is entirely unintuitive to me how 
a second replacement would be occurring here.   I cannot prove it but I think 
this change is wrong.

I will try to rewrite the expression.

--

___
Python tracker 

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



[issue32998] regular expression regression in python 3.7

2018-03-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Just see the re.sub() documentation for 3.7. There is also a note in the What's 
New document, in the "Changes in the Python API" section.

--

___
Python tracker 

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



[issue32998] regular expression regression in python 3.7

2018-03-05 Thread mike bayer

mike bayer  added the comment:

can you point me to the documentation?

--

___
Python tracker 

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



[issue32998] regular expression regression in python 3.7

2018-03-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is intentional change.

Prior to 3.7 re.sub() didn't replace empty matches adjacent to a previous 
non-empty match. In 3.7 it does. Together with other changes this made all four 
functions that search multiple matches of the pattern (re.findall(), 
re.finditer(), re.split() and re.sub()) consistent.

In your example the pattern matches not only from " COLLATE" to the end of 
input string, but an empty string at the end of input string. If you do not 
want matching an empty string, just remove the '?' qualifier.

--
nosy: +serhiy.storchaka
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



[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5754

___
Python tracker 

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



[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5753
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



[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset 22c82be5df70c3d51e3f89b54fe1d4fb84728c1e by Terry Jan Reedy in 
branch 'master':
bpo-32984: IDLE - set __file__ for startup files (GH-5981)
https://github.com/python/cpython/commit/22c82be5df70c3d51e3f89b54fe1d4fb84728c1e


--

___
Python tracker 

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



[issue26707] plistlib fails to parse bplist with 0x80 UID values

2018-03-05 Thread Jon Janzen

Jon Janzen  added the comment:

@serhiy.storchaka: I've implemented a UID wrapper class

I've also updated the parser and writer classes to support the UID wrapper. The 
implementations for reading/writing XML UID tags match the implementations 
given by Apple's plutil distributed with macOS:

UID(x) becomes {'CF$UID': int(x)}

--

___
Python tracker 

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



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-05 Thread Francisco Facioni

Change by Francisco Facioni :


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

___
Python tracker 

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



[issue32998] regular expression regression in python 3.7

2018-03-05 Thread mike bayer

mike bayer  added the comment:

correction, that's fedora 26, not 27

--

___
Python tracker 

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



[issue32998] regular expression regression in python 3.7

2018-03-05 Thread mike bayer

New submission from mike bayer :

demo:

import re

inner = 'VARCHAR(30) COLLATE "en_US"'

result = re.sub(
r'((?: COLLATE.*)?)$',
r'FOO\1',
inner
)

print(inner)
print(result)


in all Python versions prior to 3.7:

VARCHAR(30) COLLATE "en_US"
VARCHAR(30)FOO COLLATE "en_US"

in Python 3.7.0b2:

VARCHAR(30) COLLATE "en_US"
VARCHAR(30)FOO COLLATE "en_US"FOO

platform: Fedora 27 
python build:
Python 3.7.0b2 (default, Mar  5 2018, 09:37:32) 
[GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux

--
components: Library (Lib)
messages: 313251
nosy: zzzeek
priority: normal
severity: normal
status: open
title: regular expression regression in python 3.7
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



[issue32997] Catastrophic backtracking in fpformat

2018-03-05 Thread James Davis

Change by James Davis :


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

___
Python tracker 

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



[issue31880] subprocess process interaction with IDLEX GUI causes pygnuplot silent failures

2018-03-05 Thread John Brearley

John Brearley  added the comment:

I retested with Python 3.6.4 upgrades and the issue no longer occurs. You may 
want to close this issue.

--

___
Python tracker 

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



[issue32997] Catastrophic backtracking in fpformat

2018-03-05 Thread James Davis

New submission from James Davis :

The decoder regex used to parse numbers in the fpformat module is vulnerable to 
catastrophic backtracking.

'^([-+]?)0*(\d*)((?:\.\d*)?)(([eE][-+]?\d+)?)$'

The substructure '0*(\d*)' is quadratic.
An attack string like '+0000++' blows up.

There is a risk of DOS (REDOS) if a web app uses this module to format 
untrusted strings.

--
components: Library (Lib)
messages: 313249
nosy: davisjam
priority: normal
severity: normal
status: open
title: Catastrophic backtracking in fpformat
type: security
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



[issue31528] Let ConfigParser parse systemd units

2018-03-05 Thread bbayles

Change by bbayles :


--
nosy: +bbayles

___
Python tracker 

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



[issue28788] ConfigParser should be able to write config to a given filename, not only into file object

2018-03-05 Thread bbayles

Change by bbayles :


--
nosy: +bbayles

___
Python tracker 

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



[issue32984] IDLE: set and unset __file__ for startup files

2018-03-05 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

The change works on Linux with the patch (and gave a NameError without the 
patch).  I left a note on the PR for a possible SyntaxError.

I didn't have authority to push the blurb markup change to your branch, so I 
copied it into a comment.  If you click edit on it, you should be able to cut 
and paste it as is into the blurb file.

--

___
Python tracker 

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



[issue23159] argparse: Provide equivalent of optparse.OptionParser.{option_groups, option_list, get_option}

2018-03-05 Thread Matej Cepl

Matej Cepl  added the comment:

So, this bug report could be closed, right?

--
nosy: +mcepl

___
Python tracker 

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



[issue28788] ConfigParser should be able to write config to a given filename, not only into file object

2018-03-05 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue26707] plistlib fails to parse bplist with 0x80 UID values

2018-03-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

But they use the plist format for serialization (as plists theirself use the 
XML format).

https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSKeyedArchiver.swift

Direct support of keyed archives would be better to implement in third-party 
package. But we can provide the support for low-level operations.

For distinguishing UIDs from integers and for being able to create plist files 
containing UIDs we need a special purposed class plist.UID. It will be a 
simpler wrapper around int with few methods: __index__(), __repr__(), 
__reduce__().

--

___
Python tracker 

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



[issue1322] Deprecate platform.dist() and platform.linux_distribution() functions

2018-03-05 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue31528] Let ConfigParser parse systemd units

2018-03-05 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +lukasz.langa
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



[issue28955] Not matched behavior of numeric comparison with the documentation

2018-03-05 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue30760] configparse module in python3 can not write '%' to config file

2018-03-05 Thread Matej Cepl

Matej Cepl  added the comment:

Lukasz, this bug could be closed, couldn't it?

--
nosy: +mcepl

___
Python tracker 

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



[issue32917] ConfigParser writes a superfluous final blank line

2018-03-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Adding two new parameters to control so tiny detail of the output looks 
excessive to me. What if just change the default behavior and never output a 
final blank line?

--
nosy: +lukasz.langa, serhiy.storchaka

___
Python tracker 

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



[issue29623] configparser.ConfigParser.read() does not accept Pathlib path as a single argument.

2018-03-05 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue1410680] Add 'surgical editing' to ConfigParser

2018-03-05 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue31528] Let ConfigParser parse systemd units

2018-03-05 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue32996] Improve What's New in 3.7

2018-03-05 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue32996] Improve What's New in 3.7

2018-03-05 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

The following PR fixes and improves formatting in the "What's New in Python 
3.7" document, adds links to issues and authors names.

This is just one step. Somebody need to review NEWS entries and adds 
corresponding What's New entries if they are worth this, and later edit the 
wording of the final document.

--
assignee: docs@python
components: Documentation
messages: 313243
nosy: docs@python, ned.deily, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve What's New in 3.7
type: enhancement
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



[issue32917] ConfigParser writes a superfluous final blank line

2018-03-05 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



  1   2   >