[issue33117] asyncio example uses non-existing/documented method

2018-03-21 Thread Ned Deily
Change by Ned Deily : -- nosy: +asvetlov, giampaolo.rodola, yselivanov ___ Python tracker ___

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

2018-03-21 Thread Ned Deily
Ned Deily added the comment: I am OK with changing '' to the initial resolved working directory for 3.7 as long as we get that change in now, i.e. before the 3.7.0b3 ABI freeze next Monday. And I agree that we should not attempt to change this behavior for 3.6.x at this

[issue33108] Unicode char 304 in lowercase has len = 2

2018-03-21 Thread Ma Lin
Ma Lin added the comment: There was a discussion about "Latin Capital Letter I with Dot Above" https://bugs.python.org/issue17252 -- nosy: +Ma Lin ___ Python tracker

[issue32505] dataclasses: make field() with no annotation an error

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: But surely when you instantiate this: c = C(1) you'll notice that's an error? -- ___ Python tracker

[issue33108] Unicode char 304 in lowercase has len = 2

2018-03-21 Thread INADA Naoki
INADA Naoki added the comment: Maybe, we should update UnicodeData? -- ___ Python tracker ___

[issue33018] Improve issubclass() error checking and message

2018-03-21 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Would you merge this into master? OK, I played with this a bit and it looks good. There is however a merge conflict now, and a NEWS item is missing. I will leave a comment in the PR. --

[issue33110] Adding a done callback to a concurrent.futures Future once it has already completed, may raise an exception, contrary to docs

2018-03-21 Thread Ned Deily
Change by Ned Deily : -- nosy: +bquinlan, pitrou ___ Python tracker ___ ___

[issue32505] dataclasses: make field() with no annotation an error

2018-03-21 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Some part of the discussion is in https://bugs.python.org/issue32428 I still think it is important to flag things like this as an error: @dataclass class C: x = field() This is a big bug magnet. Especially taking into account that

[issue32505] dataclasses: make field() with no annotation an error

2018-03-21 Thread Guido van Rossum
Guido van Rossum added the comment: Fine to close as wontfix. -- ___ Python tracker ___

[issue32505] dataclasses: make field() with no annotation an error

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure this is worth preventing. I can certainly make it an error, but since dataclasses ignores anything without a type annotation, I don't think it's a big deal. Basically I'd have to look through all class attributes that are of

[issue33116] Field is not exposed in dataclasses.__all__

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

[issue33116] Field is not exposed in dataclasses.__all__

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 4ddc99d15963b0374f9dbfd57f14e6194ad65669 by Eric V. Smith (Miss Islington (bot)) in branch '3.7': bpo-33116: Add 'Field' to dataclasses.__all__. (GH-6182) (GH-6183)

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-21 Thread Ned Deily
Ned Deily added the comment: (Fot the record, PR 6181 was the 3.7 backport of PR 6180.) -- ___ Python tracker ___

[issue33116] Field is not exposed in dataclasses.__all__

2018-03-21 Thread miss-islington
Change by miss-islington : -- pull_requests: +5931 ___ Python tracker ___

[issue33117] asyncio example uses non-existing/documented method

