[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)

2018-03-18 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> eric.smith nosy: +eric.smith ___ Python tracker ___

[issue33100] dataclasses and __slots__ - non-default argument (member_descriptor)

2018-03-18 Thread Adrian Stachlewski
New submission from Adrian Stachlewski : I've tried to declare two classes @dataclass class Base: __slots__ = ('x',) x: Any @dataclass class Derived(Base): x: int y: int As long as I correctly understood PEP 557 (inheritance part), changing type

[issue26917] unicodedata.normalize(): bug in Hangul Composition

2018-03-18 Thread Ma Lin
Ma Lin added the comment: > Victor's patch is correct. I'm afraid you are wrong. Please see PR 1958 in issue29456, IMO this PR can be merged. -- nosy: +Ma Lin ___ Python tracker

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-18 Thread Adrian Stachlewski
Adrian Stachlewski added the comment: Thanks for explaining. I was trying to do something like @dataclass class A: x: ClassVar = set() and thanks to you I know it should be @dataclass class A: x: ClassVar[Set] = set() If you are looking for improved error

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

2018-03-18 Thread Tim Peters
Tim Peters added the comment: I'd be +1 on generalizing math.hypot to accept an arbitrary number of arguments. It's the natural building block for computing distance, but the reverse is strained. Both are useful. Here's scaling code translated from the Fortran

[issue32960] dataclasses: disallow inheritance between frozen and non-frozen classes

2018-03-18 Thread Eric V. Smith
Eric V. Smith added the comment: Resolved by issue 32953. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-18 Thread Eric V. Smith
Change by Eric V. Smith : -- versions: +Python 3.8 ___ Python tracker ___ ___

[issue33094] dataclasses: ClassVar attributes are not working properly

2018-03-18 Thread Eric V. Smith
Eric V. Smith added the comment: There are a couple of problems here. You're using ClassVar incorrectly. It should be: >>> @dataclass ... class C: ... __slots__=() ... x: ClassVar[int] = field(default=3) ... >>> C() C() >>> C.x 3 And you cannot have a ClassVar with

[issue32953] Dataclasses: frozen should not be inherited for non-dataclass derived classes

2018-03-18 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32953] Dataclasses: frozen should not be inherited for non-dataclass derived classes

2018-03-18 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 45648312e540cda3b10109b6a808cbf6955c84eb by Eric V. Smith (Miss Islington (bot)) in branch '3.7': bpo-32953: Dataclasses: frozen should not be inherited for non-dataclass derived classes (GH-6147) (GH-6148)

[issue33083] math.factorial accepts non-integral Decimal instances

2018-03-18 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +5907 stage: -> patch review ___ Python tracker ___

[issue32953] Dataclasses: frozen should not be inherited for non-dataclass derived classes

2018-03-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +5906 ___ Python tracker ___

[issue32953] Dataclasses: frozen should not be inherited for non-dataclass derived classes

