New submission from Dan Snider :
On Android, the following calls generate a SIGSYS signal that is neither
blocked by pthread_sigmask(SIG_BLOCK, {SIGSYS}) nor ignored after its handler
is set to SIG_IGN:
(os.chroot(path))
os.setgid(rgid)
os.setuid(ruid)
(os.setegid(gid
New submission from Dan Snider :
It appears sometime recently-ish that POSIX updated remove to the following:
#include
int remove(const char *path);
If path does not name a directory, remove(path) shall be equivalent to
unlink(path). If path names a directory, remove(path) shall be
Dan Halbert added the comment:
For your TODO list (not sure how else to communicate this):
I agree with the de-emphasis of gather(). I think adding another version of
gather() that cancels all the remaining tasks if one fails would also be good,
unless you think it is completely redundant
New submission from Dan Snider :
The docs use the phrase "unknown escapes of ASCII letters are reserved for
future use and treated as errors". That seems ambiguous enough to question why
"\x", "\u", "\U", and "\N{}" escapes aren't expand
Dan Yeaw added the comment:
I continued to look in to this and updated the title of the issue, I don't
think this is caused by doctest. I also updated a minimum example here:
https://github.com/danyeaw/plugin-console-test
If using pytest and GTK, any module loaded that makes use of rea
New submission from Dan Yeaw :
When running pytest --doctest-modules, I am getting seg faults on the GitHub
Actions CI when running doctests covering module docstrings.
runner@fv-az177-300:~/work/gaphor/gaphor$ source .venv/bin/activate
(.venv) runner@fv-az177-300:~/work/gaphor/gaphor$ xvfb
Dan Snider added the comment:
On Android, if os.close_range closes the file descriptor of the scandir
iterator, the interpreter immediately crashes eg:
>>> import os
>>> os.scandir()
>>> os.closerange(3,)
fdsan: attempted to close file descriptor 3, expec
New submission from Dan Snider :
chr (or anything else which calls `PyUnicode_FromOrdinal`) raises ValueError if
its argument falls outside the range of valid Unicode code points, while
`PyUnicode_FromFormat` raises OverflowError. Shouldn't the latter raise
ValueError as
Dan Stromberg added the comment:
Yes, cng-portal.
On Mon, Jul 12, 2021 at 3:24 PM Thomas Grainger
wrote:
>
> Thomas Grainger added the comment:
>
> https://docs.microsoft.com/en-us/windows/win32/seccng/cng-portal ?
>
> --
New submission from Dan Stromberg :
CPython 3.9 uses CryptGenRandom(), which has been deprecated by Microsoft.
I'm told the randomness produced by CryptGenRandom() is fine, but Microsoft has
introduced a newer API for getting randomness.
For these reasons, Python/bootstrap_hash.c shou
Change by Dan Cecile :
--
nosy: +dcecile
___
Python tracker
<https://bugs.python.org/issue39442>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Dan Snider :
>>> import dis
>>> @dis.dis
... def funcdef(k): return k in {None} ...
2 0 LOAD_FAST
0 (k)
2 LOAD_CONST
New submission from Dan Snider :
Other than obvious performance implications this has, usage of LOAD_NAME makes
defining cls.__name__ from within metaclass.__prepare__ difficult.
--
messages: 389026
nosy: bup
priority: normal
severity: normal
status: open
title: Use LOAD_GLOBAL to set
New submission from Dan Snider :
Isn't the point of setting typed=True to make it so that e.g. True doesn't
register as a hit when there is already a cache entry for 1.0? Assuming that is
the case, although this report specifically targets 3.8 I found no indication
that what I beli
New submission from Dan Snider :
The only way to lookup weak references to functools.partial objects is with
weakref.getweakrefs. I don't know if it's normal for extension types that
define tp_weaklistoffset to not add a __weakref__ descriptor, but I figured at
the very least
Dan Pascu added the comment:
While it may not be affected at a functional level (at least not in a way I can
see right now), it is confusing when reading that code.
Isn't clarity and avoiding confusion a desired trait for core python code?
What about all these recommendations from th
Dan Merillat added the comment:
Correction, the example source in the documentation is correct as there's no
symbolic names for the tty attributes array, only the cc field.
--
___
Python tracker
<https://bugs.python.org/is
New submission from Dan Merillat :
"The interpretation of the flags and the speeds as well as the indexing in the
cc array must be done using the symbolic constants defined in the |termios|
module." (termios links to itself)
These constants are not listed in the documentati
Dan Gheorghe Haiduc added the comment:
rhettinger wrote [1]:
> The existing setobject code has been finely tuned and micro-optimized over
> the years, giving it excellent performance on workloads we care about.
This worries me also. But I suppose the tuning should make itself visi
Dan Gheorghe Haiduc added the comment:
Oops. The reference number [2] in the previous message should instead be
https://stackoverflow.com/q/6614447/235463 .
--
___
Python tracker
<https://bugs.python.org/issue42
New submission from Dan Gheorghe Haiduc :
Now that dicts are ordered[1], would it by any chance make sense to also order
sets?
A use case that I ran into is trying to reproducibly get a random.choice from a
set (after calling random.seed).
At first I did not need reproducibility, and I
New submission from Dan :
The attached HTML document (pulled from a Samsung printer web interface)
contains the following invalid HTML tag:
(invalid because of ,="")
In Python 3.x completely stops the HTML parser, preventing any further tags
from being parsed. This does not happen
New submission from Dan Pascu :
I noticed that StreamReaderProtocol is defined like this:
class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
...
but FlowControlMixin already inherits protocols.Protocol:
class FlowControlMixin(protocols.Protocol):
...
It seems
Change by Dan Arad :
--
nosy: +Dan Arad
___
Python tracker
<https://bugs.python.org/issue28859>
___
___
Python-bugs-list mailing list
Unsubscribe:
Dan Arad added the comment:
Hi everyone!
I thought to take this issue up by updating the documentation. Is this still
relevant?
If so I think the best place to add the documentation is in the "name or flags"
section, where people will go looking first. I think to add both the me
Change by Dan Snider :
--
nosy: bup
priority: normal
severity: normal
status: open
title: add "
___
Python tracker
<https://bugs.python.org/issue39528>
___
___
Dan Gass added the comment:
Sorry for not thinking of trying this sooner. Running garbage collection,
import gc; gc.collect(), releases the resources and restores the expected
reference counts.
>From my perspective, this is satisfactory and could justify closing this bug
>report.
New submission from Dan Gass :
Given
(1) instantiation of an enumeration class with an invalid value
(2) a try/except around the instantiation where the exception is ignored
Then:
An unneeded reference to the bad value is lost (as well as other values that I
suspect are local variables within
New submission from Dan Arad :
I've stumbled across the `cmd` module, had some difficulties in reading it, and
wanted to help in making it more readable.
I'm new to contributing to open source, and thought this could be a good
exercise for me, and that if I could contribute alo
New submission from Dan Snider :
The title was carefully worded as I have no idea how or why what is happening
is happening, only that it has been like this since a least 3.6.0. That version
in particular, by the way, is able to execute a call to a python function with
1 argument 25% faster
Dan added the comment:
According to this -
https://wiki.tcl-lang.org/page/Building+with+Visual+Studio+2017
the issue will be fixed in the next version (8.6.10). TLDR explanation: Tcl/Tk
has variables with names that are now reserved keywords in VS2017, meaning that
it can't be build
Dan added the comment:
Steve, the 2.7 build I've posted includes native tk, do you need the necessary
patches?
--
___
Python tracker
<https://bugs.python.org/is
New submission from Dan Snider :
When the following program has been input (into 32 bit 3.8.0 Python running on
windows 10), all IDLE processes and windows will immediately and irrevocably
hang the instant the open parentheses at the end of the statement "Object(" is
rendered
New submission from Dan Snider :
Unicode characters with code points above u+ can only be added to the end
of an array, and only from a call to the "fromunicode" method. This is because
"fromunicode" uses a different procedure to modify the array compared to
__new__,
New submission from Dan Snider :
The function has the following signature documented:
__build_class__(func, name, *bases, metaclass=None, **kwds)
This implies that `func` and `name` are not positional only parameters when in
fact, they are. Another problem with that signature is that
Dan added the comment:
Hi,
I've just noticed this but a couple of months ago I managed to compile Python
2.7 on win32 ARM64 including the said ssl, tk, ctypes modules.
You can download from here and test -
https://mega.nz/#F!PclhDIRB!-yhBZ6UM7S596ijNU3dx0A
You will need to install the
New submission from Dan Snider :
At present, the bytecode compiler can generate 512 different unicode
characters, one for each integral from the range [0-511), 512 being the total
number of syntactically valid permutations of 3 octal digits preceded by a
backslash. However, this does not
Change by Dan Hemberger :
--
pull_requests: +13820
pull_request: https://github.com/python/cpython/pull/13951
___
Python tracker
<https://bugs.python.org/issue16
Change by Dan Hemberger :
--
keywords: +patch
pull_requests: +13819
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/13951
___
Python tracker
<https://bugs.python.org/issu
New submission from Dan Hemberger :
When using the CacheFTPHandler in the most basic of contexts, a URLError will
be thrown if you try to reuse any of the FTP instances stored in the handler.
This makes CacheFTPHandler unusable for its intended purpose. Note that the
default FTPHandler
New submission from Dan Snider :
The interpreter matches the values in func.__defaults__ with the calculated
positional argument names "right-to-left", while inspect does does so
"left-to-right". In every day usage, for "normal" functions, generated by the
comp
Dan Rose added the comment:
Oops you are right. These enter uninterruptible loops too. They are exceptional
situations and should do the expected thing - throw exceptions as well.
--
___
Python tracker
<https://bugs.python.org/issue37
Dan Rose added the comment:
The general problem with infinite iterators is indeed a bigger issue and its
resolution would probably resolve this issue too. With the examples you gave at
least the user can ctrl-c to interrupt. Entering an infinite, *uninterruptible*
loop is a consequence so
Dan Rose added the comment:
Reopening. While my behavioral expectation may be wrong, the current behavior
is inappropriate. It would make more sense for count to have a `__contains__`
method which raises a TypeError.
--
resolution: rejected ->
status: closed ->
New submission from Dan Rose :
Checking membership in `itertools.count()` will either return True in linear
time or enter an infinite loop that cannot be terminated with Ctrl-c. This
```
import itertools
1 in itertools.count(0,2)
```
It is expected that the above code will use an efficient
Change by Dan Snider :
--
nosy: -bup
___
Python tracker
<https://bugs.python.org/issue35331>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Dan Snider :
--
nosy: +bup
___
Python tracker
<https://bugs.python.org/issue35331>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
New submission from Dan Snider :
As far as I know, generators, set comprehensions, list comprehensions, and dict
comprehensions, (along with their asynchronous variants) are implemented by
first calling the GET_(A)ITER opcode and then building and calling a function
that acepts the resulting
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
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
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:
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
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 Timofte added the comment:
`loop.call_soon_threadsafe(loop.stop)` solves the problem because it has the
write_to_self there. I can use that or call loop._write_to_self() myself before
calling loop.stop().
In my code i'm stoping the loop from the exception_handler not signal. The
Change by Dan Timofte :
--
keywords: +patch
pull_requests: +12770
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36626>
___
___
Py
Dan Timofte added the comment:
i will provide a patch, i'll make a pull request next week.
a call to self._write_to_self() should also be added to create_task() before it
returns . i'll make the correction for this as well.
--
___
Pyth
Change by Dan Timofte :
--
type: -> behavior
___
Python tracker
<https://bugs.python.org/issue36626>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Dan Timofte :
after starting run_forever if all scheduled tasks are consumed run_once will
issue a KqueueSelector.select(None) which will block indefinitely :
https://www.freebsd.org/cgi/man.cgi?query=select&sektion=2&apropos=0&manpath=FreeBSD+12.0-RELEA
New submission from Dan Snider :
The rich comparison operators have an (far as I can tell, unnecessary)
limitation compared to the other binary operators, being that the result of an
unparenthesized comparison expression cannot be unpacked using the *iterable
"unpack" operator
Dan Yeaw added the comment:
lazka: Thanks for you response. You are correct, the issue was that I had a pip
installed version of setuptools somehow. It sounds like you think that all
issues should go downstream to fixing them in the MINGW-packages. I am OK with
this, it just seams like
New submission from Dan Yeaw :
I am using the mingw-w64-x86_64-python3 in MSYS2 on Windows to package a
PyGObject app. When I try to pip install the app, I am getting errors about the
VC 6.0 isn't supported.
It looks like setuptools is trying to patch distutils msvc. The msvc9com
New submission from Dan Snider :
The footnote about why eval/exec cannot be used for arbitrary code has been
(for the most part) incorrect for quite some time as the signature for
PyEval_EvalCodeEx demonstrates:
PyObject* PyEval_EvalCodeEx(PyObject *co, PyObject *globals, PyObject *locals
Dan Rose added the comment:
Note to future self: whatever solution should also play nice with
functools.partial
--
___
Python tracker
<https://bugs.python.org/issue36
Dan Rose added the comment:
Thanks for the suggestion, Raymond. I was toying with the idea of a PR, but
wasn’t sure what the resolution should be, and it’s a rather subtle decision
for my first contribution.
It seems to me that this might be an oversight in PEP-0484, and the purest
Change by Dan Rose :
--
title: Help function is not much help with async functions -> builtins.help
function is not much help with async functions
___
Python tracker
<https://bugs.python.org/issu
New submission from Dan Rose :
It is very important when using a callable to know whether it is async or not.
It is expected that `builtins.help` function should provide the information
needed to properly use the function, but it omits whether it is an async
function or not.
```
import
New submission from Dan Snider :
keyword.py is used by stuff like the idle colorizer to help determine if an
identifier is considered a keyword but it doesn't identify __debug__ despite
the fact that the parser treats it exactly the same as None, True, and False. I
could not find a
New submission from Dan Snider :
The current signature:
"__get__($self, instance, owner, /)\n--\n\nReturn an attribute of instance,
which is of type owner."
doens't match how wrap_descr_get actually parses the arguments to __get__ with:
PyArg_UnpackTuple(args, "
New submission from Dan Snider :
Having the ability to add binding behavior to any callable is an incredibly
useful feature if one knows how to take advantage of it, but unfortunately,
nothing that currently (publicly) exists comes close to filling the gap
`instancemethod`s secrecy leaves
New submission from Dan Snider :
ie.:
>>> from struct import calcsize
>>> calcsize('\144\u0064\000xf\U0031000\60d\121\U0051')
16
I'm sure some people think it's obvious or even expect the null character to
signal EOF but it probably
Dan Snider added the comment:
Not 100% sure if it's appropriate to post this here... so sorry if not.
So anyway, the _MAX_COLS and _MAX_LINE constants used for `get_argspec` seem
like they were intended to limit the generated text tips to at most 5 rows, 85
characters wide, which
Dan Stromberg added the comment:
Isn't this "python script doesn't show up in top correctly" issue a matter of
"#!/usr/bin/env python3"?
If you "#!/usr/bin/python3" (for example) instead, top seems happy.
--
nosy: +strombrg
__
Change by Dan :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue35390>
___
___
Python-bugs-list mailing list
Dan added the comment:
Thank you both, that's really helpful. Yes, I agree eryksun, I was saying that
pointers to c_double and other normal pointer objects work fine, but that if
you change to void* and c_void_p in my example it doesn't work.
The private field seems like a
New submission from Dan :
I have a C struct
typedef struct Effect {
void* ptr;
} Effect;
where when I allocate the memory, the void* gets initialized to NULL, and pass
back a pointer:
Effect* get_effect(){
Effect* pEffect = malloc(sizeof(*pEffect));
pEffect->ptr = N
New submission from Dan Snider :
_struct.Struct not defining a valid __module__ by prefixing its tp_name slot
with "_struct" is inconsistent with every other extension type which is
available in the corresponding module globals.
>From the documentation of the `tp_name` slot:
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.
>
> &
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
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
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
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 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
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
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
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 :
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
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
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 :
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
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
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 :
>>> 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
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 :
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
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 :
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 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 :
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 :
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 :
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
1 - 100 of 403 matches
Mail list logo