[issue36669] weakref proxy doesn't support the matrix multiplication operator

2019-04-19 Thread Dan Snider
Change by Dan Snider : -- nosy: bup priority: normal severity: normal status: open title: weakref proxy doesn't support the matrix multiplication operator ___ Python tracker <https://bugs.python.org/is

[issue36807] IDLE doesn't call os.fsync()

2019-05-06 Thread Dan Halbert
Dan Halbert added the comment: I'm one of the CircuitPython core devs. This issue is OS-dependent: Windows and Linux don't necessarily write data and metadata out to USB drives promptly. The problem is particularly acute for FAT12 filesystems on Windows, which are typically 16MB

[issue36846] range_iterator does not use __index__

2019-05-07 Thread Dan Snider
New submission from Dan Snider : I wouldn't even know where to begin to try and find a palatable solution for this that wouldn't be summarily dismissed. Perhaps it isn't unreasonable to suggest PyNumber_Index shouldn't use the less stringent PyLong_Check as the entry to

[issue36807] IDLE doesn't call os.fsync()

2019-05-07 Thread Dan Halbert
Dan Halbert added the comment: >Dan, slightly OT, but I am curious whether one can access USB ports (in a >system-dependent manner) directly from python code via os.system and ctypes? Do you mean from CircuitPython? The USB impplementation provides HID keyboard, mouse, and gamepad d

[issue36807] IDLE doesn't call os.fsync()

2019-05-12 Thread Dan Halbert
Dan Halbert added the comment: Fix tested and works! Comment from PR duplicated here. I tested this fix by editing the 3.7.3 IDLE code by hand, and editing this test program as code.py on a CIRCUITPY drive on Windows 10: import time i = 0 while True: print(i) i += 1 print

[issue32575] IDLE cannot locate certain SyntaxErrors raised by f-string expressions