2018-03-18 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset f199bc655eb50c28e94010714629b376bbbd077b by Eric V. Smith in branch 'master': bpo-32953: Dataclasses: frozen should not be inherited for non-dataclass derived classes (#6147)

[issue33098] add implicit conversion for random.choice() on a dict

2018-03-18 Thread Tim Peters
Tim Peters added the comment: This won't be changed. The dict type doesn't support efficient random choice (neither do sets, by the way), and it's been repeatedly decided that it would do a disservice to users to hide that. As you know, you can materialize the keys in a

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The garbage collector in Python does not work like that. If an object reaches zero references is destroyed immediately. The only problem is when circular references exist and is in this case when object deletion is delayed until

[issue26917] unicodedata.normalize(): bug in Hangul Composition

2018-03-18 Thread Ronan Lamy
Ronan Lamy added the comment: Victor's patch is correct. I implemented the same fix in PyPy in https://bitbucket.org/pypy/pypy/commits/92b4fb5b9e58 -- nosy: +Ronan.Lamy ___ Python tracker

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-18 Thread Henrique Andrade
Henrique Andrade added the comment: You're a missing the fact that in C++, there is no garbage collector. The destructor both releases resources and deallocates memory. There is no window between releasing resources and object destruction. Python, while not exactly like

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

2018-03-18 Thread Jay Yin
Jay Yin added the comment: srry I opened another issue bpo-33099 -- ___ Python tracker ___

[issue33099] test_poplib hangs with the changes done in PR

2018-03-18 Thread Jay Yin
New submission from Jay Yin : my test hangs locally on my computer with the changes I've done in bpo-32642 but doesn't hang on TravisCI, anyone able to help with checking what's wrong here (sounds like another edge case with my env but I could be wrong) the trace for

[issue32867] argparse assertion failure with multiline metavars

2018-03-18 Thread paul j3
paul j3 added the comment: I haven't seen anyone try to use \n in a metavar before, but other special characters like [] and () produce this assertion error. At this point the code is trying split the usage into 2 or more lines, because it's too long for one. It creates

[issue33098] add implicit conversion for random.choice() on a dict

2018-03-18 Thread Aristide Grange
New submission from Aristide Grange : In Python 3, the expression: ```python random.choice(d) ``` where `d` is a `dict`, raises this error: ``` ~/anaconda3/lib/python3.6/random.py in choice(self, seq) 256 except ValueError: 257 raise

[issue33017] Special set-cookie setting will bypass Cookielib

2018-03-18 Thread R. David Murray
R. David Murray added the comment: Can you explain what you think the problem is? I don't know what your "POC" snippets are trying to demonstrate. -- nosy: +r.david.murray ___ Python tracker

[issue32949] Simplify "with"-related opcodes

2018-03-18 Thread Mark Shannon
Mark Shannon added the comment: It is fiddly to get the frame-setlineno code right for duplicated catch blocks, but it is far from impossible. -- ___ Python tracker

[issue32953] Dataclasses: frozen should not be inherited for non-dataclass derived classes

2018-03-18 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +5905 stage: -> patch review ___ Python tracker ___

[issue32949] Simplify "with"-related opcodes

2018-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are problems with the f_lineno setter when duplicate a finally body. The duplication works for "with" only because the cleanup code for "with" doesn't correspond any line number. --

[issue32949] Simplify "with"-related opcodes

2018-03-18 Thread Mark Shannon
Mark Shannon added the comment: I intend to reuse RERAISE to implement the exceptional case for a finally block. Something like: SETUP_FINALLY final body finalbody JUMP exit final: finalbody RERAISE exit: -- ___

[issue29673] Some gdb macros are broken in 3.6

2018-03-18 Thread Skip Montanaro
Change by Skip Montanaro : -- nosy: -skip.montanaro ___ Python tracker ___ ___

[issue32056] Improve exceptions in aifc, sunau and wave

2018-03-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32056] Improve exceptions in aifc, sunau and wave

2018-03-18 Thread miss-islington
miss-islington added the comment: New changeset 3c0a5a7c7ba8fbbc95dd1fe76cd7a1c0ce167371 by Miss Islington (bot) in branch '3.7': bpo-32056: Improve exceptions in aifc, wave and sunau. (GH-5951)

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

2018-03-18 Thread Ned Deily
Ned Deily added the comment: Thanks everyone for your inputs. Let's go with the status quo -> closing this issue. -- priority: deferred blocker -> resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python

[issue32056] Improve exceptions in aifc, sunau and wave

2018-03-18 Thread Ned Deily
Ned Deily added the comment: I'm OK with merging this for 3.7.0b3. -- versions: +Python 3.7 ___ Python tracker ___

[issue32958] socket module calls with long host names can fail with idna codec error

2018-03-18 Thread Ned Deily
Change by Ned Deily : -- nosy: -ned.deily ___ Python tracker ___ ___ Python-bugs-list

[issue19417] Bdb: add a unittest file (test.test_bdb)

2018-03-18 Thread miss-islington
miss-islington added the comment: New changeset fdd8e8b4ffb68a4e8749bdc3b130fea7bbbf821e by Miss Islington (bot) in branch '3.7': bpo-19417: Add test_bdb.py (GH-5217) https://github.com/python/cpython/commit/fdd8e8b4ffb68a4e8749bdc3b130fea7bbbf821e

[issue19417] Bdb: add a unittest file (test.test_bdb)

2018-03-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +5904 ___ Python tracker ___

[issue19417] Bdb: add a unittest file (test.test_bdb)

2018-03-18 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset 3fe33043ee83d19e15551094fc1e0984617ded3c by Mariatta (xdegaye) in branch 'master': bpo-19417: Add test_bdb.py (GH-5217) https://github.com/python/cpython/commit/3fe33043ee83d19e15551094fc1e0984617ded3c --

[issue27645] Supporting native backup facility of SQLite

2018-03-18 Thread Berker Peksag
Berker Peksag added the comment: Buildbots look happy, closing this one as 'fixed'. Thanks, Aviv! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue30406] async and await should be keywords in 3.7

2018-03-18 Thread miss-islington
miss-islington added the comment: New changeset a90df5085b51e8bb9de1c04c408bbef42ce6cbc3 by Miss Islington (bot) in branch '3.7': Revert "bpo-30406: Make async and await proper keywords (GH-1669)" (GH-6143)

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > RAII in C++ ensures that, on object destruction, resources that have been > acquired will be closed and deallocated. Which is exactly what is happening here. When the queue gets destroyed (because the reference count reaches 0

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-18 Thread Henrique Andrade
Henrique Andrade added the comment: Your comparison is not correct. RAII in C++ ensures that, on object destruction, resources that have been acquired will be closed and deallocated. The closest analogy in Python is the use of a context manager, which, btw, a Queue does

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: >"I want to terminate the queue and make sure that no resources are leaked. Then you don't need to do anything special, those will be cleared on object destruction. This is not an unusual pattern even in other languages. For

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-18 Thread Henrique Andrade
Henrique Andrade added the comment: I don't want to "close the pipes but maintain the queue alive" - I want to terminate the queue and make sure that no resources are leaked. It's that simple. When one closes a file or a socket, there is no underlying OS resource being

[issue33097] concurrent futures Executors accept tasks after interpreter shutdown

2018-03-18 Thread Mark Nemec
Change by Mark Nemec : -- title: concurrent.futures executors accept tasks after interpreter shutdown -> concurrent futures Executors accept tasks after interpreter shutdown ___ Python tracker

[issue30406] async and await should be keywords in 3.7

2018-03-18 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset f64aae46da292f71f6be750026cd052362e066bc by Łukasz Langa (Jelle Zijlstra) in branch 'master': Revert "bpo-30406: Make async and await proper keywords (#1669)" (GH-6143)

[issue30406] async and await should be keywords in 3.7

2018-03-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +5903 ___ Python tracker ___

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Notice that the documentation for close says: > Indicate that no more data will be put on this queue by the current process. > The background thread will quit once it has flushed all buffered data to the > pipe. This is called

[issue33097] concurrent.futures executors accept tasks after interpreter shutdown

2018-03-18 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +5901 stage: -> patch review ___ Python tracker ___

[issue33097] concurrent.futures executors accept tasks after interpreter shutdown

2018-03-18 Thread Mark Nemec
New submission from Mark Nemec : Currently, one can submit a task to an executor (both ThreadPoolExecutor and ProcessPoolExecutor) during interpreter shutdown. One way to do this is to register function fun with atexit as below. @atexit.register def fun():

[issue30406] async and await should be keywords in 3.7

2018-03-18 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- pull_requests: +5900 ___ Python tracker ___ ___

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-18 Thread Henrique Andrade
Henrique Andrade added the comment: @pablo: I am using Python 2.7.12 (distributed with Ubuntu 16), what are you using? This might explain the difference between what we see. Yet, irrespective of this difference, imho, it would be a better design to have "close" actually

[issue33093] Fatal error on SSL transport

2018-03-18 Thread Matt Eaton
Matt Eaton added the comment: Eric, what is needed to try and reproduce this issue accurately? Would it be installing websockets and setting up your client to ping to the server forever (12 hours in this case)? If you are able to provide a client I would be willing

[issue13475] Add '-p'/'--path0' command line option to override sys.path[0] initialisation

2018-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: This question recently came up again over in https://bugs.python.org/issue33053#msg314040. With the assorted startup refactorings that were landed for 3.7, it likely makes sense to take another run at this for 3.8. --

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: https://bugs.python.org/issue13475 is the existing enhancement request to expose sys.path[0] management independently of the other execution isolation features. -- ___ Python tracker

[issue32949] Simplify "with"-related opcodes

2018-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your PR Mark. The main difference between PR 5883 and PR 5112 is that in PR 5883 the pair of old WITH_CLEANUP_FINISH and END_FINALLY are replaced with a single new WITH_CLEANUP_FINISH, and in PR 5112 it is

[issue33041] Issues with "async for"

2018-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 6142 fixes issues 2 and 4. It adds a new opcode END_ASYNC_FOR and therefore can't be backported. END_ASYNC_FOR combines a number of other opcodes and guaranties using the true StopAsyncIteration. The new opcode is neccessary

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: When I run your script I do not see any file descriptor associated with the queue when subprocess.call(["ls", "-la", "/proc/%d/fd" % os.getpid()]) is executed. This is my output if I just execute your program: starting 3728

[issue33041] Issues with "async for"

2018-03-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +5899 ___ Python tracker ___ ___

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-18 Thread Jakub Wilk
Jakub Wilk added the comment: -I implies -s, which is not something I want. -- ___ Python tracker ___

[issue33095] Cross-reference isolated mode from relevant locations

2018-03-18 Thread Jakub Wilk
Change by Jakub Wilk : -- nosy: -jwilk ___ Python tracker ___ ___ Python-bugs-list mailing

[issue33041] Issues with "async for"

2018-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 193760f00aacb122698674ed15327dba412653a5 by Serhiy Storchaka in branch '3.6': [3.6] bpo-33041: Add tests for jumps in/out of 'async with' blocks. (GH-6110). (GH-6141)

[issue33041] Issues with "async for"

2018-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 773573e9ac654d4b5c6682e70360f75864acd80e by Serhiy Storchaka in branch '3.7': [3.7] bpo-33041: Add tests for jumps in/out of 'async with' blocks. (GH-6110). (GH-6140)

[issue32489] Allow 'continue' in 'finally' clause

2018-03-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33041] Issues with "async for"

2018-03-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +5898 ___ Python tracker ___ ___

[issue33041] Issues with "async for"

2018-03-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +5897 ___ Python tracker ___ ___

[issue33096] ttk.Treeview.insert() does not allow to insert item with "False" iid

2018-03-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka versions: +Python 2.7, Python 3.7, Python 3.8 ___ Python tracker

[issue32056] Improve exceptions in aifc, sunau and wave

2018-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Now open() in modules aifc, sunau and wave will raise only EOFError (if the file was truncated) or corresponding module error exception on corrupted files. aifc.open() can raise also OverflowError, but this is a different

[issue33096] ttk.Treeview.insert() does not allow to insert item with "False" iid

2018-03-18 Thread Igor Yakovchenko
New submission from Igor Yakovchenko : ttk.Treeview.insert(... iid=None, ...) method has a check: if iid: res = self.tk.call(self._w, "insert", parent, index, "-id", iid, *opts) else: res = self.tk.call(self._w,

[issue32056] Improve exceptions in aifc, sunau and wave

2018-03-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +5896 ___ Python tracker ___

[issue32489] Allow 'continue' in 'finally' clause

2018-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset fe2bbb1869b4a3f331a3dfb8b304a19a5819 by Serhiy Storchaka in branch 'master': bpo-32489: Allow 'continue' in 'finally' clause. (GH-5822)

[issue32056] Improve exceptions in aifc, sunau and wave

2018-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 134cb01cda50f02725575808130b05d2d776693f by Serhiy Storchaka in branch 'master': bpo-32056: Improve exceptions in aifc, wave and sunau. (GH-5951)

[issue33041] Issues with "async for"

2018-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset bc300ce205f99acb1ef92c37de06dc76147e073b by Serhiy Storchaka in branch 'master': bpo-33041: Add tests for jumps in/out of 'async with' blocks. (#6110)

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: "python -m mypkg.myscript" does the right thing as far as local packages are concerned, whereas "python -m mypkg/myscript.py" will set you up for double-import bugs. Note that you can almost always trigger arbitrary non-obvious code

[issue33069] Maintainer information discarded when writing PKG-INFO

2018-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: I'm going to abuse the "third party" resolution type a bit and mark this as closed (at least for now) on the basis of "use setuptools instead if you want the improved behaviour". I've also opened

[issue27645] Supporting native backup facility of SQLite

2018-03-18 Thread Berker Peksag
Berker Peksag added the comment: New changeset 429ca448d2a36040f229ad9edc67e31fc6d18bf4 by Berker Peksag (Miss Islington (bot)) in branch '3.7': bpo-27645: Fix version number in 'database in transaction' fallback (GH-6131)

[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-18 Thread Nathaniel Smith
Nathaniel Smith added the comment: Whoa, wait, what? I agree that the original post is not as diplomatic as it could be, but my reaction to learning about this just now is also shock and confusion, so I guess I can sympathize with the OP a bit... The reason I'm surprised is

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-18 Thread Nick Coghlan
Nick Coghlan added the comment: Regarding 2.7: if folks want this fixed on RHEL/CentOS, then they need to talk to Red Hat about it, not the upstream CPython devs. I used to work there, and was told multiple times by Red Hat executives that none of their customers actually