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
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
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
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
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
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
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
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;
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
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
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)
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):
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
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
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
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
Change by Dan Snider :
--
keywords: +patch
pull_requests: +7616
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33998>
___
___
Python-
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
Change by Dan Hemberger :
--
type: -> enhancement
___
Python tracker
<https://bugs.python.org/issue34012>
___
___
Python-bugs-list mailing list
Unsubscrib
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
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
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
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
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.
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 *)
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
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&
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
Change by Dan Snider :
--
keywords: +patch
pull_requests: +8394
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34497>
___
___
Python-
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
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
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
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
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
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
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
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
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
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
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
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:
>
>
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
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
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
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.
>
> &
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
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
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
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
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
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
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
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
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'
>&
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
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.
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
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
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
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
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
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
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
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
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
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
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
Changes by Dan O'Reilly :
Removed file: http://bugs.python.org/file36059/map_chunksize.patch
___
Python tracker
<http://bugs.python.org/issue11271>
___
___
Pytho
Changes by Dan O'Reilly :
Added file: http://bugs.python.org/file36064/map_chunksize.patch
___
Python tracker
<http://bugs.python.org/issue11271>
___
___
Pytho
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
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
Changes by Dan O'Reilly :
Removed file: http://bugs.python.org/file36064/map_chunksize.patch
___
Python tracker
<http://bugs.python.org/issue11271>
___
___
Pytho
Changes by Dan O'Reilly :
Added file: http://bugs.python.org/file36067/map_chunksize.patch
___
Python tracker
<http://bugs.python.org/issue11271>
___
___
Pytho
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
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,
Changes by Dan O'Reilly :
--
components: +Library (Lib) -Interpreter Core
type: compile error -> behavior
___
Python tracker
<http://bugs.python.org
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
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
Changes by Dan O'Reilly :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue22087>
___
___
Python-bugs-list mailing list
Unsub
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
Changes by Dan O'Reilly :
Removed file: http://bugs.python.org/file36116/handle_mp_unix.diff
___
Python tracker
<http://bugs.python.org/issue22087>
___
___
Pytho
Changes by Dan O'Reilly :
Added file: http://bugs.python.org/file36118/handle_mp_unix.diff
___
Python tracker
<http://bugs.python.org/issue22087>
___
___
Pytho
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
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
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
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._
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
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
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
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
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
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
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
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
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
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://
Changes by Dan O'Reilly :
--
nosy: +dan.oreilly
___
Python tracker
<http://bugs.python.org/issue6721>
___
___
Python-bugs-list mailing list
Unsubscr
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
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
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
201 - 300 of 403 matches
Mail list logo