[issue46073] ast.unparse produces: 'FunctionDef' object has no attribute 'lineno' for valid module

2021-12-14 Thread Brian Carlson
Brian Carlson added the comment: I don't think passing `lineno` and `column` is preferred. It makes code generation harder because `lineno` and `column` are hard to know ahead of when code is being unparsed. -- ___ Python tracker &

[issue46073] ast.unparse produces: 'FunctionDef' object has no attribute 'lineno' for valid module

2021-12-14 Thread Brian Carlson
Brian Carlson added the comment: The second solution seems more optimal, in my opinion. I monkey patched the function like this in my own code: ``` def get_type_comment(self, node): comment = self._type_ignores.get(node.lineno) if hasattr(node, "lineno") else node.type_comm

[issue46073] ast.unparse produces: 'FunctionDef' object has no attribute 'lineno' for valid module

2021-12-14 Thread Brian Carlson
New submission from Brian Carlson : Test file linked. When unparsing the output from ast.parse on a simple class, unparse throws an error: 'FunctionDef' object has no attribute 'lineno' for a valid class and valid AST. It fails when programmatically building the module AS

[issue37699] Explicit mention of raised ValueError's after .detach() of underlying IO buffer

2021-11-29 Thread Brian Skinn
Brian Skinn added the comment: Indeed, I hadn't been thinking about the testing/maintenance burden to CPython or other implementations when I made the suggestion. I no longer have a strong opinion about this change, so I am happy to reject/close. -- resolution: -> reject

[issue45833] NamedTemporaryFile deleted before enclosing context manager exit

2021-11-17 Thread Brian McCutchon
New submission from Brian McCutchon : Consider the following code: # Copyright 2021 Google LLC. # SPDX-License-Identifier: Apache-2.0 import contextlib import os @contextlib.contextmanager def my_tmp_file(): with tempfile.NamedTemporaryFile('w') as f: yield f os.stat(m

[issue45391] 3.10 objects.inv classifies UnionType as data

2021-10-06 Thread Brian Skinn
Brian Skinn added the comment: Identifiers starting with two uppercase letters returns a HUGE list. >>> pat2 = re.compile(r"([.][A-Z][A-Z])[^.]*$") Filtering down by only those that contain.lower() "type": >>> pprint([obj.name for obj in inv.objec

[issue45391] 3.10 objects.inv classifies UnionType as data

2021-10-06 Thread Brian Skinn
Brian Skinn added the comment: If I understand the problem correctly, these mis-attributions of roles (to 'data' instead of 'class' come about when a thing that is technically a class is defined in source using simple assignment, as with UnionType. Problematic entries

[issue40027] re.sub inconsistency beginning with 3.7

2021-09-22 Thread Brian
Brian added the comment: txt = ' test' txt = re.sub(r'^\s*', '^', txt) substitutes once because the * is greedy. txt = ' test' txt = re.sub(r'^\s*?', '^', txt) substitutes twice, consistent with the \Z behavior. -- __

[issue40027] re.sub inconsistency beginning with 3.7

2021-09-22 Thread Brian
Brian added the comment: I just ran into this change in behavior myself. It's worth noting that the new behavior appears to match perl's behavior: # perl -e 'print(("he" =~ s/e*\Z/ah/rg), "\n")' hahah -- nosy: +bsammon __

[issue45151] Logger library with task scheduler

2021-09-09 Thread Brian Hunt
New submission from Brian Hunt : Version: Python 3.9.3 Package: Logger + Windows 10 Task Scheduler Error Msg: None Behavior: I built a logging process to use with a python script that will be scheduled with Windows 10 task scheduler (this could be a bug in task scheduler too, but starting

[issue44992] functools.lru_cache does not guarantee cache hits for equal values

2021-08-24 Thread Brian Lee
Brian Lee added the comment: Thanks for clarifying - I see now that the docs specifically call out the lack of guarantees here with "usually but not always regard them as equivalent". I did want to specifically explain the context of my bug; 1. NumPy's strings have some unex

[issue44992] functools.lru_cache does not consider strings and numpy strings as equivalent

2021-08-24 Thread Brian Lee
New submission from Brian Lee : This seems like unexpected behavior: Two keys that are equal and have equal hashes should yield cache hits, but they do not. Python 3.9.6 (default, Aug 18 2021, 19:38:01) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help", "copyright", &

[issue44819] assertSequenceEqual does not use _getAssertEqualityFunc

2021-08-04 Thread Brian
Brian added the comment: I've attached an example of what I want. It contains a class, a function to be tested, and a test class which tests the function. What TestCase.addTypeEqualityFunc feels like it offers is a chance to compare objects however I feel like is needed for each

[issue44819] assertSequenceEqual does not use _getAssertEqualityFunc

2021-08-03 Thread Brian
New submission from Brian : Like the title says, TestCase.assertSequenceEqual does not behave like TestCase.assertEqual where it uses TestCase._getAssertEqualityFunc. Instead, TestCase.assertSequenceEqual uses `item1 != item2`. That way I can do something like this: ``` def test_stuff(self

[issue44476] "subprocess not supported for isolated subinterpreters" when running venv

2021-06-21 Thread Brian Curtin
Brian Curtin added the comment: I think there was either something stale that got linked wrong or some other kind of build failure, as I just built v3.10.0b3 tag again from a properly cleaned environment and this is no longer occurring. Sorry for the noise. -- stage: -> resol

[issue44476] "subprocess not supported for isolated subinterpreters" when running venv

2021-06-21 Thread Brian Curtin
Brian Curtin added the comment: Hmm. I asked around about this and someone installed 3.10.0-beta3 via pyenv and this worked fine. For whatever it's worth, this was built from source on OS X 10.14.6 via a pretty normal setup of `./configure` with no extra flags and then `make in

[issue44476] "subprocess not supported for isolated subinterpreters" when running venv

2021-06-21 Thread Brian Curtin
New submission from Brian Curtin : I'm currently trying to run my `tox` testing environment—all of which runs under `coverage`—against 3.10b3 and am running into some trouble. I initially thought it was something about tox or coverage, but it looks lower level than that as the venv scri

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2021-02-19 Thread Brian Hulette
Brian Hulette added the comment: Hey there, I just came across this bug when looking into a problem with corrupted pyc files. Was the patch ever applied? I'm still seeing the original behavior in Python 3.7. Thanks! -- nosy: +hulettbh ___ P

[issue42974] tokenize reports incorrect end col offset and line string when input ends without explicit newline

2021-01-20 Thread Brian Romanowski
Brian Romanowski added the comment: I took a look at Parser/tokenizer.c. From what I can tell, the tokenizer does fake a newline character when the input buffer does not end with actual newline characters and that the returned NEWLINE token has an effective length of 1 because of this

[issue42974] tokenize reports incorrect end col offset and line string when input ends without explicit newline

2021-01-20 Thread Brian Romanowski
Brian Romanowski added the comment: Shoot, just realized that consistency isn't the important thing here, the most important thing is that the tokenizer module exactly matches the output of the Python tokenizer. It's possible that my changes violate that constraint, I'll

[issue42974] tokenize reports incorrect end col offset and line string when input ends without explicit newline

2021-01-19 Thread Brian Romanowski
Change by Brian Romanowski : -- keywords: +patch pull_requests: +23085 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24260 ___ Python tracker <https://bugs.python.org/issu

[issue42974] tokenize reports incorrect end col offset and line string when input ends without explicit newline

2021-01-19 Thread Brian Romanowski
New submission from Brian Romanowski : The tokenize module's tokenizer functions output incorrect (or at least misleading) information when the content being tokenized does not end in a line ending character. This is related to the fix for issue<33899> which added the NEWLINE

[issue36702] test_dtrace failed

2020-12-23 Thread Brian Costlow
Brian Costlow added the comment: There are actually two different issues here. dtrace -q will not work on Fedora-based linux (haven't tried elsewhere) and that probably should be corrected, but that is NOT what causes the test fail. The tests' setup checks whether dtrace is us

[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-27 Thread Brian Kohan
Brian Kohan added the comment: I concur with Gregory. It seems that the action here is to just make it apparent in the docs the very real possibility of false positives. In my experience processing data from the wild, I see a pretty high rate of about 1/1000. I'm sure the probability

[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-22 Thread Brian Kohan
Brian Kohan added the comment: Hi all, I'm experiencing the same issue. I took a look at the is_zipfile code - seems like its not checking the start of the file for the magic numbers, but looking deeper in. I presume because the magic numbers at the start are considered unreliable for

[issue37426] getpass.getpass not working with on windows when ctrl+v is used to enter the string

2020-08-23 Thread Brian Rutledge
Brian Rutledge added the comment: In addition to Ctrl+V, Shift+Insert also doesn't work. This behavior is the same Command Prompt and PowerShell on Windows 10. Workarounds include: - Clicking `Edit > Paste` from the window menu - Enabling `Properties > Options > Use Ctrl+Shi

[issue29269] test_socket failing in solaris

2020-08-03 Thread Brian Vandenberg
Brian Vandenberg added the comment: I accidentally hit submit too early. I tried changing the code in posixmodule.c to use lseek(), something like the following: offset = lseek( in, 0, SEEK_CUR ); do { ret = sendfile(...); } while( ... ); lseek( in, offset, SEEK_SET ); ... however, in

[issue29269] test_socket failing in solaris

2020-08-03 Thread Brian Vandenberg
Brian Vandenberg added the comment: Christian, you did exactly what I needed. Thank you. I don't have the means to do a git bisect to find where it broke. It wasn't a problem around 3.3 timeframe and I'm not sure when this sendfile stuff was implemented. The man page fo

[issue29269] test_socket failing in solaris

2020-08-02 Thread Brian Vandenberg
Brian Vandenberg added the comment: Solaris will be around for at least another 10-15 years. The least you could do is look into it and offer some speculations. -- ___ Python tracker <https://bugs.python.org/issue29

[issue41086] Exception for uninstantiated interpolation (configparser)

2020-06-22 Thread Brian Faherty
New submission from Brian Faherty : The ConfigParser in Lib has a parameter called `interpolation`, that expects an instance of a subclass of Interpolation. However, when ConfigParser is given an argument of an uninstantiated subclass of Interpolation, the __init__ function of ConfigParser

[issue39685] Python 3.8 regression Socket operation on non-socket

2020-05-28 Thread Brian May
Brian May added the comment: Consensus seems to be that this is a bug in sshuttle, not a bug in python. Thanks for the feedback. I think this bug can be closed now... -- ___ Python tracker <https://bugs.python.org/issue39

[issue40406] MagicMock __aenter__ should be AsyncMock(return_value=MagicMock())

2020-05-01 Thread Brian Curtin
Brian Curtin added the comment: graingert: Do you have a workaround for this? I'm doing roughly the same thing with an asyncpg connection pool nested with a transaction and am getting nowhere. async with pg_pool.acquire() as conn: async with conn.transa

[issue40274] 3D plotting library doesn't occlude objects by depth/perspective (objects in the scene are printed in layers).

2020-04-13 Thread Brian O'Sullivan
Brian O'Sullivan added the comment: matplotlib yes Will do. -- resolution: third party -> status: closed -> open ___ Python tracker <https://bugs.python.

[issue40274] 3D plotting library doesn't occlude objects by depth/perspective (objects in the scene are printed in layers).

2020-04-13 Thread Brian O'Sullivan
New submission from Brian O'Sullivan : 3D plotting library doesn't occlude objects by depth/perspective. When the figure is regenerated during the animation, each additional line and points is printed on top of the prior lines and points. Bug resolution: - incorporate occlusions

[issue39645] Expand concurrent.futures.Future's public API

2020-03-02 Thread Brian Quinlan
Brian Quinlan added the comment: I'll try to take a look at this before the end of the week, but I'm currently swamped with other life stuff :-( -- ___ Python tracker <https://bugs.python.o

[issue39685] Python 3.8 regression Socket operation on non-socket

2020-02-18 Thread Brian May
New submission from Brian May : After upgrading to Python 3.8, users of sshuttle report seeing this error: Traceback (most recent call last): File "", line 1, in File "assembler.py", line 38, in File "sshuttle.server", line 298, in main File "/usr

[issue39205] Hang when interpreter exits after ProcessPoolExecutor.shutdown(wait=False)

2020-01-27 Thread Brian Quinlan
Brian Quinlan added the comment: New changeset 884eb89d4a5cc8e023deaa65001dfa74a436694c by Brian Quinlan in branch 'master': bpo-39205: Tests that highlight a hang on ProcessPoolExecutor shutdown (#18221) https://github.com/python/cpython/commit/884eb89d4a5cc8e023deaa65001dfa

[issue39205] Hang when interpreter exits after ProcessPoolExecutor.shutdown(wait=False)

2020-01-27 Thread Brian Quinlan
Change by Brian Quinlan : -- keywords: +patch pull_requests: +17601 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18221 ___ Python tracker <https://bugs.python.org/issu

[issue39251] outdated windows store links in WindowsApps folder

2020-01-07 Thread Brian McKim
New submission from Brian McKim : When I uninstalled the windows store version 3.8 it appears to have placed two links in my \AppData\Local\Microsoft\WindowsApps folder (though they may have always been there), python.exe and python3.exe. When I run these in PowerShell both send me to the

[issue39205] Hang when interpreter exits after ProcessPoolExecutor.shutdown(wait=False)

2020-01-03 Thread Brian Quinlan
New submission from Brian Quinlan : ``` from concurrent.futures import ProcessPoolExecutor import time t = ProcessPoolExecutor(max_workers=3) t.map(time.sleep, [1,2,3]) t.shutdown(wait=False) ``` Results in this exception and then a hang (i.e. Python doesn't terminate): ``` Excepti

[issue38923] Spurious OSError "Not enough memory resources" when allocating memory using multiprocessing.RawArray

2019-11-26 Thread Brian Kardon
Brian Kardon added the comment: Ah, thank you so much! That makes sense. I'll have to switch to 64-bit python. I've marked this as closed - hope that's the right thing to do here. -- resolution: -> not a bug stage: -> resolved s

[issue38923] Spurious OSError "Not enough memory resources" when allocating memory using multiprocessing.RawArray

2019-11-26 Thread Brian Kardon
New submission from Brian Kardon : When I try to create a series of multiprocessing.RawArray objects, I get an "OSError: Not enough memory resources are available to process this command". However, by my calculations, the total amount of memory I'm trying to allocate is just

[issue38478] inspect.signature.bind does not correctly handle keyword argument with same name as positional-only parameter

2019-10-14 Thread Brian Shaginaw
New submission from Brian Shaginaw : >>> import inspect >>> def foo(bar, /, **kwargs): ... print(bar, kwargs) ... >>> foo(1, bar=2) 1 {'bar': 2} >>> inspect.signature(foo).bind(1, bar=2) Traceback (most recent call last): File "", l

[issue38029] Should io.TextIOWrapper raise an error at instantiation if a StringIO is passed as 'buffer'?

2019-09-04 Thread Brian Skinn
New submission from Brian Skinn : If I read the docs correctly, io.TextIOWrapper is meant to provide a str-typed interface to an underlying bytes stream. If a TextIOWrapper is instantiated with the underlying buffer=io.StringIO(), it breaks: >>> import io >>> tw

[issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line

2019-08-09 Thread Brian Skinn
Brian Skinn added the comment: On reflection, it would probably be better to limit the ELLIPSIS to 3 or 4 periods ('[.]{3,4}'); otherwise, it would be impossible to express an ellipsis followed by a period in a 'want'. -- __

[issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line

2019-08-09 Thread Brian Skinn
Brian Skinn added the comment: I suppose one alternative solution might be to tweak the ELLIPSIS feature of doctest, such that it would interpret a run of >=3 periods in a row (matching regex pattern of "[.]{3,}") as 'ellipsis'. The regex for PS2 could then have a n

[issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line

2019-08-09 Thread Brian Skinn
Brian Skinn added the comment: Mm, agreed--that regex wouldn't be hard to write. The problem is, AFAICT there's irresolvable syntactic ambiguity in a line starting with exactly three periods, if the doctest PS2 specification is not constrained to be exactly "... &q

[issue37699] Explicit mention of raised ValueError's after .detach() of underlying IO buffer

2019-07-28 Thread Brian Skinn
New submission from Brian Skinn : Once the underlying buffer/stream is .detach()ed from an instance of a subclass of TextIOBase or BufferedIOBase, accession of most attributes defined on TextIOBase/BufferedIOBase or the IOBase parent, as well as calling of most methods defined on TextIOBase

[issue37699] Explicit mention of raised ValueError's after .detach() of underlying IO buffer

2019-07-28 Thread Brian Skinn
Change by Brian Skinn : -- type: enhancement -> behavior ___ Python tracker <https://bugs.python.org/issue37699> ___ ___ Python-bugs-list mailing list Un

[issue31783] Race condition in ThreadPoolExecutor when scheduling new jobs while the interpreter shuts down

2019-07-01 Thread Brian Quinlan
Brian Quinlan added the comment: Can I add "needs backport to 3.8" and "needs backport to 3.7" labels now or do I have to use cherry_picker at this point? On Mon, Jul 1, 2019 at 3:55 PM Ned Deily wrote: > > Ned Deily added the comment: > > > I don't

[issue31783] Race condition in ThreadPoolExecutor when scheduling new jobs while the interpreter shuts down

2019-07-01 Thread Brian Quinlan
Brian Quinlan added the comment: I don't know what the backport policy is. The bug is only theoretical AFAIK i.e. someone noticed it through code observation but it has not appeared in the wild. On Mon, Jul 1, 2019 at 3:25 PM Ned Deily wrote: > > Ned Deily added the comment

[issue31783] Race condition in ThreadPoolExecutor when scheduling new jobs while the interpreter shuts down

2019-06-28 Thread Brian Quinlan
Change by Brian Quinlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue31783] Race condition in ThreadPoolExecutor when scheduling new jobs while the interpreter shuts down

2019-06-28 Thread Brian Quinlan
Brian Quinlan added the comment: New changeset 242c26f53edb965e9808dd918089e664c0223407 by Brian Quinlan in branch 'master': bpo-31783: Fix a race condition creating workers during shutdown (#13171) https://github.com/python/cpython/commit/242c26f53edb965e9808dd918089e6

[issue37294] concurrent.futures.ProcessPoolExecutor and multiprocessing.pool.Pool fail with super

2019-06-28 Thread Brian Quinlan
Change by Brian Quinlan : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> function changed when pickle bound method object ___ Python tracker <https://bugs.python

[issue37208] Weird exception behaviour in ProcessPoolExecutor

2019-06-28 Thread Brian Quinlan
Change by Brian Quinlan : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue37208> ___ ___ Python-bugs-list

[issue37208] Weird exception behaviour in ProcessPoolExecutor

2019-06-14 Thread Brian Quinlan
Change by Brian Quinlan : -- resolution: -> duplicate superseder: -> picke cannot dump Exception subclasses with different super() args ___ Python tracker <https://bugs.python.org/i

[issue37287] picke cannot dump Exception subclasses with different super() args

2019-06-14 Thread Brian Quinlan
Change by Brian Quinlan : -- title: picke cannot dump exceptions subclasses with different super() args -> picke cannot dump Exception subclasses with different super() args ___ Python tracker <https://bugs.python.org/issu

[issue37287] picke cannot dump exceptions subclasses with different super() args

2019-06-14 Thread Brian Quinlan
New submission from Brian Quinlan : $ ./python.exe nopickle.py TypeError: __init__() missing 1 required positional argument: 'num' The issue is that the arguments passed to Exception.__init__ (via `super()`) are collected into `args` and then serialized by pickle e.g. >>&

[issue37208] Weird exception behaviour in ProcessPoolExecutor

2019-06-14 Thread Brian Quinlan
Brian Quinlan added the comment: That's a super interesting bug! It looks like this issue is that your exception can't be round-tripped using pickle i.e. >>> class PoolBreaker(Exception): ... def __init__(self, num): ... super().__init__() ...

[issue24980] Allow for providing 'on_new_thread' callback to 'concurrent.futures.ThreadPoolExecutor'

2019-06-14 Thread Brian Quinlan
Brian Quinlan added the comment: Joshua, I'm closing this since I haven't heard from you in a month. Please re-open if you use case isn't handled by `initializer` and `initargs`. -- assignee: -> bquinlan resolution: -> out of date stage: -> resolve

[issue37134] Use PEP570 syntax in the documentation

2019-06-06 Thread Brian Skinn
Brian Skinn added the comment: :thumbsup: Glad I happened to be in the right place at the right time to put it together. I'll leave the tabslash repo up for future reference. -- ___ Python tracker <https://bugs.python.org/is

[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread Brian Skinn
Brian Skinn added the comment: Brett, to be clear, this sounds like the tabbed solution is not going to be used at this point? If so, I'll pull down the tabbed docs I'm hosting. -- ___ Python tracker <https://bugs.python.o

[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread Brian Skinn
Brian Skinn added the comment: First, for anyone interested, there are screenshots and links to docs versions at the SC GH issue (https://github.com/python/steering-council/issues/12#issuecomment-498856524, and following) where we're exploring what the tabbed approach to the PEP570

[issue37134] [EASY] Use PEP570 syntax in the documentation

2019-06-04 Thread Brian Skinn
Change by Brian Skinn : -- nosy: +bskinn ___ Python tracker <https://bugs.python.org/issue37134> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37084] _ctypes not failing, can't find reason

2019-05-28 Thread Brian Spratke
New submission from Brian Spratke : I am trying to cross compile Python 3.7 for Android. I have Python building, but I keep getting an error that _ctypes failed to build, but I see nothing that jumps out as a reason. _ctypes_test builds, before that I see this INFO message INFO: Can&#

[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-09 Thread Brian Quinlan
Brian Quinlan added the comment: We can bike shed over the name in the PR ;-) -- ___ Python tracker <https://bugs.python.org/issue36780> ___ ___ Python-bug

[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2019-05-09 Thread Brian Quinlan
Change by Brian Quinlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue32679] concurrent.futures should store full sys.exc_info()

2019-05-09 Thread Brian Quinlan
Brian Quinlan added the comment: My understanding is that tracebacks have a pretty large memory profile so I'd rather not keep them alive. Correct me if I'm wrong about that. -- ___ Python tracker <https://bugs.python.o

[issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers

2019-05-08 Thread Brian Quinlan
Brian Quinlan added the comment: After playing with it for a while, https://github.com/python/cpython/pull/6375 seems reasonable to me. It needs tests and some documentation. Antoine, are you still -1 because of the complexity increase

[issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers

2019-05-08 Thread Brian Quinlan
Brian Quinlan added the comment: When I first wrote and started using ThreadPoolExecutor, I had a lot of code like this: with ThreadPoolExecutor(max_workers=500) as e: e.map(download, images) I didn't expect that `images` would be a large list but, if it was, I wanted all o

[issue30006] Deadlocks in `concurrent.futures.ProcessPoolExecutor`

2019-05-08 Thread Brian Quinlan
Brian Quinlan added the comment: Was this fixed by https://github.com/python/cpython/pull/3895 ? -- ___ Python tracker <https://bugs.python.org/issue30

[issue36395] Add deferred single-threaded/fake executor to concurrent.futures

2019-05-08 Thread Brian Quinlan
Brian Quinlan added the comment: Brian, I was looking for an example where the current executor isn't sufficient for testing i.e. a useful test that would be difficult to write with a real executor but would be easier with a fake. Maybe you have such an example from your

[issue31783] Race condition in ThreadPoolExecutor when scheduling new jobs while the interpreter shuts down

2019-05-07 Thread Brian Quinlan
Change by Brian Quinlan : -- pull_requests: +13087 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31783> ___ ___ Python-bugs-list mai

[issue31783] Race condition in ThreadPoolExecutor when scheduling new jobs while the interpreter shuts down

2019-05-07 Thread Brian Quinlan
Brian Quinlan added the comment: I think that ProcessPoolExecutor might have a similar race condition - but not in exactly this code path since it would only be with the queue management thread (which is only started once). -- ___ Python tracker

[issue36395] Add deferred single-threaded/fake executor to concurrent.futures

2019-05-07 Thread Brian McCutchon
Brian McCutchon added the comment: No, I do not have such an example, as most of my tests try to fake the executors. -- ___ Python tracker <https://bugs.python.org/issue36

[issue31783] Race condition in ThreadPoolExecutor when scheduling new jobs while the interpreter shuts down

2019-05-07 Thread Brian Quinlan
Brian Quinlan added the comment: Great report Steven! I was able to reproduce this with the attached patch (just adds some sleeps and prints) and this script: from threading import current_thread from concurrent.futures import ThreadPoolExecutor from time import sleep pool

[issue31783] Race condition in ThreadPoolExecutor when scheduling new jobs while the interpreter shuts down

2019-05-07 Thread Brian Quinlan
Change by Brian Quinlan : -- assignee: -> bquinlan ___ Python tracker <https://bugs.python.org/issue31783> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue22729] concurrent.futures `wait` and `as_completed` depend on private api

2019-05-07 Thread Brian Quinlan
Brian Quinlan added the comment: How did the experiment go? Are people still interested in this? -- ___ Python tracker <https://bugs.python.org/issue22

[issue22630] `concurrent.futures.Future.set_running_or_notify_cancel` does not notify cancel

2019-05-07 Thread Brian Quinlan
Brian Quinlan added the comment: Ben, do you still think that your patch is relevant or shall we close this bug? -- ___ Python tracker <https://bugs.python.org/issue22

[issue24980] Allow for providing 'on_new_thread' callback to 'concurrent.futures.ThreadPoolExecutor'

2019-05-07 Thread Brian Quinlan
Brian Quinlan added the comment: Do the `initializer` and `initargs` parameters deal with this use case for you? https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor -- ___ Python tracker <ht

[issue24767] can concurrent.futures len(Executor) return the number of tasks?

2019-05-07 Thread Brian Quinlan
Brian Quinlan added the comment: If we supported this, aren't we promising that we will always materialize the iterator passed to map? I think that we'd need a really strong use-case for this to be worth-while. -- ___ Python track

[issue36395] Add deferred single-threaded/fake executor to concurrent.futures

2019-05-07 Thread Brian Quinlan
Brian Quinlan added the comment: Hey Brian, I understand the non-determinism. I was wondering if you had a non-theoretical example i.e. some case where the non-determinism had impacted a real test that you wrote? -- ___ Python tracker <ht

[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-07 Thread Brian Quinlan
Brian Quinlan added the comment: Hey Hrvoje, I agree that #1 is the correct approach. `disown` might not be the best name - maybe `allow_shutdown` or something. But we can bike shed about that later. Are you interested in writing a patch

[issue36395] Add deferred single-threaded/fake executor to concurrent.futures

2019-05-06 Thread Brian McCutchon
Brian McCutchon added the comment: I understand your hesitation to add a fake. Would it be better to make it possible to subclass Executor so that a third party implementation of this can be developed? As for an example, here is an example of nondeterminism when using a ThreadPoolExecutor

[issue24195] Add `Executor.filter` to concurrent.futures

2019-05-06 Thread Brian Quinlan
Brian Quinlan added the comment: Hey Ethan, I'm really sorry about dropping the ball on this. I've been burnt out on Python stuff for the last couple of years. When we left this, it looked like the -1s were in the majority and no one new has jumped on to support `filter`. If you

[issue23697] Module level map & submit for concurrent.futures

2019-05-06 Thread Brian Quinlan
Brian Quinlan added the comment: Using a default executor could be dangerous because it could lead to deadlocks. For example: mylib.py def my_func(): tsubmit(...) tsubmit(...) tsubmit(somelib.some_func, ...) somelib.py -- def some_func(): tsubmit(...) # Potential

[issue22361] Ability to join() threads in concurrent.futures.ThreadPoolExecutor

2019-05-06 Thread Brian Quinlan
Brian Quinlan added the comment: So you actually use the result of ex.submit i.e. use the resulting future? If you don't then it might be easier to just create your own thread. -- ___ Python tracker <https://bugs.python.org/is

[issue36395] Add deferred single-threaded/fake executor to concurrent.futures

2019-05-06 Thread Brian McCutchon
Brian McCutchon added the comment: Mostly nondeterminism. It seems like creating a ThreadPoolExecutor with one worker could still be nondeterministic, as there are two threads: the main thread and the worker thread. It gets worse if multiple executors are needed. Another option would be to

[issue36395] Add deferred single-threaded/fake executor to concurrent.futures

2019-05-06 Thread Brian Quinlan
Brian Quinlan added the comment: Do you have a example that you could share? I can't think of any other fakes in the standard library and I'm hesitant to be the person who adds the first one ;-) -- ___ Python tracker <https://bu

[issue26374] concurrent_futures Executor.map semantics better specified in docs

2019-05-06 Thread Brian Quinlan
Change by Brian Quinlan : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue26374> ___ ___ Python-bugs-list

[issue26374] concurrent_futures Executor.map semantics better specified in docs

2019-05-06 Thread Brian Quinlan
Brian Quinlan added the comment: Can we close this bug then? -- ___ Python tracker <https://bugs.python.org/issue26374> ___ ___ Python-bugs-list mailin

[issue36395] Add deferred single-threaded/fake executor to concurrent.futures

2019-05-06 Thread Brian Quinlan
Brian Quinlan added the comment: Hey Brian, why can't you use threads in your unit tests? Are you worried about non-determinism or resource usage? Could you make a ThreadPoolExecutor with a single worker? -- ___ Python tracker &

[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2019-05-06 Thread Brian Quinlan
Change by Brian Quinlan : -- keywords: +patch pull_requests: +13045 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-06 Thread Brian Quinlan
Brian Quinlan added the comment: OK, I completely disagree with my statement: """If you added this as an argument to shutdown() then you'd probably also have to add it as an option to the constructors (for people using Executors as context managers). But, if you h

[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2019-05-06 Thread Brian Quinlan
Brian Quinlan added the comment: BTW, the 61 process limit comes from: 63 - - -- ___ Python tracker <https://bugs.python.org/issue26903> ___ ___ Python-bug

[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2019-05-06 Thread Brian Quinlan
Change by Brian Quinlan : -- assignee: -> bquinlan ___ Python tracker <https://bugs.python.org/issue26903> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2019-05-06 Thread Brian Quinlan
Brian Quinlan added the comment: If no one has short-term plans to improve multiprocessing.connection.wait, then I'll update the docs to list this limitation, ensure that ProcessPoolExecutor never defaults to >60 processes on windows and raises a ValueError if the user explicitly

[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-06 Thread Brian Quinlan
Brian Quinlan added the comment: >> The current behavior is explicitly documented, so presumably >> it can't be (easily) changed And it isn't clear that it would be desirable to change this even if it were possible - doing structured resource clean-up seems consi

[issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line

2019-04-26 Thread Brian Skinn
Brian Skinn added the comment: Ahh, this *will* break some doctests: any with blank PS2 lines in the 'source' portion without the explicit trailing space: 1] >>> def foo(): 2] ...print("bar") 3] ... 4] ...print("baz") 5] >>>

[issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning

2019-04-24 Thread Brian Skinn
Brian Skinn added the comment: LOL. No special thanks necessary, that last post only turned into something coherent (and possibly correct, it seems...) after a LOT of diving into the source, fiddling with the code, and (((re-)re-)re-)writing! Believe me, it reads as a lot more knowledgeable

  1   2   3   4   5   6   7   8   9   10   >