2018-03-21 Thread Henrique Fingler
New submission from Henrique Fingler : In the documentation of asyncio.run_coroutine_threadsafe(coro, loop), in Section 19.5.3.6 (https://docs.python.org/3/library/asyncio-task.html#asyncio.run_coroutine_threadsafe), the example code does the following: future =

[issue33116] Field is not exposed in dataclasses.__all__

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

[issue33116] Field is not exposed in dataclasses.__all__

2018-03-21 Thread Eric V. Smith
New submission from Eric V. Smith : 'Field' needs to be added to __all__. -- assignee: eric.smith messages: 314222 nosy: eric.smith priority: normal severity: normal status: open title: Field is not exposed in dataclasses.__all__ type: behavior versions: Python 3.7,

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

2018-03-21 Thread Steven Downum
Change by Steven Downum : -- nosy: +steven.downum ___ Python tracker ___ ___

[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-03-21 Thread Ethan Welty
Change by Ethan Welty : -- components: +macOS ___ Python tracker ___ ___

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Good, I think we can close again now! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2018-03-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually the precedence was a warning for an assert like: assert(x % 2 == 0, "x is odd") Currently it is the only syntax warning produced by the compiler. > 1. Why 'chech' instead of 'check'? Just a typo replicated with a

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-21 Thread Ned Deily
Ned Deily added the comment: PR 6180 appears to have fixed the 3.x failures, thanks! -- ___ Python tracker ___

[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2018-03-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: Reviewing Serhiy's patch, I changed my mind from 6 years ago (msg164774). I may have over-estimated the difficulty; in any case the code patch is written. (Tests are still needed.) And the code is rather straightforward and readable.

[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-03-21 Thread Ethan Welty
Ethan Welty added the comment: I've tried with additional backends: WX, WXAgg, WXCairo, Qt5Agg (in matplotlib speak). With these, I can at least import matplotlib.pyplot, but as soon as say matplotlib.pyplot.plot is called and the backend is loaded, the code breaks

[issue33115] Asyncio loop blocks with a lot of parallel tasks

2018-03-21 Thread Yury Selivanov
Yury Selivanov added the comment: The "blocking" you observe is caused by Python GC. If I add "import gc; gc.disable()" the warnings disappear. -- ___ Python tracker

[issue33115] Asyncio loop blocks with a lot of parallel tasks

2018-03-21 Thread Marat Sharafutdinov
Marat Sharafutdinov added the comment: But why if I use multiprocessing (run 100 tasks by 100 workers) it still continue blocking loop within some workers? Are 100 tasks "a lot of work" for asyncio loop? ```python import asyncio from multiprocessing import Process

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

2018-03-21 Thread Brett Cannon
Brett Cannon added the comment: The proposed change for 3.8 and 3.7 seems reasonable to me. -- ___ Python tracker ___

[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2018-03-21 Thread TD22057
TD22057 added the comment: Is there any chance this will ever get fixed? Patches have been available for 5 years with no progress. -- ___ Python tracker

[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-03-21 Thread Ethan Welty
Ethan Welty added the comment: I have tried running the script with: - command line (python ): Works without (breaks with) `import _tkinter`. - basic python console (python): Same as with command line. - ipython: Fails with or without `import _tkinter`. However, if for

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-21 Thread Thomas Moreau
Change by Thomas Moreau : -- pull_requests: +5929 stage: needs patch -> patch review ___ Python tracker ___

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-21 Thread Ned Deily
Ned Deily added the comment: Buildbots are failing on macOS: http://buildbot.python.org/all/#/builders/14/builds/804/steps/4/logs/stdio http://buildbot.python.org/all/#/builders/93/builds/459/steps/4/logs/stdio -- nosy: +ned.deily resolution: fixed -> stage: resolved

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset bb5b5291971c104ea773db1a30e46d410b6b3e1e by Antoine Pitrou (Miss Islington (bot)) in branch '3.7': bpo-33078 - Fix queue size on pickling error (GH-6119) (GH-6178)

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-21 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue33115] Asyncio loop blocks with a lot of parallel tasks

2018-03-21 Thread Yury Selivanov
Yury Selivanov added the comment: Well, there's nothing we can do here, it's just a lot of work for a single-threaded process to get a 1 tasks going. You'll get the same picture in any other async Python framework. --

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-21 Thread Antoine Pitrou
Change by Antoine Pitrou : -- versions: -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker ___

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset e2f33add635df4fde81be9960bab367e010c19bf by Antoine Pitrou (Thomas Moreau) in branch 'master': bpo-33078 - Fix queue size on pickling error (GH-6119)

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-21 Thread miss-islington
Change by miss-islington : -- pull_requests: +5928 ___ Python tracker ___

[issue33115] Asyncio loop blocks with a lot of parallel tasks

2018-03-21 Thread Marat Sharafutdinov
New submission from Marat Sharafutdinov : I want to schedule a lot of parallel tasks, but it becomes slow with loop blocking: ```python import asyncio task_count = 1 async def main(): for x in range(1, task_count + 1): asyncio.ensure_future(f(x)) async def

[issue33114] random.sample() behavior is unexpected/unclear from docs

2018-03-21 Thread Scott Eilerman
Scott Eilerman added the comment: Sorry, there's a typo in that example. It should look like: random.seed(fixed_seed) random.sample(choices, n)[-1] Then, later, I want the next draw, so I did: random.seed(fixed_seed) random.sample(choices, n+1)[-1] --

[issue33114] random.sample() behavior is unexpected/unclear from docs

2018-03-21 Thread Scott Eilerman
Scott Eilerman added the comment: To clarify the use case where this behavior was problematic for me, I wanted to get the nth random draw from a given distribution, so I used something like: random.seed(fixed_seed) random.sample(choices, n)[-1] Then, later, I want

[issue33114] random.sample() behavior is unexpected/unclear from docs

2018-03-21 Thread Scott Eilerman
Scott Eilerman added the comment: Something along the lines of: "For a fixed seed, random.sample(population, k) is not guaranteed to return the same samples for different values of k." -- ___ Python tracker

[issue33103] Syntax to get multiple arbitrary items from an sequence

2018-03-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please leave this closed -- there is no chance that this will go forward on the bug tracker. It would first need to be thoroughly discussed on the python-ideas mail list. -- status: open -> closed title: Syntax to get

[issue33114] random.sample() behavior is unexpected/unclear from docs

2018-03-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: What additional wording do you propose? -- assignee: docs@python -> rhettinger nosy: +rhettinger ___ Python tracker

[issue33114] random.sample() behavior is unexpected/unclear from docs

2018-03-21 Thread Scott Eilerman
New submission from Scott Eilerman : I ran into a "bug" when using random.sample() in which I got some results I didn't expect. After digging a little more, this is either a side effect of the optimization that's made when k > 5, or I am using the function in a way

[issue33102] get the nth folder of a given path

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, it's cross platform. For a plain string version, you can use a utility function: >>> for i in range(n+1): ... path = os.path.dirname(path) ... I'm not sure it's worth adding this to os.path. --

[issue33102] get the nth folder of a given path

2018-03-21 Thread AmjadHD
AmjadHD added the comment: Yes but i dont know if this is cross platform solution, i guess this function should be in the os.path module. -- ___ Python tracker

[issue33018] Improve issubclass() error checking and message

2018-03-21 Thread Guido van Rossum
Guido van Rossum added the comment: OTOH if we don't do this now, it's not going to be any easier to make this change in 3.8. Maybe now's the time to experiment with it, and we can drop it in rc1 if it causes problems. @Ivan, your thoughts? Would you merge this into master?

[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2018-03-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is possible to make the compiler producing warnings for such kind of errors. The following sample patch does this. I'm not sure it is worth to do. -- nosy: +serhiy.storchaka ___

[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2018-03-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch Added file: https://bugs.python.org/file47496/compile-warnings.diff ___ Python tracker

[issue25345] Unable to install Python 3.5 on Windows 10

2018-03-21 Thread Arran McCutcheon
Arran McCutcheon added the comment: No problem Steve, I found the solution! I downloaded 'Windows Repair' from tweaking.com, and then used it to repair only the MSI installer. So I've now installed Python correctly. Thanks again for your help! --

[issue33103] Syntax to get multiple arbitrary items from an iterable

2018-03-21 Thread AmjadHD
AmjadHD added the comment: Yes that's a way to do it but "a, b, c = my_list[1, 3, -1]" seems so pythonic and straight forward, it's like formatting, python had already 3 methods to do it when it introduced a 4th one (f-strings), easier is better especially in

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-21 Thread Nick Coghlan
Nick Coghlan added the comment: Thinking about PySys_AddWarnOptionUnicode a little further, I'm not sure we actually need to change anything in the implementation there - I think we can just make it clearer in the docs that *only* PySys_AddWarnOption is supported prior to

[issue28247] Add an option to zipapp to produce a Windows executable

2018-03-21 Thread Cheryl Sabella
Change by Cheryl Sabella : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

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

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

2018-03-21 Thread Nick Coghlan
Nick Coghlan added the comment: Over in https://bugs.python.org/issue33053#msg314192, I came up with `--basepath ` as another possible spelling (`--no-basepath` would then be an option for turning it off. The main argument *against* that name is that we use "base" to mean

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

2018-03-21 Thread Nick Coghlan
Nick Coghlan added the comment: (Adding the other import system maintainers to the nosy list, along with Ned as the release manager for 3.6 and 3.7) Summarizing my current thoughts on this: I think the fact that "-m" currently adds the empty directory as sys.path[0]

[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-03-21 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'm fairly sure this is expected behavior on macOS: _tkinter loads the Tk library, which loads Apple GUI frameworks. Those frameworks are not save w.r.t. fork(2) and that can lead to all kinds of unwanted behavior (although I would

[issue23239] SSL match_hostname does not accept IP Address

2018-03-21 Thread Christian Heimes
Christian Heimes added the comment: #32819 and #32185 have solved the last outstanding bugs with IP address validation and handling. I'm fine with a backport of the feature to 2.7 now. -- assignee: christian.heimes -> versions: -Python 3.5, Python 3.6, Python 3.7

[issue32896] Error when subclassing a dataclass with a field that uses a defaultfactory

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks again for the bug report. This ended up being a simple fix, but an important one. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32896] Error when subclassing a dataclass with a field that uses a defaultfactory

2018-03-21 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 22136c94b6e43c8c584a54f3a513b83b753b96ee by Eric V. Smith (Miss Islington (bot)) in branch '3.7': bpo-32896: Fix error when subclassing a dataclass with a field that uses a default_factory (GH-6170) (GH-6171)

[issue32506] dataclasses: no need for OrderedDict now that dict guarantees to keep insertion order

2018-03-21 Thread Eric V. Smith
Change by Eric V. Smith : -- dependencies: -Dict order is now guaranteed, so add tests and doc for it resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33113] Query performance is very low and can even lead to denial of service

2018-03-21 Thread Xiang Zhang
Change by Xiang Zhang : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue33113] Query performance is very low and can even lead to denial of service

2018-03-21 Thread guohui
New submission from guohui : I found a issue in regex (findall search)function, when seaching some content by some pattern, the function return for a long long time, match performance is very low. I think this issue could lead to too low query performance, or a attacker may