2018-01-16 Thread Dan Snider
New submission from Dan Snider : For example the following f-string f'{1):.1%}' IDLE will scroll to the top of the file and highlight a random and irrelevant line (not sure what it's doing tbh). running the expression with `exec` makes it look like implicit parenthesis are ad

[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2018-01-26 Thread Dan Snider
New submission from Dan Snider : It doesn't even care if the result it gets from ob.__getattribute__("__class__") isn't a type. Surely `isinstance` is intended to do what it is named and be guaranteed to return True if an object `ob` is an instance of class `cls`. There

[issue33279] Py_Build value is causing crashes with the "L" and "K" format characters when upcasting sub 64-bit integer types

2018-04-14 Thread Dan Snider
New submission from Dan Snider : New to both C and the CPython api so I'm not sure what compiler details matter but this is with VS14 and default compile parameters on windows 10 with 32bit Python. The following function: static PyObject *spam(PyObject *module) { digit w = 9;

[issue33279] Py_BuildValue is causing crashes with the "L" and "K" format characters when upcasting sub 64-bit integer types

2018-04-14 Thread Dan Snider
Change by Dan Snider : -- title: Py_Build value is causing crashes with the "L" and "K" format characters when upcasting sub 64-bit integer types -> Py_BuildValue is causing crashes with the "L" and "K" format charact

[issue33386] Double clicking to select an identifier in IDLE does not work with some unicode characters

2018-04-29 Thread Dan Snider
New submission from Dan Snider : https://i.imgur.com/61sHBRR.png At least with "μ", it behaves as if it's one of the ascii characters for which id.isidentifier() returns False, as in https://i.imgur.com/XbEW0ZC.png. -- assignee: terry.reedy components: IDLE messages: 3

[issue31789] Better error message when failing to overload metaclass.mro

2017-10-14 Thread Dan Snider
New submission from Dan Snider : class meta(type): mros = (object,) def __new__(metacls, name, bases, namespace, fake_bases=()): print('entering __new__') metacls.fake_bases = fake_bases cls = type.__new__(metacls, name, bases, namespace)

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-11-29 Thread Dan Snider
New submission from Dan Snider : The following code works in 3.3, 3.4, and 3.5, but in 3.6 it throws RuntimeError: super(): bad __class__ cell. from types import FunctionType, CodeType def create_closure(__class__): return (lambda: __class__).__closure__ def new_code(c_or_f): 

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-11-30 Thread Dan Snider
Dan Snider added the comment: The hacked cell object using this method appears to be changed to NULL when accessed by frame.f_localsplus. I don't know C well enough to find out what's happening because nothing looks different to me in PyFrame_FastToLocalsWithError. Also creating

[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-12-01 Thread Dan Snider
Dan Snider added the comment: So while CO_NOFREE is set in all versions with the example code, it appears only python 3.6 recognizes that flag and disallows the accessing of the __class__ cell. In this case the error message is bad because it implies that the __class__ cell is the wrong type

[issue33814] exec() maybe has a memory leak

2018-06-09 Thread Dan Snider
New submission from Dan Snider : Sort of because I'm really not sure if it's working as intended or not. When I found this out today, I noticed that the documentation of `exec` has been updated since the last time I saw it, which is good, but it still leaves much to be desired. Sp

[issue33998] random.randrange completely ignores the step argument when stop is None

2018-06-29 Thread Dan Snider
New submission from Dan Snider : This "bug" is present even in 2.7. I have a really hard time believing that, even if it would be incredibly rare for someone to stumble upon this, may others haven't noticed this rather glaring flaw in the code. I couldn't find any similar

[issue33998] random.randrange completely ignores the step argument when stop is None

2018-06-29 Thread Dan Snider
Change by Dan Snider : -- keywords: +patch pull_requests: +7616 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33998> ___ ___ Python-

[issue34012] No option to include system headers in distutils.core.Extension

2018-06-30 Thread Dan Hemberger
New submission from Dan Hemberger : The distutils.core.Extension class has a constructor argument `include_dirs`, which includes each directory with `-I`. However, it is sometimes desirable to include additional system headers using `-isystem`. Currently, this is only possible by manually

[issue34012] No option to include system headers in distutils.core.Extension

2018-06-30 Thread Dan Hemberger
Change by Dan Hemberger : -- type: -> enhancement ___ Python tracker <https://bugs.python.org/issue34012> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue34100] Python doesn't intern integers in a tuple of constant literals

2018-07-11 Thread Dan Rose
New submission from Dan Rose : In the Python 3.7.0 interpreter, the following evaluates to False. In 3.6.4, it was True: c,d = 500,500 c is d This seems to be because, in some cases, Python 3.7 fails to intern integers inside tuples: a = (500,500) print(a[0] is a[1

[issue34100] Python doesn't intern integers in a tuple of constant literals

2018-07-11 Thread Dan Rose
Dan Rose added the comment: Another curious case: a = (500,500); b = (500,500) print(a[0] is b[0]) # True print(a[0] is b[1]) # False print(a[1] is b[0]) # False print(a[1] is b[1]) # True -- ___ Python tracker <ht

[issue34123] ambiguous documentation for dict.popitem

2018-07-15 Thread Dan Snider
New submission from Dan Snider : https://docs.python.org/3/library/stdtypes.html#dict.popitem `dict.popitem` no longer returns an "arbitrary" (key, value) pair as the documentation suggests. Rather, it always returns the pair whose key was most recently *inserted* (ie., the las

[issue34146] PyCData_Type.tp_hash doesn't use PyObject_HashNotImplemented

2018-07-18 Thread Dan Snider
New submission from Dan Snider : So not only does the function it does use (`PyCData_nohash`) prevent PyType_Ready from setting _ctypes._SimpleCData.__dict__["__hash__"] to `None`, (contrary to to every other unhashable type in the standard library) but the error message it retur

[issue34192] FunctionType.__new__ can generate functions that immediately crash

2018-07-22 Thread Dan Snider
New submission from Dan Snider : The following program crashes on 3.3.1, 3.4.2, 3.5.2, and 3.6.1 because despite having a non-empty co_cellvars slot due to the generator object, the NOFREE flag was set. 3.7 isn't immune to some bad behavior here, either. While I only have access to 3.

[issue34290] _ctypes PyCField_new doesn't do anything

2018-07-31 Thread Dan Snider
New submission from Dan Snider : The function is essentially nothing more than a prototype at the moment: static PyObject * PyCField_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { CFieldObject *obj; obj = (CFieldObject *)type->tp_alloc(type, 0); return (PyObject *)

[issue34314] Like __hash__, allow setting MyClass.__init__ to None to prevent it being called by type.__call__

2018-08-01 Thread Dan Snider
New submission from Dan Snider : Right now, you really gotta jump through hoops in some cases if you only want to use __new__ and don't care about __init__ (is there ever a time where you'd use both?). The problem originates in type.__call__. I'm attaching a full Python im

[issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty

2018-08-13 Thread Dan Snider
New submission from Dan Snider : The ones I know of are list.__getitem__, dict __contains__ & __getitem__, and (frozen)set.__contains__ but from what I can tell so far it seems like dict.__getitem__ takes the worst hit. For dicts, I've spent a few hours trying to figure out what&

[issue34497] Remove needless set operator restriction

2018-08-25 Thread Dan Snider
New submission from Dan Snider : I only just now realized that `dict.fromkeys('abc').keys() - 'bc'` returns {'a'} instead of raising an error like {*'abc'} - 'bc' would, which is really quite handy. The __xor__, __and__, and __sub__ methods

[issue34497] Remove needless set operator restriction

2018-08-25 Thread Dan Snider
Change by Dan Snider : -- keywords: +patch pull_requests: +8394 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34497> ___ ___ Python-

[issue34620] Octal byte literals with a decimal value > 255 are silently truncated

2018-09-10 Thread Dan Snider
New submission from Dan Snider : >>> b'\542\571\564\545\563', b'\142\171\164\145\163' (b'bytes', b'bytes') All the C compilers I know of at the very least generate a warning when one tries to assign an oct literal >= '\400' to a

[issue34750] locals().update doesn't work in Enum body, even though direct assignment to locals() does

2018-09-21 Thread Dan Snider
Dan Snider added the comment: It's working as intended. locals() and vars() simply returns the current frame's f_locals. In functions, modifying this usually accomplishes nothing useful because the code object has OPTIMIZED and NEWLOCALS flags set, meaning local variables are lo

[issue34842] Incorrect error messages in bisect

2018-09-29 Thread Dan Snider
New submission from Dan Snider : internal_bisect_left and internal_bisect_right use PySequence_Size when a "hi" argument wasn't provided, which causes this silly error message: >>> bisect.bisect_right(dict.fromkeys(range(10)), 5) Traceback (most recent call la

[issue34848] range.index only takes one argument when it's documented as taking the usual 3

2018-09-29 Thread Dan Snider
New submission from Dan Snider : Unfortunately, it looks like there's no requirement for an abc.Sequence to implement the 3 argument form of seq.index, so I suppose this is technically just a documentation bug... >>> range(5).index(2, 1) Traceback (most recent call last): F

[issue34848] range.index only takes one argument when it's documented as taking the usual 3

2018-09-30 Thread Dan Snider
Dan Snider added the comment: So I also just happened to notice that the "documentation is wrong" for list, tuple, and collections.deque. They use use _PyEval_SliceIndexNotNone whch causes this: >>> s = 'abcde' >>> s.index('d', 0, None) 3

[issue34887] bytes subclass __repr__ raise SystemError when set to bytes.decode

2018-10-03 Thread Dan Snider
New submission from Dan Snider : I've tested it on at least one of each minor version since 3.4 but it looks like it may be specific to 3.6.0. The developer's guide isn't clear enough for me to understand what's eligible for bug fixes but since I'm not sure if it ac

[issue34924] inspect.signature isn't aware that types.MethodType can wrap any callable

2018-10-07 Thread Dan Snider
New submission from Dan Snider : I actually noticed this due to it confusingly breaking IDLE call tips and code completion. >>> import inspect >>> from types import MethodType >>> bound_len = MethodType(len, 'abc') >>> bound_len() 3 >>&g

[issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty

2018-10-20 Thread Dan Snider
Dan Snider added the comment: Well, I found another mystery. Calling tuple.__getitem__ directly, on an actual tuple instance, is 50-80% slower than calling list.__getitem__ even though in theory, they should be virtually identical with maybe tuple access being infinitesimally be faster

[issue35048] Can't reassign __class__ despite the assigned class having identical slots

2018-10-23 Thread Dan Snider
New submission from Dan Snider : >>> class a(dict): __slots__ = '__dict__', 'x' >>> class b(dict): __slots__ = '__dict__', 'x' >>> self = a(); self.__class__ = b Traceback (most recent call last): File "", lin

[issue35146] Bad Regular Expression Broke re.findall()

2018-11-02 Thread Dan Boxall
New submission from Dan Boxall : Hi, I'm new to regular expressions and while playing around with them I tried this: >>> rex = '*New Revision:.* ([0-9]+)' >>> re.findall(rex, text) and got this: Traceback (most recent call last): File "", line

[issue35146] Bad Regular Expression Broke re.findall()

2018-11-02 Thread Dan Boxall
Dan Boxall added the comment: Thank you. I realised that and if I put a dot in front it worked fine. But it should not break the function, so they will surely want to fix the bug? Kind regards, Dan Boxall On Fri, 2 Nov 2018 at 13:56, Windson Yang wrote: > > Windson Yang added the c

[issue35146] Bad Regular Expression Broke re.findall()

2018-11-02 Thread Dan Boxall
Dan Boxall added the comment: Yes I realised that, as I said earlier. But it could say, "Invalid regular expression" and not produce ten lines of error messages. On Fri, 2 Nov 2018 at 14:21, Steven D'Aprano wrote: > > Steven D'Aprano added the comment: > >

[issue25410] Clean up and fix OrderedDict

2018-11-04 Thread Dan Snider
Dan Snider added the comment: It might be more appropriate to start a new issue for this, but I'll leave that decision to somehow who would know for sure. Anyway, basically the entire dict/PyDictObject api functions do not appear work at all with OrderedDict. Or rather, OrderedDict do

[issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict subclasses

2018-11-04 Thread Dan Snider
New submission from Dan Snider : >>> class Dict(dict): def keys(self): assert 0 def update(*args, **kwds): assert 0 def __getitem__(self, key): assert 0 def __iter__(self): assert 0 >>> {**Dict(a=1)} {'a': 1} T

[issue35176] for loop range bug

2018-11-06 Thread Dan Armentrout
New submission from Dan Armentrout : If you run the following code: x=[3,4,5] a=x for i in range(0,len(a)): a[i]=0 All x values are changed to equal a. -- components: Windows messages: 329357 nosy: darmentr, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity

[issue35176] for loop range bug

2018-11-06 Thread Dan Armentrout
Dan Armentrout added the comment: Thank you for your quick explanation of this to me. Dan On Tue, Nov 6, 2018 at 8:04 AM Steven D'Aprano wrote: > > Steven D'Aprano added the comment: > > This is not a bug, this is standard behaviour, working as designed. > > &

[issue18624] Add alias for iso-8859-8-i which is the same as iso-8859-8

2013-08-04 Thread Dan Søndergaard
Dan Søndergaard added the comment: Is it satisfactory to just add the -i and -e variants to ALIASES in charset.py? Or don't they qualify as "Aliases for other commonly-used names for character sets"? -- nosy: +das ___ Python

[issue18730] suffix parameter in NamedTemporaryFile silently fails when not prepending with a period

2013-08-13 Thread Dan Loewenherz
New submission from Dan Loewenherz: Basically, when creating a NamedTemporaryFile, passing a value to the "suffix" parameter has no effect unless it's prepended with a period. IMO, there are three options here... 1. Add a note in the documentation that this parameter only

[issue4636] bdist_wininst installer with install script raises exception

2013-09-10 Thread Dan Nicholson
Dan Nicholson added the comment: It turns out this is pretty easy to fix by just changing the stub to import builtins or __builtin__ depending on the python install version. Attached are patches that fix this for both the default and 2.7 branches. My test case is a pure python module with an

[issue4636] bdist_wininst installer with install script raises exception

2013-09-10 Thread Dan Nicholson
Changes by Dan Nicholson : Added file: http://bugs.python.org/file31716/wininst-10.0-compat.exe ___ Python tracker <http://bugs.python.org/issue4636> ___ ___ Python-bug

[issue4636] bdist_wininst installer with install script raises exception

2013-09-10 Thread Dan Nicholson
Changes by Dan Nicholson : Added file: http://bugs.python.org/file31715/wininst-compat-2.7.patch ___ Python tracker <http://bugs.python.org/issue4636> ___ ___ Python-bug

[issue4636] bdist_wininst installer with install script raises exception

2013-09-10 Thread Dan Nicholson
Changes by Dan Nicholson : Added file: http://bugs.python.org/file31717/wininst-9.0-compat-2.7.exe ___ Python tracker <http://bugs.python.org/issue4636> ___ ___ Python-bug

[issue11598] missing afxres.h error when building bdist_wininst in Visual Studio 2008 Express

2013-09-10 Thread Dan Nicholson
Dan Nicholson added the comment: Like the previous users, I've only got VS Express, so I can't tell exactly what happens when you have VS Pro and it generates the install.rc file. However, I might as well post this fuller patch, which I think would do the right thing since it also

[issue15039] module/ found before module.py when both are in the CWD

2012-06-08 Thread Dan Stromberg
New submission from Dan Stromberg : CPython 3.3a4 appears to find treap/ before treap.py in the CWD. If I rename treap to treap-dir, all seems well for the code in question: dstromberg@zareason-limbo6000a /tmp/tt $ mv treap treap-dir dstromberg@zareason-limbo6000a /tmp/tt $ /usr/local

[issue15877] xml.dom.minidom cannot parse ISO-2022-JP

2012-09-06 Thread Dan Callaghan
New submission from Dan Callaghan: Python 2.7.3 (default, Jul 24 2012, 10:05:38) [GCC 4.7.0 20120507 (Red Hat 4.7.0-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> c = u'\u65e5\u672c\u8a9e' >&

[issue16167] Allow printing of str-derived classes

2012-10-08 Thread Radu Dan
New submission from Radu Dan: Classes that extend the builtin 'str' cannot be printed as is, and are automatically converted to string. #!/bin/env python class newstring(str): def __str__(self): return self a = newstring("hello world") print a

[issue16789] :meth:`quit` links to constants instead of own module

2012-12-26 Thread Dan Kenigsberg
New submission from Dan Kenigsberg: ftplib, poplib and smtplib modules define a "quit" function. But when it is refered by :meth:`quit` in the documentation, a reference to constants.quit is generated. The suggested patch spells out the module-specific "quit" function.

[issue4636] bdist_wininst installer with install script raises exception

2013-09-15 Thread Dan Nicholson
Dan Nicholson added the comment: Right, that's what makes this difficult. If the stub exe of the target python was used, then it wouldn't need to care about compatibility. However, what you're running is the stub of the build python. So, when I distribute a bdist_wininst exe, i

[issue21903] ctypes documentation MessageBoxA example produces error

2014-07-02 Thread Dan O'Donovan
New submission from Dan O'Donovan: There is an example in the ctypes python3 documentation for producing a native Windows MessageBoxA https://docs.python.org/3.3/library/ctypes.html#ctypes.PYFUNCTYPE Try as I might, I cannot get this example to run under python 3 (it is in the py

[issue21903] ctypes documentation MessageBoxA example produces error

2014-07-02 Thread Dan O'Donovan
Dan O'Donovan added the comment: Additional note, this code snippet does work in python 2. There is a note that all snippets are tested with 'doctest' so I have added the 'tests' tag to this ticket. -- components: +Tests

[issue21903] ctypes documentation MessageBoxA example produces error

2014-07-02 Thread Dan O'Donovan
Dan O'Donovan added the comment: Ok, this fail is happening because we're using python3 unicode strings to call the ANSI MessageBoxA function. A possible fix; Encode strings before passing the MessageBoxA (ctypes.txt.diff attached) Alternatively, calls could be made to the unicode M

[issue22006] thread module documentation erroneously(?) states not all built-in functions release the GIL

2014-07-18 Thread Dan O'Reilly
New submission from Dan O'Reilly: Currently, the caveats section of the thread/_thread module has this statement in it: "Not all built-in functions that may block waiting for I/O allow other threads to run. (The most popular ones (time.sleep(), file.read(), select.select()) work a

[issue22006] thread module documentation erroneously(?) states not all built-in functions that do blocking I/O release the GIL

2014-07-18 Thread Dan O'Reilly
Changes by Dan O'Reilly : -- title: thread module documentation erroneously(?) states not all built-in functions release the GIL -> thread module documentation erroneously(?) states not all built-in functions that do blocking I/O release

[issue22025] webbrowser.get(command_line) does not support Windows-style path separators

2014-07-21 Thread Dan O'Reilly
New submission from Dan O'Reilly: Currently, when webbrowser.get() is passed a "using" argument that consists of a command line string like "C:\Users\dan\AppData\Local\Google\Chrome\Application\chrome.exe %s", it will use shlex.split(command_line) to tokenize the st

[issue22025] webbrowser.get(command_line) does not support Windows-style path separators

2014-07-21 Thread Dan O'Reilly
Dan O'Reilly added the comment: Attached is a patch for the latter approach. -- keywords: +patch Added file: http://bugs.python.org/file36014/web.patch ___ Python tracker <http://bugs.python.org/is

[issue21423] concurrent.futures.ThreadPoolExecutor should accept an initializer argument

2014-07-23 Thread Dan O'Reilly
Dan O'Reilly added the comment: It seems like everyone agrees that this functionality is useful, so I'm reviving this in hopes of getting a patch pushed through. I've updated Andreas' patch so that it applies cleanly against the latest tree, and tweaked the handl

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-23 Thread Dan O'Reilly
Dan O'Reilly added the comment: I'm seeing an even larger difference between multiprocessing.Pool and ProcessPoolExecutor on my machine, with Python 3.4: Starting multiproc...done in 2.160644769668579 s. Starting futures...done in 67.953957319259644 s. Starting futures "f

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-23 Thread Dan O'Reilly
Dan O'Reilly added the comment: Here's a patch that adds the new map implementation from the benchmark script to concurrent.futures.process. -- keywords: +patch Added file: http://bugs.python.org/file36059/map_chunksize.patch ___ Pyth

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-24 Thread Dan O'Reilly
Changes by Dan O'Reilly : Removed file: http://bugs.python.org/file36059/map_chunksize.patch ___ Python tracker <http://bugs.python.org/issue11271> ___ ___ Pytho

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-24 Thread Dan O'Reilly
Changes by Dan O'Reilly : Added file: http://bugs.python.org/file36064/map_chunksize.patch ___ Python tracker <http://bugs.python.org/issue11271> ___ ___ Pytho

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-24 Thread Dan O'Reilly
Changes by Dan O'Reilly : Removed file: http://bugs.python.org/file36058/test_mult.py ___ Python tracker <http://bugs.python.org/issue11271> ___ ___ Python-bugs-l

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-24 Thread Dan O'Reilly
Changes by Dan O'Reilly : Added file: http://bugs.python.org/file36065/test_mult.py ___ Python tracker <http://bugs.python.org/issue11271> ___ ___ Python-bugs-list m

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-24 Thread Dan O'Reilly
Changes by Dan O'Reilly : Removed file: http://bugs.python.org/file36064/map_chunksize.patch ___ Python tracker <http://bugs.python.org/issue11271> ___ ___ Pytho

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-24 Thread Dan O'Reilly
Changes by Dan O'Reilly : Added file: http://bugs.python.org/file36067/map_chunksize.patch ___ Python tracker <http://bugs.python.org/issue11271> ___ ___ Pytho

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-24 Thread Dan O'Reilly
Dan O'Reilly added the comment: I've added new versions of the patch/demonstration that ensures we actually submit all the futures before trying to yield from the returned iterator. Previously we were just returning a generator object when map was called, without actually subm

[issue21367] multiprocessing.JoinableQueue requires new kwarg

2014-07-24 Thread Dan O'Reilly
Dan O'Reilly added the comment: How are you importing JoinableQueue? You'll see this error if you import it from multiprocessing.queues instead of directly from multiprocessing. This is because multiprocessing.JoinableQueue is now a function: def JoinableQueue(self,

[issue21367] multiprocessing.JoinableQueue requires new kwarg

2014-07-24 Thread Dan O'Reilly
Changes by Dan O'Reilly : -- components: +Library (Lib) -Interpreter Core type: compile error -> behavior ___ Python tracker <http://bugs.python.org

[issue22087] _UnixDefaultEventLoop policy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-26 Thread Dan O'Reilly
New submission from Dan O'Reilly: On non-Windows platforms, if a user attempts to use asyncio.get_event_loop() in a child process created by multiprocessing.Process using the fork context, and an asyncio event loop is also being used in the main process, the same _UnixSelectorEventLoop o

[issue22087] _UnixDefaultEventLoop policy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-26 Thread Dan O'Reilly
Changes by Dan O'Reilly : Added file: http://bugs.python.org/file36117/test_loop.py ___ Python tracker <http://bugs.python.org/issue22087> ___ ___ Python-bugs-list m

[issue22087] _UnixDefaultEventLoop policy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-26 Thread Dan O'Reilly
Changes by Dan O'Reilly : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue22087> ___ ___ Python-bugs-list mailing list Unsub

[issue22087] _UnixDefaultEventLoopPolicy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-26 Thread Dan O'Reilly
Changes by Dan O'Reilly : -- title: _UnixDefaultEventLoop policy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process -> _UnixDefaultEventLoopPolicy should either create a new loop or explicilty f

[issue22087] _UnixDefaultEventLoopPolicy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-26 Thread Dan O'Reilly
Changes by Dan O'Reilly : Removed file: http://bugs.python.org/file36116/handle_mp_unix.diff ___ Python tracker <http://bugs.python.org/issue22087> ___ ___ Pytho

[issue22087] _UnixDefaultEventLoopPolicy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-26 Thread Dan O'Reilly
Changes by Dan O'Reilly : Added file: http://bugs.python.org/file36118/handle_mp_unix.diff ___ Python tracker <http://bugs.python.org/issue22087> ___ ___ Pytho

[issue22087] _UnixDefaultEventLoopPolicy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-26 Thread Dan O'Reilly
Dan O'Reilly added the comment: Yep, agreed on both points. The latter suggestion also has the benefit of not requiring any test changes. Here's an updated patch. -- Added file: http://bugs.python.org/file36119/map_chunksize2.patch

[issue22087] _UnixDefaultEventLoopPolicy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-27 Thread Dan O'Reilly
Dan O'Reilly added the comment: I've added a unit test that spawns a new forked process via multiprocessing, and verifies that the loop returned by get_event_loop is not the same as the one we have in the parent. -- Added file: http://bugs.python.org

[issue22087] _UnixDefaultEventLoopPolicy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-27 Thread Dan O'Reilly
Dan O'Reilly added the comment: re: #21998, perhaps it's time to revive #16500? Without that, I'm not sure what can be done aside from documenting the need to call "loop = asyncio.get_event_loop()" in the child

[issue22087] _UnixDefaultEventLoopPolicy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-27 Thread Dan O'Reilly
Dan O'Reilly added the comment: Hmm, I'm not sure what you mean. What check in the policy would prevent this issue you described in #21998?: import asyncio, os loop = asyncio.get_event_loop() pid = os.fork() if pid: print("parent", loop._csock.fileno(), loop._

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-30 Thread Dan O'Reilly
Dan O'Reilly added the comment: re: Diverging ThreadPoolExecutor and ProcessPoolExecutor APIs. I thought about this as well. It would of course be possible to make ThreadPoolExecutor's API match, but it would serve no useful purpose that I can think of. I guess we coul

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-31 Thread Dan O'Reilly
Dan O'Reilly added the comment: I've attached an updated patch based on your review comments; there's now a unit test with a non-default chunksize, the chunking algorithm is more readable, and the same code path is used no matter what chunksize is provided. I've also upd

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-31 Thread Dan O'Reilly
Changes by Dan O'Reilly : Removed file: http://bugs.python.org/file36065/test_mult.py ___ Python tracker <http://bugs.python.org/issue11271> ___ ___ Python-bugs-l

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-07-31 Thread Dan O'Reilly
Changes by Dan O'Reilly : Added file: http://bugs.python.org/file36185/test_mult.py ___ Python tracker <http://bugs.python.org/issue11271> ___ ___ Python-bugs-list m

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-08-07 Thread Dan O'Reilly
Dan O'Reilly added the comment: Here's an updated patch that adds documentation and Antoine's requested code changes. -- Added file: http://bugs.python.org/file36306/map_chunksize_with_docs.patch ___ Python tracker <http

[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument

2014-08-10 Thread Dan O'Reilly
Changes by Dan O'Reilly : -- title: concurrent.futures.ThreadPoolExecutor should accept an initializer argument -> concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument ___ Python tracke

[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument

2014-08-10 Thread Dan O'Reilly
Dan O'Reilly added the comment: Here's an updated patch. Changes: * Fixed what appears to have been a find/replace typo I made prior to uploading the previous patch. * The tracebacks from the negative unit tests are now suppressed. * Fixed a race condition in the initializ

[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument

2014-08-10 Thread Dan O'Reilly
Dan O'Reilly added the comment: > It seems the addition of the initargs argument doesn't tackle Mark's > objection here: > > the initialiser and uninitialiser for the EnhancedThreadPoolExecutor > > accept no arguments. In retrospect, it would have been better

[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument

2014-08-10 Thread Dan O'Reilly
Dan O'Reilly added the comment: Another updated patch. This one changes ProcessPoolExecutor behavior so that RuntimeErrors are raised in any active Futures, and on subsequent calls to submit after the initializer fails. This makes its behavior consistent with ThreadPoolExe

[issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks

2014-08-11 Thread Dan O'Reilly
Dan O'Reilly added the comment: A couple of small updates based on comments from Charles-François Natali: * Use itertools.chain.from_iterable to "yield from" the result chunks instead of a for loop. * Add more tests with varying chunksizes. -- Added file: http://

[issue6721] Locks in the standard library should be sanitized on fork

2014-08-23 Thread Dan O'Reilly
Changes by Dan O'Reilly : -- nosy: +dan.oreilly ___ Python tracker <http://bugs.python.org/issue6721> ___ ___ Python-bugs-list mailing list Unsubscr

[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2014-08-24 Thread Dan O'Reilly
Dan O'Reilly added the comment: >> So, concurrent.futures is fixed now. Unless someone wants to patch >> multiprocessing.Pool, I am closing this issue. I realize I'm 3 years late on this, but I've put together a patch for multiprocessing.Pool. Should a process

[issue22281] ProcessPoolExecutor/ThreadPoolExecutor should provide introspection APIs

2014-08-26 Thread Dan O'Reilly
New submission from Dan O'Reilly: As initially discussed on python-ideas, it would be nice if there was a way to query the concurrent.futures Executor objects for information about their internal state - number of total/active/idle workers, number of total/active/waiting tasks, which

[issue22281] ProcessPoolExecutor/ThreadPoolExecutor should provide introspection APIs

2014-08-26 Thread Dan O'Reilly
Changes by Dan O'Reilly : Added file: http://bugs.python.org/file36481/exectest.py ___ Python tracker <http://bugs.python.org/issue22281> ___ ___ Python-bugs-list m

<    1   2   3   4   5   >