[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())) #

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

2018-03-05 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- versions: +Python 3.7 ___ Python tracker ___ ___

[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

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

[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

[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

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

[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

[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

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

[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

Re: "except" and "subclasscheck" changed between CPython2 and 3

2018-03-05 Thread Steven D'Aprano
On Sat, 03 Mar 2018 04:28:24 +, 高岡陽太 wrote: > Hello, > > I found a difference of behavior about `except` statement between > CPython 2.7 and 3.x . > `except EXC_CLASS:` calls `__subclasscheck__` in 2.7, but does not in > 3.x . Python 3 does not accept virtual subclasses for exception

Re: How to access the help page of SRE_Pattern?

2018-03-05 Thread Steven D'Aprano
On Mon, 05 Mar 2018 18:13:59 -0600, Peng Yu wrote: > Hi, > import re prog=re.compile('[a-f]+') help(prog) > > I can use the above command to access SRE_Pattern. But this involves the > creation of an object of the class. If you're using help() interactively, the cost of creating

[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

[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

How to access the help page of SRE_Pattern?

2018-03-05 Thread Peng Yu
Hi, >>> import re >>> prog=re.compile('[a-f]+') >>> help(prog) I can use the above command to access SRE_Pattern. But this involves the creation of an object of the class. I tried to directly access the class. But it does not work. Does anybody know if there is a way to directly access the

Re: How to make Python run as fast (or faster) than Julia

2018-03-05 Thread Dan Stromberg
On Mon, Mar 5, 2018 at 3:53 PM, Python wrote: > On Sat, Mar 03, 2018 at 08:18:03AM +1100, Chris Angelico wrote: >> > Python is often a preferred solution because it is often fantastic for >> > rapid implementation and maintainability. The GIL's interference >> > with

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

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-05 Thread Chris Angelico
On Tue, Mar 6, 2018 at 10:04 AM, Steven D'Aprano wrote: > # Later. > if __name__ = '__main__': > # Enter the Kingdom of Nouns. Don't you need a NounKingdomEnterer to do that for you? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make Python run as fast (or faster) than Julia

2018-03-05 Thread Python
On Sat, Mar 03, 2018 at 08:18:03AM +1100, Chris Angelico wrote: > > Python is often a preferred solution because it is often fantastic for > > rapid implementation and maintainability. The GIL's interference > > with threaded code performance has, for me at least, on several > > occasions been...

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

Re: Bitstream -- Binary Data for Humans

2018-03-05 Thread Roel Schroeven
Sébastien Boisgérault schreef op 5/03/2018 20:05: I have released bitstream, a Python library to manage binary data (at the byte or bit level), > hopefully without the pain that this kind of thing usually entails :) If you have struggled with this topic in the past, please take a look at the

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

[issue32991] AttributeError in doctest.DocTestFinder.find

2018-03-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +5763 ___ Python tracker ___

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

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-05 Thread Steven D'Aprano
On Mon, 05 Mar 2018 09:22:33 -0800, Ooomzay wrote: [...] >> Looking at that code, my major thought is that there is far too much >> OO design, not enough simplicity. > > If this is far too much OO for you then RAII will be of no interest to > you. I think this is probably the wisest thing you

Re: "built-in" callables?

2018-03-05 Thread Gregory Ewing
Stefan Ram wrote: . So, what does "built-in" in the sense of »isbuiltin« actually mean? It means "implemented in C". Yes, this is confusing. The term "built-in" is used in two different ways, and you just have to disambiguate them from context. -- Greg --

[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

[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

[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

[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).

[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

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

2018-03-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +5762 ___ Python tracker ___

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

[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

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

[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

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-05 Thread Ooomzay
On Monday, 5 March 2018 19:14:05 UTC, Paul Rubin wrote: > Ooomzay writes: > > If you want to use RAII objects then you will make sure you avoid > > adding them to orphan cycles by design. If you don't know how to do > > that then don't write applications that manage critical resources. > > My

[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

[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

[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

[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

[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

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

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-05 Thread Ooomzay
On Monday, 5 March 2018 17:58:40 UTC, Chris Angelico wrote: > On Tue, Mar 6, 2018 at 4:53 AM, Ooomzay wrote: > > On Monday, 5 March 2018 14:21:54 UTC, Chris Angelico wrote: > >> On Tue, Mar 6, 2018 at 12:58 AM, Ooomzay wrote: > >> > Here is my fixed example, if someone else could try it in

Re: Bitstream -- Binary Data for Humans

2018-03-05 Thread sum abiut
Thanks On 6/03/2018 7:13 AM, "Sébastien Boisgérault" < sebastien.boisgera...@gmail.com> wrote: Hi everyone, I have released bitstream, a Python library to manage binary data (at the byte or bit level), hopefully without the pain that this kind of thing usually entails :) If you have struggled

[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

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

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

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

[issue32998] regular expression regression in python 3.7

2018-03-05 Thread Doug Hellmann
Change by Doug Hellmann : -- nosy: +doughellmann ___ Python tracker ___ ___

[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

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

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

Bitstream -- Binary Data for Humans

2018-03-05 Thread Sébastien Boisgérault
Hi everyone, I have released bitstream, a Python library to manage binary data (at the byte or bit level), hopefully without the pain that this kind of thing usually entails :) If you have struggled with this topic in the past, please take a look at the documentation

[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",

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

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

2018-03-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +5760 ___ Python tracker ___

Re: Ways to make a free variable local to a function?

2018-03-05 Thread Terry Reedy
On 3/5/2018 9:34 AM, Chris Angelico wrote: On Tue, Mar 6, 2018 at 12:52 AM, Terry Reedy wrote: On 3/5/2018 7:12 AM, Kirill Balunov wrote: # 1. By passing through local variable's default values def func_local_1(numb, _int = int, _float = float, _range = range): You

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

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

2018-03-05 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +5759 ___ Python tracker ___ ___

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

2018-03-05 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +5758 ___ Python tracker ___ ___

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

2018-03-05 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +5757 ___ Python tracker ___ ___

[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

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

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

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-05 Thread Chris Angelico
On Tue, Mar 6, 2018 at 4:53 AM, Ooomzay wrote: > On Monday, 5 March 2018 14:21:54 UTC, Chris Angelico wrote: >> On Tue, Mar 6, 2018 at 12:58 AM, Ooomzay wrote: >> > Here is my fixed example, if someone else could try it in CPython and >> > report back that would be

[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. -- ___

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-05 Thread Ooomzay
On Monday, 5 March 2018 14:21:54 UTC, Chris Angelico wrote: > On Tue, Mar 6, 2018 at 12:58 AM, Ooomzay wrote: > > Here is my fixed example, if someone else could try it in CPython and > > report back that would be interesting:- > > > > class RAIIFileAccess(): > > def __init__(self, fname): >

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

[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

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-05 Thread Ooomzay
On Monday, 5 March 2018 16:47:02 UTC, Steven D'Aprano wrote: > On Sun, 04 Mar 2018 16:58:38 -0800, Ooomzay wrote: > > > Here is an example of a composite resource using RAII:- > > > > class RAIIFileAccess(): > > def __init__(self, fname): > > print("%s Opened" % fname) > > def

[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

[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

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

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-05 Thread Steven D'Aprano
On Mon, 05 Mar 2018 07:31:57 -0800, Ooomzay wrote: > We do not expect this to work in PyPy. Or Jython, IronPython, possibly not Stackless either, or in the interactive interpreter of (probably) any implementation, or CPython if the object is garbage collected during interpreter shutdown or is

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

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

[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

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-05 Thread Steven D'Aprano
On Sun, 04 Mar 2018 16:58:38 -0800, Ooomzay wrote: > Here is an example of a composite resource using RAII:- > > class RAIIFileAccess(): > def __init__(self, fname): > print("%s Opened" % fname) > def __del__(self): > print("%s Closed" % fname) > > class A(): > def

[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

[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

[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

[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

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

[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

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

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

[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

[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

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

[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

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

2018-03-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +5754 ___ Python tracker ___

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

[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

[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

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

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

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

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-05 Thread Ooomzay
On Monday, 5 March 2018 15:17:13 UTC, bartc wrote: > On 05/03/2018 13:58, Ooomzay wrote: > > On Monday, 5 March 2018 11:24:37 UTC, Chris Angelico wrote: > >> On Mon, Mar 5, 2018 at 10:09 PM, Ooomzay wrote: > >>> Here is an example of a composite resource using RAII:- > >>> > >>> class

  1   2   >