New submission from Josh Kupershmidt :
While digging through Lib/BaseHTTPServer.py, I noticed that the
date_time_string() function duplicates rfc822.formatdate(). Attached is
a patch to eliminate this duplication of code.
--
components: Library (Lib)
files: BaseHTTPServer.patch
keywords
New submission from Josh Roesslein :
The C version of BufferedWriter is missing the _write_lock attribute.
I am not sure if there is a reason for this or it was left out by
accident. Python version still has the attribute.
--
components: Extension Modules, IO, Library (Lib)
messages
Josh Roesslein added the comment:
Okay so even if you extend the BufferedWriter class, you should not
be using that lock for thread safety, correct? But you must still use
locks since its not thread safe still?
--
___
Python tracker
<h
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue28818>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Just OOC, what version of English are the docs supposed to use? In American
English, noun vs. verb doesn't matter, it's always "practice" (there is no such
word as "practise").
In this case it doesn't matter (it's a no
Josh Rosenberg added the comment:
Agreed. 2.7 source is definitely using with:
https://hg.python.org/cpython/file/2.7/Lib/shutil.py#l82
--
nosy: +josh.r
status: pending -> open
___
Python tracker
<http://bugs.python.org/issu
Josh Rosenberg added the comment:
Note: It's a little strange that instancemethod as a type sticks around even
though literally nothing in Python uses it. Is there some reason we kept it in
the 3.x transition? Extension types are using it, so I guess we can't drop it
now, but I
Josh Rosenberg added the comment:
Given you can't avoid the refcounting overhead, how much does this really help?
Are there meaningful benefits in microbenchmarks? I'd worry that unconditional
allocation from PyMem_Malloc might lose out relative to PyTuple_New, which is
likely to n
Josh Rosenberg added the comment:
Minor correction: No allocation when small stack used, so you'd only see
(possibly) regressions with 6+ keyword arguments (assuming the tuple free list
applies for tuples that large). Admittedly a minor concern; keyword processing
is already pretty slow
Josh Rosenberg added the comment:
You're going to need to provide a real repro; your description is effectively
useless. For the record, Python is not precisely pass by reference (it's
roughly equivalent to passing a pointer in C, binding the local name to the
same pointer, so if yo
Josh Rosenberg added the comment:
Didn't pre-opened (or lazily opened) file descriptors cause headaches with
os.urandom? I'm not sure I'd want my programming environment eating file
descriptors "just in case", even if it might make certain tasks trivia
Josh Rosenberg added the comment:
I find this report nigh incomprehensible, but I will admit that I can't seem to
find any good explanations of the extended slicing rules in the Python docs.
The tutorial covers slicing, but, AFAICT, it never mentions extended slicing at
all, not in 3.1
Josh Rosenberg added the comment:
You're reusing the same issue for completely different things. Make a separate
issue for separate docs issues.
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/is
Josh Rosenberg added the comment:
Is this something that needs to be defended against? My understanding is that
it's pretty easy to segfault CPython in a number of ways if you can execute
100% arbitrary code. The only way to cause this problem is if you can define
malicious exception
Changes by Josh Rosenberg :
--
nosy: -josh.r
___
Python tracker
<http://bugs.python.org/issue28944>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
This is documented behavior for Python 2 (
https://docs.python.org/2/library/json.html#basic-usage ):
>Note: Since the default item separator is ', ', the output might include
>trailing whitespace when indent is specified. You ca
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue28969>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
That argument combination appears to be undefined in the docs, the only cases
covered are:
block truthy, timeout is None
block truthy, timeout is positive
block falsy, (timeout unspecified)
The case of block truthy, timeout <= 0 is not documented.
Say
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue29049>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Seems reasonable to me.
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue29055>
___
___
Python-bugs-list mailin
Josh Rosenberg added the comment:
SystemRandom._randbelow has this problem, perhaps it should be fixed there, not
in one of many possible wrappers for it?
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue29
New submission from Josh Wilson:
The activate.bat file generated by python -m venv somevirtualenv seems to have
a mix of line ending styles. Sometimes using Carriage Return (CR) and Line
Feed (LF) and other times using only CR.
This seems to cause unexpected behavior when trying to modify
Josh Rosenberg added the comment:
Looks like, despite what the multiprocessing.Condition docs say (claiming it's
an alias for threading.Condition), at least in Python 3.5, it's a completely
separate animal from multiprocessing.synchronize, and the notify method on it
doesn&
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue29331>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
I think the wording could be improved, but there is another option I wanted to
put here. Right now, we're being overly detailed about the implementation,
specifying the bounds substitutions performed. If we're just trying to describe
logical be
Josh Rosenberg added the comment:
So just to be clear, the issue with non-string or non-unique keywords is purely
about performance, right, not correctness/non-crashiness? Non-string keywords,
while technically accepted by CPython, are at best barely legal by the language
standard. The
Josh Rosenberg added the comment:
Looks like the problem here is that pickling self._consume implicitly pickles
self, and after the first submission, self._futures contains Future objects.
Those are probably what have the RLock in them (to synchronize between reading
and populating threads
Josh Rosenberg added the comment:
You're going to need to actually provide the source file here. This makes no
sense as is.
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/is
New submission from Josh Rosenberg:
Issue #22091 points out a quirk in the compile function and use of the
__debug__ "constant" causing inconsistent behavior when the optimize level of
the compile call differs from that of the main interpreter; __debug__ in an
`if` or `while` st
Josh Rosenberg added the comment:
I just opened #27169: "__debug__ is not optimized out at compile time for
anything but `if:` and `while:` blocks" as a more general case of this bug.
This bug covers inconsistent behavior, but ultimately, it's caused by
incomplete optimizat
Josh Rosenberg added the comment:
Is there a good reason to worry about overeager worker spawning?
ProcessPoolExecutor spawns all workers when the first work item is submitted (
https://hg.python.org/cpython/file/3.4/Lib/concurrent/futures/process.py#l361
), only ThreadPoolExecutor even makes
Josh Rosenberg added the comment:
That would also work. The argument I'd give in favor of performing a pass that
replaces it with a literal True or False is that you don't have update as many
places, don't have to worry about missing a place, and you don't have to decid
Josh Rosenberg added the comment:
It is a little funny though. I expect a more common test like:
if a < b < c: pass
to be unconditionally faster than the logically equivalent:
if a < b and b < c: pass
The only difference between the two should be that b is loaded only once, w
Changes by Josh Lee :
--
nosy: +jleedev
___
Python tracker
<http://bugs.python.org/issue22455>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Josh Purvis:
This bug manifest itself in at least one very specific situation:
1. No locale is set on the machine
2. A file (test1.py) imports a second (test2.py)
3. The second file (test2.py) calls str.encode() from inside a thread
4. Running Python 2.7
Josh Rosenberg added the comment:
While you're fixing, the docstring should say "groupby(iterable, key=None)",
not "groupby(iterable[, keyfunc])"; the functions accepts the key function by
name, and the name is key, not keyfunc. And it can be passed explicitly as
New submission from Josh Triplett:
(This exists in both Python 3 and Python 2.)
When opening an existing .bz2 file with BZ2File, I'd like to have access to the
compression level, so that I don't have to manually parse the file's header to
get it. BZ2File could provide the co
New submission from Josh Triplett:
GzipFile currently reads and discards various fields from the gzip header, such
as the original filename and timestamp. Please consider reading all the fields
of the gzip header into fields of the GzipFile instance, so that users of
GzipFile can access
Josh Rosenberg added the comment:
+1; obviously, this could only be changed on Python 3.
Given the third argument is underscore prefixed, I think it can be safely
changed without a deprecation period, it's not a public part of the interface,
right?
--
nosy: +j
Josh Rosenberg added the comment:
Eric, remove the space from after the has_key call to match OP:
$ cat test.py
a.has_key(b)and x
It's legal to omit the space there.
--
nosy: +josh.r
___
Python tracker
<https://bugs.python.org/is
Josh Rosenberg added the comment:
Testing it myself that way:
C:\>type test.py
a.has_key(b)and x
C:\>"C:\Program Files\Python 3.5\Tools\scripts\2to3.py" test.py
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: S
Josh Rosenberg added the comment:
So syncfs is basically "sync, but only for a single file system corresponding
to a given open file"? Given it's Linux only (doesn't look like it's part of
any standard that UNIX or BSD OSes would provide), it seems rather special
pu
Changes by Josh Purvis :
--
nosy: +Josh.Purvis
___
Python tracker
<http://bugs.python.org/issue17981>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Purvis added the comment:
Ironically, I ran into this same exact issue today, and I have investigated the
`files_preserve` param, with no luck. I'm not too familiar with the internals
here, but from what I can tell it works with FileHandler, but not the
SysLogHandler.
If you try t
Changes by Josh Rosenberg :
--
nosy: +josh.rosenberg
___
Python tracker
<http://bugs.python.org/issue22524>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Josh Rosenberg :
--
nosy: +josh.rosenberg
___
Python tracker
<http://bugs.python.org/issue14102>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Josh Rosenberg:
(U) The examples for the function still show the return code in the form
os.popen would produce (a program exiting with status 1 would return 256 as the
status), but the new code from #10197 makes the status 1, not 256.
(U) This is a breaking change for
Josh Rosenberg added the comment:
Ah blech. Can someone with privileges edit my original message to remove the
junk at the beginning of each paragraph? Habit from an old job. Wish I could
just edit the message.
--
___
Python tracker
<h
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue22637>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue17870>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue15944>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Is there someone else who should be looking at this? Having a fast path for
identifier comparisons makes sense (and the concept of ordering between
essentially unique identifiers makes no sense). It's not part of the public API
(limited or not) so I
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue20185>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue20341>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Seems awfully verbose relative to the standards of the other built-in methods.
Can you explain what improvements you feel this provides? str.join isn't a
particularly complex method, relative to the other str methods that have inline
usage examples (e.g
Changes by Josh Lee :
--
nosy: +jleedev
___
Python tracker
<http://bugs.python.org/issue13444>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
This is a duplicate of #20692.
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue22948>
___
___
Python-bugs-list m
Josh Rosenberg added the comment:
I've made a patch that I believe should cover all three cases, including tests.
In addition to the pickling behavior, I've made two other changes:
1. methodcaller verifies during construction that the name is a string
(PyUnicode), and interns it;
Changes by Josh Rosenberg :
--
versions: -Python 3.4
___
Python tracker
<http://bugs.python.org/issue22955>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Don't bother reviewing just yet. There is an issue with attrgetter's pickling
(which the unit tests caught), and I need to update the pure Python modules to
match.
--
___
Python tracker
<http://bu
Josh Rosenberg added the comment:
Okay, this one passes the tests for the built-in module. I'm not sure what's
going wrong with the pure Python module. I'm getting the error:
_pickle.PicklingError: Can't pickle : it's not
the same object as operator.attrgetter
o
Changes by Josh Rosenberg :
Removed file: http://bugs.python.org/file37313/pickle_getter_and_caller.patch
___
Python tracker
<http://bugs.python.org/issue22955>
___
___
Josh Rosenberg added the comment:
Ah, solved it (I think). The bootstrapper used to import the Python and C
versions of the module leaves sys.modules unpopulated (Does pickle itself may
populate it when it finds no module of that name?). I added a setUp method to
the unittest class for
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue20692>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Minor note: Python classes with __slots__ pickle and unpickle just fine under
protocol 2 and higher. Only protocols 0 and 1 have this problem, and they are
no longer used by default on Py3, and not necessary to communicate with Py2,
where protocol 2 is
Josh Rosenberg added the comment:
What is the proposal? Global registration of file objects that should be
flushed before cleanup when they participate in a reference cycle? Adding a
special "__predel__" method as suggested in the linked bug? Weak backrefs for
file objects that all
Josh Rosenberg added the comment:
In the event of calls back into Python code in multithreaded execution (or GIL
release), this would mean you no longer have guarantees as to the contents (or
even the validity) of the pointer you get back. I'd think the only safe way to
accept mutable bu
Josh Rosenberg added the comment:
Ah, sorry. Should have examined patch. I thought you were making a change to
the behavior of s#, z#, y and y#, not converting actual uses of them. Again,
sorry.
--
___
Python tracker
<http://bugs.python.
Josh Rosenberg added the comment:
I think you're overinterpreting. The bug probably still exists on Windows if
you're using a poorly designed anti-virus or indexing tool; nothing fundamental
has changed in how files are deleted on Windows since this
Josh Rosenberg added the comment:
Manual adding to the cache seems of limited utility for the proposed recursion
base case approach when your cache is actually operating in LRU mode (maxsize
isn't None). You can inject your base cases all you want, but unless you wrap
every call t
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue23051>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
What is your proposal? WeakValueDictionary mapping raw bytes object to single
instance of ipaddress that is queried from ipaddress's __new__? No built-in has
quite that extensive a level of caching and aggressive deduplication to my
know
Josh Rosenberg added the comment:
So, just to be clear, checking the implementation (as of 3.4):
1. All the ipaddress classes leave __slots__ unset. So the overhead is actually
higher than 56 bytes per instance; the __dict__ for an IPv4Address (ignoring
the actual keys and values in the dict
Josh Rosenberg added the comment:
Marc-Andre: Oh, I know. I proselytize to coworkers on the virtues of using
__slots__ for classes that will have many instances created (particularly since
entirely too much of our stuff is still Py2.7, so we don't have the "free"
savings
Josh Rosenberg added the comment:
Serhiy: I believe you need to add a bunch of __slots__ = () to various base
classes in the module, even though they lack member variables. Every link in
the inheritance chain must declare __slots__, or the child class will have
__dict__ and __weakref__
Josh Rosenberg added the comment:
I believe explicitly calling the 64 bit version of a function is usually
frowned upon. At least on *NIX systems, the standard solution is to define
-D_FILE_OFFSET_BITS=64 during the build process, so off_t seamlessly becomes a
64 bit value, and the 64 bit
Josh Rosenberg added the comment:
A few questions/comments:
1. How would the reference clarify matters?
2. "Most languages" is perhaps overstating the matter. Lower level languages
and strictly typed languages tend to return a boolean value, but many high
level scripting langua
Josh Rosenberg added the comment:
Ugh. Looking into it further, POSIX systems tend to support
_FILE_OFFSET_BITS=64, but Windows isn't POSIX-y enough. So Windows might need
to be special cased regardless. Blech.
--
___
Python tracker
Josh Rosenberg added the comment:
I'll note: "".join(map(str, iterable)) will solve problem #1. It's fast, uses
existing built-ins, and is relatively intuitive. I know map is sometimes
considered Pythonic, but "".join(str(x) for x in iterable) is an equally
Josh Rosenberg added the comment:
Correction: I know map is sometimes considered *un-Pythonic
--
___
Python tracker
<http://bugs.python.org/issue23179>
___
___
Josh Rosenberg added the comment:
I think it avoids len because the length might change during iteration due to
side-effects of other code. Since a shrinking sequence would raise an
IndexError anyway when you overran the end, it may as well not assume the
length is static and just keep
Josh Rosenberg added the comment:
Note: index returns without the caller having a chance to execute code that
would change the sequence length directly. But other threads could change it,
as could a custom __eq__ on an object stored in the sequence (or a poorly
implemented __getitem__ or
Josh Rosenberg added the comment:
Intentional, but really hard to justify from a consistency perspective. There
appear to be several reasonable arguments to treat it as 1 regardless of the
mathematical impurity (
https://www.math.hmc.edu/funfacts/ffiles/10005.3-5.shtml ), and since we
Josh Rosenberg added the comment:
Does it slow down other cases? Seems to me like dictionaries would have more
"existing key lookups" than sets to justify the optimization, since they're
used for attribute lookup and the like, and because you usually want the value
associate
Josh Rosenberg added the comment:
The thread and dummy_thread modules have a leading underscore in Py3.4, but the
same naming issue is present there as well.
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue23
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue23264>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
multiprocessing spawns the other processes itself from the same executable used
to launch the main process. It's not subprocess. How would a different version
of Python get involved?
--
nosy: +josh.r
___
P
Josh Rosenberg added the comment:
Looks like this revision, part of #22823, changed it:
https://hg.python.org/cpython/rev/4480506137ed
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue23
Josh Rosenberg added the comment:
To answer your question: Since asdl uses set literals (introduced in 2.7 and
3.0), that appears to put an effective minimum version requirement of 2.7 to
build 3.5. Whether that was the intent is unclear (they were changing a lot of
places from set([a, b, c
Josh Rosenberg added the comment:
Is it even legal to have non-string keys in a JSON object? If they must be
strings, and they must be unique, I don't think a key argument is necessary
(and it would save the generation of the key array; not doing the work is
faster than doing the work
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue23492>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Why would you not expect this to work in the first place? I'd think a
relatively simple use case for schedulers is using a single thread to do the
work of a Timer instead of spawning a thread for every Timer. In that sort of
use case, the "timer
Josh Rosenberg added the comment:
sched has been around for a long time, but it's been useless for so many
purposes that it *should* handle (completely unsafe in threaded contexts until
3.3, still can't handle useful threaded scenarios today, e.g. scheduling tasks
for short d
Josh Rosenberg added the comment:
Should someone be closing this with "yield from already exists"?
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.o
New submission from Josh Rosenberg:
subprocess, when accepting objects for stdin, stdout, and stderr, assumes that
possessing a .fileno() means it's a legitimate object for use with the forked
process; that the file descriptor is interchangeable with the object itself.
But gzip, bz2 and
Josh Rosenberg added the comment:
Apparently similar issue occurs when tarfile assumes a GzipFile can have its
fileno() fstat-ed (see #22468). An awful lot of libraries seem to assume that
fileno() will provide useful information about the data you'd read from the
file-like object itself
Josh Rosenberg added the comment:
Blech, typo earlier "since they produce the *compressed* data (likely useless)
when read as subprocess stdin". Context should make it obvious, but trying to
be clear.
--
___
Python tracker
<http://bu
Changes by Josh Rosenberg :
--
nosy: +josh.r
___
Python tracker
<http://bugs.python.org/issue24379>
___
___
Python-bugs-list mailing list
Unsubscribe:
Josh Rosenberg added the comment:
Obvious possibility: input.csv is empty, so the loop never executes. You could
always add prints within the loop as well, so you know it actually read
something.
--
nosy: +josh.r
___
Python tracker
<h
Josh Rosenberg added the comment:
Shouldn't it also disable the relevant fixers for map, filter, zip, etc. as
appropriate? Otherwise a whole bunch of calls will be wrapper in list() or the
like to mimic a behavior the code never had in Py2 in the first place.
--
nosy: +j
601 - 700 of 839 matches
Mail list logo