Josh Rosenberg added the comment:
object.__ipow__ is documented to take an optional third argument (though there
is no way to pass it aside from explicitly calling __ipow__ directly since
there is no syntax support for three-arg pow, in place or otherwise), so it's
not some incompatib
Josh Rosenberg added the comment:
Yes, they're set. They're never *read* anywhere. My suggestion was to stop
setting them (because it gives the impression they do something when reading
the docs, when in fact they do nothing), and remove them fro
Josh Rosenberg added the comment:
Sorry, that should have been "it gives the impression they do something when
reading the *source code*"
--
___
Python tracker
<https://bugs.python.o
Josh Rosenberg added the comment:
2.7 is in bug fix only mode, and even that ends at the end of this year. This
seems more like a feature request than an actual bug; it works, but not great
with Unicode in some cases (which describes large parts of Python 2).
It does look like Python 3.7 at
Josh Rosenberg added the comment:
Allowing delete_on_error=False is kind of defeating the purpose here; the whole
point of the with statement is guaranteed, consistent cleanup in both normal
and error cases. If you knew enough to know you needed to pass delete_on_error,
you'd also
Josh Rosenberg added the comment:
Could you provide a minimal reproducer script? With multiprocessing involved,
I'd suspect some issue with data sharing (Windows can't fork after all, so it's
possible something is involved there).
I see nothing obvious in the _tkinter mo
Josh Rosenberg added the comment:
Perhaps an alternative solution would be to provide conditional definitions for
the stuff ICC leaves out? I'm assuming ICC can actually handle _Atomic
uintptr_t if you type it out, it's just missing the typedef for it for whatever
reason?
-
Josh Rosenberg added the comment:
This is an exact duplicate of #35190 - "collections.abc.Sequence cannot be used
to test whether a class provides a particular interface (doc issue)"
--
nosy: +josh.r
resolution: -> duplicate
superseder: -> collections.abc.Sequence c
Change by Josh Rosenberg :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue36455>
___
___
Python-bugs-list
Josh Rosenberg added the comment:
Wasn't the point of PEP475 that all EINTR returns would be explicitly handled
by retrying rather than forcing the user to handle it? Seems like the correct
solution is still to retry, but on OSX/FreeBSD we'd need to update the offset
and count ar
Josh Rosenberg added the comment:
As noted, this is fixed in 3.6+. 3.5 is in security fix only mode (
https://devguide.python.org/#status-of-python-branches ), which is why the fix
for #22005 wasn't backported.
--
nosy: +josh.r
resolution: -> duplicate
stage: -> reso
Josh Rosenberg added the comment:
I'll note that, based on the title, I'm skeptical of the claim of a
vulnerability. getattr is effectively *designed* to execute arbitrary code if
called on an appropriate object (one where the class defines __getattribute__;
defines __getattr
Change by Josh Rosenberg :
--
resolution: -> not a bug
stage: -> resolved
status: pending -> closed
___
Python tracker
<https://bugs.python.or
Josh Rosenberg added the comment:
skrah: Is there any reason your patch, as written, wouldn't work? If you need a
test case to verify, gmpy2's xmpz type supports in place pow (but requires the
modulus to be None, since there is no normal way to pass it anyway), so you can
Josh Rosenberg added the comment:
It might be nice to expose a more limited API to prefetch memory in bulk while
we're at it. Windows 8 and higher offers PrefetchVirtualMemory (
https://docs.microsoft.com/en-us/windows/desktop/api/memoryapi/nf-memoryapi-prefetchvirtualmemory
) which
Josh Rosenberg added the comment:
Actually, there is a use case, and it's one I've been intermittently trying to
replicate ever since the functionality vanished in the Python 2 to 3 transition
(or so I thought).
The use case is taking an existing built-in function (as in a CPytho
Josh Rosenberg added the comment:
Right. So this is a hard problem for anyone to solve, and therefore os.sendfile
should be the one solving it, not the caller of sendfile, right?
--
___
Python tracker
<https://bugs.python.org/issue36
Josh Rosenberg added the comment:
I believe the second note under "Changed in 3.7" is intended to address this:
> Empty matches for the pattern are replaced when adjacent to a previous
> non-empty match.
Obviously not as detailed as the What's New entry, but it'
Josh Rosenberg added the comment:
Correct me if I'm wrong, but this isn't actually an issue for CPython, right?
The GIL ensures that when a thread writes to _shutdown, nothing else is reading
it until the GIL is released and acquired by a new thread (which synchronizes
_shutdown).
Josh Rosenberg added the comment:
It seems highly likely this is related to #26110 which optimizes method calls
by avoiding the creation of bound methods in certain circumstances, and/or the
follow-up #29263.
Side-note:
bound_method = functools.partial(method, self)
is not how you create
Josh Rosenberg added the comment:
Hmm... Although I can't seem to reproduce on 3.7.2 (ob.calls is 1), so assuming
it is really happening in 3.7.3, it wouldn't be either of those issues (which
were fully in place long before 3.7.2
Josh Rosenberg added the comment:
This is the same basic problem seen with sequence multiplication, mutable
default arguments to a function, etc. It's not going to change though; the
documentation says it "Create a new dictionary with keys from iterable and
values set to value
Change by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue36424>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
The documentation does describe a fairly flexible parser. Perhaps it's a little
too flexible on stuff like URN prefixes, but I don't think we could start
enforcing a stricter class of hyphen separations without potentially breaking
existing code.
Josh Rosenberg added the comment:
I like this. Always annoying to explicitly override both __repr__ and __str__
on subclasses of stuff like int when they should be the same. Patch looks good
to me; I was originally wondering why some classes were replacing:
__str__ = __repr__
with
Change by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue36781>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Minor bikeshed: If updating the documentation, refer to U+ as "the null
character" or "NUL", not "NULL". Using "NULL" allows for confusion with NULL
pointers; "the null character" (the name used in t
Josh Rosenberg added the comment:
Noticed unresolved comments (largely on documentation) on the PR and since I'm
sprinting this week I finally had the time to address them. I merged the latest
master into the PR, hope that's considered the correct way to app
Change by Josh Rosenberg :
--
versions: +Python 3.8 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue29842>
___
___
Python-bugs-list mailin
Josh Rosenberg added the comment:
I'm trying to sprint on this this week. I already had a PoC put together, but
it has some significant issues caused by one major quirk with slices:
1. They're immutable, but
2. They're not hashable
In various places, it is (reasonabl
Josh Rosenberg added the comment:
For the process based versions, it makes it too easy to accidentally fork bomb
yourself, since each process that call psubmit would implicitly created another
#CPUs workers of its own, so a process based version Brian's case with a mere
four top-
Josh Rosenberg added the comment:
Remi: The reason they're not hashable is presumably because it would make them
valid dictionary keys, further confusing the difference between sequences and
mappings. x[::-1] would, for a sequence, return a reversed sequence, but for a
mapping, would e
Josh Rosenberg added the comment:
Mitar: argparse.FileType's __call__ (which is what "parses" the argument)
returns whatever open (aka io.open) returns. Basically, post-parsing, there is
nothing about the result of FileType that distinguishes it from a manually
opened file
Josh Rosenberg added the comment:
Serhiy: To be clear, Moritz's patch won't work if stdin/stdout are io.StringIO
or the like either, since StringIO lacks a buffer attribute.
Personally, I'm content to:
1. Ignore the closeability of the standard handles; that's not pa
Change by Josh Rosenberg :
--
pull_requests: +13082
___
Python tracker
<https://bugs.python.org/issue14156>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
I've created PR13165 to address this bug. It's 99% test updates; the actual
code changes to argparse.py are trivial and should be equally trivial to review.
The only functional change beyond Moritz's proposal is that I added support for
h
Change by Josh Rosenberg :
--
keywords: +patch
pull_requests: +13106
stage: test needed -> patch review
___
Python tracker
<https://bugs.python.org/issu
Josh Rosenberg added the comment:
I've submitted a PR for this. I did discover a use case for boolean evaluation
while doing this in the functools.total_ordering helpers. While it's
legitimate, it *looks* wrong (the code looks like it didn't consider the
possibility of NotI
New submission from Josh Rosenberg :
The What's New in 3.7 docs mention the change from #31399 to use OpenSSL's
built-in hostname verification (
https://docs.python.org/3/whatsnew/3.7.html#ssl ), but aside from that,
information about the change is largely undiscoverable an
Josh Rosenberg added the comment:
I've seen far too many cases where Python code targeting Linux intentionally
uses the COW benefits of fork for multiprocessing to think it would be a good
idea to change the default start method there without *some* sort of
deprecation p
Josh Rosenberg added the comment:
On both Py2 and Py3, calling codecs.open without passing an encoding argument
is equivalent to adding 'b' to the mode string and calling the built-in open
function directly; it returns a plain binary mode file object. The errors
parameter is m
Josh Rosenberg added the comment:
Ah, my mistake. That said, when you're not passing an encoding, you're still
just calling regular open, it's not doing any special codecs.open wrapping (on
Python 2, this meant you weren't decoding the input at all, on Python 3 it
means
Josh Rosenberg added the comment:
On rereading the docs for Python 3 codecs.open, it doesn't seem to document the
whole "no encoding means no codecs.StreamReaderWriter wrapping behavior" at all.
First off, any fix would only apply to Python 3 (I've removed 2.7 from the
ve
Change by Josh Rosenberg :
--
versions: -Python 2.7
___
Python tracker
<https://bugs.python.org/issue32723>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
So, just for clarity, is there another approved mechanism for distributing an
extension that just happens to act as a (Python version specific) C support
library? I've wanted to be able to build a library (static or dynamic) that is
installed t
Change by Josh Rosenberg :
--
title: Can no longer specify OpenSLL locations with CPPFLAGS / LDFLAGS ? -> Can
no longer specify OpenSSL locations with CPPFLAGS / LDFLAGS ?
___
Python tracker
<https://bugs.python.org/issu
Josh Rosenberg added the comment:
YoSTEALTH: I think this is one of those cases where the fact of it being a
class is incidental; it's used the same as if it were a function, and just
happens to be implemented as a class (the docs actually describe it in terms of
a function). PEP8 gui
Josh Rosenberg added the comment:
A server that exposes arbitrary exec's to user-submitted data can already be
controlled. exec can do anything that Python can do, that's the whole point.
Sure, crashing Python is bad, but it could also keep Python alive and start
dumping the d
Josh Rosenberg added the comment:
Side-note: You say "how could i have known it was named 'f'?"
>>> help(csv.DictReader)
class DictReader
| Methods defined here:
|
| __init__(self, f, fieldnames=None, restkey=None, restval=None,
dialect='excel'
Josh Rosenberg added the comment:
To be clear, the specific error is:
error: ambiguous option: --a could match --a-b, --ab
which makes sense if they're separate switches, but doesn't make sense when
both expansions are aliases of one another.
--
nos
Josh Rosenberg added the comment:
Do data classes let you define some fields as being excluded from the
equality/ordering/hashing? I got the impression that if a field existed, it was
part of the "key" no matter what, which isn't necessarily correct in the
general case. Simple
Josh Rosenberg added the comment:
Ah, never mind. Looks like dataclasses.InitVar fields seem to be the answer to
excluding a field from the auto-generated methods.
--
___
Python tracker
<https://bugs.python.org/issue20
Josh Rosenberg added the comment:
First off, link to discussion:
https://groups.google.com/d/topic/python-ideas/-3QW3cxj3ko/discussion
1. bool is already a virtual subclass of Integral since it's an actual subclass
of int (which is a virtual subclass of Integral); no need to expli
New submission from Josh Friend :
Armin Rigo from the PyPy project pointed this out to me:
https://bitbucket.org/pypy/pypy/issues/2755/dbmopen-expects-a-str-for-filename-throws
This could probably lead to some weird behavior given the right filename
--
components: Library (Lib
New submission from Josh Rosenberg :
In Python 2, making a user-defined class support formatting using the
integer-specific type codes required that __int__ be defined and nothing else
(that is, '%x' % Foo() only required Foo to provide a __int__ method). In
Python 3, this was
Josh Rosenberg added the comment:
Note: Obviously, defining __index__ without defining __int__ is a little
strange (it's *equivalent* to int, but can't be *coerced* to int?), so yet
another fix would be addressing #20092 so it wouldn't be possible for a type to
define __
Josh Rosenberg added the comment:
Pingback from #33002, which is caused by the fact that parts of the CPython
code base that use PyNumber_Index for type conversion still pre-check for valid
types with PyNumber_Check, meaning that a type with __index__ and not __int__
gets erroneously
Josh Rosenberg added the comment:
To be clear, this is a problem with old-style (printf-style) formatting, and
applies to both bytes formatting and str formatting. So a class like:
class Foo:
def __index__(self):
return 1
will fail with a TypeError should you do any
Josh Rosenberg added the comment:
I think this falls under the umbrella of #30235, which posits that Path-like
objects should be supported by shutil (and includes notes on doc validation).
--
nosy: +josh.r
___
Python tracker
<ht
Josh Rosenberg added the comment:
fstat is async signal safe, and I suspect it's thread safe in general, though
usage does rely on the file descriptor remaining valid. If the fd in question
is closed in another thread after the GIL is released, fstat would fail; if a
new file is opene
Josh Rosenberg added the comment:
To my knowledge, there is no safe way to do this for other threads for a reason.
If you make all your worker threads daemons, then they will terminate with the
main thread, but they won't perform cleanup actions.
If you don't make them daemons,
Josh Rosenberg added the comment:
Serhiy: There is a semi-common case where global constants can be quite
expensive, specifically, initializing a global full of expensive to
compute/serialize data so it will be shared post-fork when doing
multiprocessing on a POSIX system. That said, that
Josh Rosenberg added the comment:
I may have immediately latched onto this, dubbing it the "one-eyed monkey
operator", the moment the generalized unpacking released.
I always hated the lack of an empty set literal, and enjoyed having this exist
just to fill that asymmetry with
Josh Rosenberg added the comment:
As indicated in the seek docs (
https://docs.python.org/3/library/io.html#io.IOBase.seek ), all three names
were added to the io module in 3.1:
> New in version 3.1: The SEEK_* constants.
Since they're part of the io module too, there is no need to
New submission from Josh Rosenberg :
Patch is good, but while we're at it, is there any reason why this
multi-allocation design was even used? It PyMem_Mallocs a buffer, makes a
C-style string in it, then uses PyUnicode_FromString to convert C-style string
to Python str.
Seems lik
Josh Rosenberg added the comment:
Related: issue29842 "Make Executor.map work with infinite/large inputs
correctly" for a similar problem in concurrent.futures (but worse, since it
doesn't even allow you to begin consuming results until all inputs are
dispatched).
A similar
Josh Rosenberg added the comment:
Pretty sure this is a problem with classes in general; classes are
self-referencing, and using multiplication to create new ctypes array types is
creating new classes.
--
nosy: +josh.r
___
Python tracker
<ht
Josh Rosenberg added the comment:
If the goal is just to suppress stdout, that's what passing subprocess.DEVNULL
is for (doesn't exist in Py2, but opening os.devnull and passing that is a
slightly higher overhead equivalent).
subprocess.run includes a call to communicate as p
Josh Rosenberg added the comment:
None of the actual classes outside of the typing module support this either to
my knowledge. You can't do:
from collections import deque
a: deque[int]
nor can you do:
a: list[int]
Adding Queue to the typing module might make sense (feel
Josh Rosenberg added the comment:
You named your loop variable i, overlapping the name of your second to last
digit, so you end up replacing the original value of i in each (given the
break, the only) loop.
So before the loop begins, i has the expected value of '6', but on
Change by Josh Rosenberg :
--
versions: -Python 3.6
___
Python tracker
<https://bugs.python.org/issue33404>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Note: strftime follows the existing documentation:
>>> datetime.datetime(1970, 1, 1, microsecond=1).strftime('%f')
'01'
The strptime behavior bug seems like a duplicate of #32267, which claims to be
fixed in master as of ear
Josh Rosenberg added the comment:
Based on the OP's patch, it looks like they have a problem where they have
non-ASCII text in their output strings (either due to using non-ASCII switches,
or using non-ASCII help documentation), but sys.stdout/sys.stderr are
configured for some encoding
Change by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue29943>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Josh Cullum :
Hi Guys,
I'm trying to build Python 3.6.1 and 3.6.3, with both, .configure / make / make
install work correctly as they should, however, trying to import _tkinter
doesn't work.
Going back to the compilation, I get the following error in th
Josh Cullum added the comment:
Hi Ned,
LD_LIBRARY_PATH has been set with the lib paths for both, like I said the
module itself builds, I’ll add the module build logs later but the module
try’s to get loaded before the tests which unfortunately gives the error
undefined symbol
Josh Cullum added the comment:
Hi Ned,
Please see the make logs for _tkinter below:
building '_tkinter' extension
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3
-Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result
-Wno-unused-parameter -W
Josh Cullum added the comment:
Interestingly, I get the error with Python 3.6.3 build from source, where I
include the path to the g++ binary.
Python builds without the g++ option, but then _Tkinter fails to build - see
issue31817
--
nosy: +jpc2350
Josh Cullum added the comment:
LD_LIBRARY_PATH includes /tools/apps/tk/8.6.7/lib/:/tools/apps/tcl/8.6.7/lib/
and several other library paths that are required.
Why would I be getting an undefined symbol error on this module?
_tkinter.cpython-36m-x86_64-linux-gnu.so: undefined symbol
Josh Cullum added the comment:
Hi Ned,
Tried that but unfortunately it didn't work. It still produces an error within
the make install function which then re-removes the module - it does however
create a folder called tkinter.
--
___
P
Josh Cullum added the comment:
Hi Ned,
I've built a new machine, tried the build again using Tk and Tcl shared
libraries, built Python-3.6.3 and it's still not worked.
The Python/3.6.3-foss-2017b/lib/python3.6/tkinter folder gets created and
populated with several files, but wh
Change by Josh Holland :
--
nosy: +anowlcalledjosh
___
Python tracker
<https://bugs.python.org/issue32421>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Josh Rosenberg :
--
title: readline() + seek() on io.EncodedFile breaks next readline() ->
readline() + seek() on codecs.EncodedFile breaks next readline()
___
Python tracker
<https://bugs.python.org/issu
Josh Rosenberg added the comment:
memoryview isn't just for bytes strings though; the format can make it a
sequence of many types of different widths, meanings, etc. Calling it a
BytesString would be misleading in many cases.
--
nosy: +j
Change by Josh Holland :
--
nosy: +anowlcalledjosh
___
Python tracker
<https://bugs.python.org/issue30811>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
If [].append == [].append is True in the "unique set of callbacks" scenario,
that implies that it's perfectly fine to not call one of them when both are
registered. But this means that only one list ends up getting updated, when you
tried t
Change by Josh Snyder :
--
pull_requests: +7556
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32475>
___
___
Python-bugs-list mai
Josh Snyder added the comment:
I've opened PR #7947 with another approach to this issue.
In my use-case, an HTTP client makes a request and uses buffered I/O to parse
the response headers. I would like to hand off the response socket to an
extension module for use with raw I/O syscalls
Josh Rosenberg added the comment:
Note: While this particular use case wouldn't be fixed (map returns in order,
not as completed), applying the fix from #29842 would make many similar use
cases both simpler to implement and more efficient/possible.
That said, no action has been tak
Josh Rosenberg added the comment:
In any event, sorry to be a pain, but is there any way to get some movement on
this issue? One person reviewed the code with no significant concerns to
address. There have been a duplicate (#30323) and closely related (#34168)
issues opened that this would
Josh Rosenberg added the comment:
In response to Max's comments:
>But consider the case where input is produced slower than it can be processed
>(`iterables` may fetch data from a database, but the callable `fn` may be a
>fast in-memory transformation). Now suppose the `Ex
Josh Rosenberg added the comment:
Copying from the sorted built-in's docstring would make sense here, given that
sorted is implemented in terms of list.sort in the first place.
--
nosy: +josh.r
___
Python tracker
<https://bugs.py
Josh Rosenberg added the comment:
Why would it "cause an issue if the file is closed before accessing the mmapped
region"? As shown in your own link, the constructor performs the mmap call
immediately after the descriptor is duplicated, with the GIL held; any race
condition that c
Josh Rosenberg added the comment:
So the bug is that the line number and module are incorrect for the f-string,
right? Nothing else?
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/issue34
Josh Rosenberg added the comment:
Carlo: The point of Xiang's post is that this is only tangentially related to
multiprocessing; the real problem is that tee-ing an iterator implemented in
Python (of which pool.imap_unordered is just one example) and using the
resulting tee-ed iterato
Josh Rosenberg added the comment:
That's a *really* niche use case; you want to store everything to a common
destination list, in order, but distinguish which switch added each one? I
don't know of any programs that use such a design outside of Python (and
therefore, it seems unli
Josh Rosenberg added the comment:
Bloating the documentation is almost certainly unjustifiable for list and
tuple, and only barely justifiable for int, bool and float, given that:
1. The documentation (at least for Python 3) has *never* claimed the arguments
could be passed by keyword (all
Josh Rosenberg added the comment:
Oh, I was checking old docs when I said the online docs didn't call int's
argument "x"; the current docs do, so int, float and bool all justify a change
(barely), it's just tuple and list for which it
Josh Rosenberg added the comment:
For tuple and list, no, they couldn't have looked at the help (because the help
calls the argument "iterable", while the only keyword accepted was "sequence").
Nor was "sequence" documented in the online docs, nor any
Josh Rosenberg added the comment:
That's the documented behavior. Per
https://docs.python.org/3/reference/datamodel.html#object.__getitem__ :
>Note: for loops expect that an IndexError will be raised for illegal indexes
>to allow proper detection of the end of the sequence.
T
301 - 400 of 839 matches
Mail list logo