[issue7370] patch: BaseHTTPServer reinventing rfc822

2009-11-20 Thread Josh Kupershmidt
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

[issue6030] io.BufferedWriter C module missing _write_lock

2009-05-15 Thread Josh Roesslein
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

[issue6030] io.BufferedWriter C module missing _write_lock

2009-05-15 Thread Josh Roesslein
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

[issue28818] simplify lookdict functions

2016-11-28 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue28818> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28820] Typo in section 6 of the Python 3.4 documentation

2016-11-29 Thread Josh Rosenberg
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

[issue26861] shutil.copyfile() doesn't close the opened files

2016-11-29 Thread Josh Rosenberg
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

[issue28842] PyInstanceMethod_Type isn't hashable

2016-11-30 Thread Josh Rosenberg
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&#

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-11-30 Thread Josh Rosenberg
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

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-11-30 Thread Josh Rosenberg
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

[issue26861] shutil.copyfile() doesn't close the opened files

2016-12-02 Thread Josh Rosenberg
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

[issue28864] Add devnull file-like object

2016-12-05 Thread Josh Rosenberg
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

[issue28882] RFC: Slice confusing with negative strides and the 0th element.

2016-12-06 Thread Josh Rosenberg
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

[issue28944] A lack of line 6

2016-12-12 Thread Josh Rosenberg
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

[issue28962] Crash when throwing an exception with a malicious __hash__ override

2016-12-13 Thread Josh Rosenberg
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

[issue28944] A lack of line 6

2016-12-13 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: -josh.r ___ Python tracker <http://bugs.python.org/issue28944> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28984] json.dump + indent creates trailing extra spaces

2016-12-15 Thread Josh Rosenberg
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

[issue28969] lru_cache is not threadsafe

2016-12-15 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue28969> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28982] multiprocessing.Queue.get(block=True, timeout=0) always raises queue.Empty

2016-12-15 Thread Josh Rosenberg
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

[issue29049] Lazy GC tracking frame

2016-12-22 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue29049> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29055] random.choice on empty sequence should hide previous exception [patch]

2016-12-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: Seems reasonable to me. -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue29055> ___ ___ Python-bugs-list mailin

[issue29061] secrets.randbelow(-1) hangs

2016-12-27 Thread Josh Rosenberg
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

[issue29213] python -m venv activate.bat has weird mix of line endings

2017-01-09 Thread Josh Wilson
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

[issue29293] Missing parameter "n" on multiprocessing.Condition.notify()

2017-01-18 Thread Josh Rosenberg
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&

[issue29331] Simplify argument parsing in sorted() and list.sort()

2017-01-20 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue29331> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29352] provide the authorative source for s[i:j] negative slice indices (<-len(s)) behavior for standard sequences

2017-01-24 Thread Josh Rosenberg
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

[issue29358] Add tp_fastnew and tp_fastinit to PyTypeObject, 15-20% faster object instanciation

2017-01-24 Thread Josh Rosenberg
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

[issue29423] using concurrent.futures.ProcessPoolExecutor in class giving 'TypeError: can't pickle _thread.RLock objects' in 3.6, but not 3.5

2017-02-02 Thread Josh Rosenberg
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

[issue29518] 'for' loop not automatically breaking (index error on line of loop header)

2017-02-09 Thread Josh Rosenberg
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

[issue27169] __debug__ is not optimized out at compile time for anything but `if:` and `while:` blocks

2016-05-31 Thread Josh Rosenberg
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

[issue22091] __debug__ in compile(optimize=1)

2016-05-31 Thread Josh Rosenberg
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

[issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers

2016-05-31 Thread Josh Rosenberg
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

[issue27169] __debug__ is not optimized out at compile time for anything but `if:` and `while:` blocks

2016-05-31 Thread Josh Rosenberg
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

[issue27236] Add CHAINED_COMPARE_OP opcode

2016-06-06 Thread Josh Rosenberg
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

[issue22455] idna/punycode give wrong results on narrow builds

2016-06-24 Thread Josh Lee
Changes by Josh Lee : -- nosy: +jleedev ___ Python tracker <http://bugs.python.org/issue22455> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27387] Thread hangs on str.encode() when locale is not set

2016-06-25 Thread Josh Purvis
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

[issue27385] itertools.groupby has misleading doc string

2016-06-28 Thread Josh Rosenberg
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

[issue27450] bz2: BZ2File should expose compression level as an attribute

2016-07-04 Thread Josh Triplett
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

[issue27451] gzip.py: Please save more of the gzip header for later examination

2016-07-04 Thread Josh Triplett
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

[issue27832] fractions.Fraction with 3 arguments: error passes silently

2016-08-23 Thread Josh Rosenberg
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

[issue27855] 2to3: Wrong code output w/ has_key

2016-08-24 Thread Josh Rosenberg
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

[issue27855] 2to3: Wrong code output w/ has_key

2016-08-24 Thread Josh Rosenberg
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

[issue27879] add os.syncfs()

2016-08-29 Thread Josh Rosenberg
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

[issue17981] SysLogHandler closes connection before using it

2013-05-15 Thread Josh Purvis
Changes by Josh Purvis : -- nosy: +Josh.Purvis ___ Python tracker <http://bugs.python.org/issue17981> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17981] SysLogHandler closes connection before using it

2013-05-15 Thread Josh Purvis
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

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-09 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.rosenberg ___ Python tracker <http://bugs.python.org/issue22524> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14102] argparse: add ability to create a man page

2014-10-14 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.rosenberg ___ Python tracker <http://bugs.python.org/issue14102> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22635] subprocess.getstatusoutput changed behavior in 3.4 (maybe 3.3.4?)

2014-10-14 Thread Josh Rosenberg
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

[issue22635] subprocess.getstatusoutput changed behavior in 3.4 (maybe 3.3.4?)

2014-10-14 Thread Josh Rosenberg
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

[issue22637] avoid using a shell in uuid: replce os.popen with subprocess.Popen

2014-10-14 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue22637> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function

2014-10-15 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue17870> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15944] memoryviews and ctypes

2014-10-16 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue15944> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2014-10-22 Thread Josh Rosenberg
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

[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-10-22 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue20185> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20341] Argument Clinic: add "nullable ints"

2014-10-22 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue20341> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22702] to improve documentation for join() (str method)

2014-10-22 Thread Josh Rosenberg
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

[issue13444] closed stdout causes error on stderr when the interpreter unconditionally flushes on shutdown

2014-11-11 Thread Josh Lee
Changes by Josh Lee : -- nosy: +jleedev ___ Python tracker <http://bugs.python.org/issue13444> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22948] Integer type and __add__

2014-11-26 Thread Josh Rosenberg
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

[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2014-11-28 Thread Josh Rosenberg
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;

[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2014-11-28 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- versions: -Python 3.4 ___ Python tracker <http://bugs.python.org/issue22955> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2014-11-28 Thread Josh Rosenberg
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

[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2014-11-28 Thread Josh Rosenberg
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

[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2014-11-28 Thread Josh Rosenberg
Changes by Josh Rosenberg : Removed file: http://bugs.python.org/file37313/pickle_getter_and_caller.patch ___ Python tracker <http://bugs.python.org/issue22955> ___ ___

[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2014-11-28 Thread Josh Rosenberg
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

[issue20692] Tutorial and FAQ: how to call a method on an int

2014-12-03 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue20692> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22995] Restrict default pickleability

2014-12-04 Thread Josh Rosenberg
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

[issue22996] Order of _io objects finalization can lose data in reference cycles

2014-12-04 Thread Josh Rosenberg
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

[issue23001] Accept mutable bytes-like objects

2014-12-06 Thread Josh Rosenberg
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

[issue23001] Accept mutable bytes-like objects

2014-12-06 Thread Josh Rosenberg
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.

[issue1425127] os.remove OSError: [Errno 13] Permission denied

2014-12-08 Thread Josh Rosenberg
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

[issue23030] lru_cache manual get/put

2014-12-11 Thread Josh Rosenberg
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

[issue23051] multiprocessing.pool methods imap()[_unordered()] deadlock

2014-12-19 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue23051> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23103] ipaddress should be Flyweight

2014-12-23 Thread Josh Rosenberg
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

[issue23103] ipaddress should be Flyweight

2014-12-23 Thread Josh Rosenberg
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

[issue23103] ipaddress should be Flyweight

2014-12-23 Thread Josh Rosenberg
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

[issue23103] ipaddress should be Flyweight

2014-12-24 Thread Josh Rosenberg
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__

[issue23152] fstat64 required on Windows

2015-01-02 Thread Josh Rosenberg
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

[issue23153] Clarify Boolean Clause Results

2015-01-02 Thread Josh Rosenberg
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

[issue23152] fstat64 required on Windows

2015-01-02 Thread Josh Rosenberg
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

[issue23179] New function proposal: string.from_iterable(iterable [, map_function])

2015-01-06 Thread Josh Rosenberg
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

[issue23179] New function proposal: string.from_iterable(iterable [, map_function])

2015-01-06 Thread Josh Rosenberg
Josh Rosenberg added the comment: Correction: I know map is sometimes considered *un-Pythonic -- ___ Python tracker <http://bugs.python.org/issue23179> ___ ___

[issue23086] Add start and stop parameters to the Sequence.index() ABC mixin method

2015-01-08 Thread Josh Rosenberg
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

[issue23086] Add start and stop parameters to the Sequence.index() ABC mixin method

2015-01-08 Thread Josh Rosenberg
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

[issue23201] Decimal(0)**0 is an error, 0**0 is 1, but Decimal(0) == 0

2015-01-08 Thread Josh Rosenberg
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

[issue23282] Slightly faster set lookup

2015-01-23 Thread Josh Rosenberg
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

[issue23336] Thread.LockType is misnamed

2015-02-02 Thread Josh Rosenberg
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

[issue23264] Add pickle support of dict views

2015-02-04 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue23264> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23403] Use pickle protocol 4 by default?

2015-02-06 Thread Josh Rosenberg
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

[issue23404] Python 3.5 does not build with Python 2.6.

2015-02-06 Thread Josh Rosenberg
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

[issue23404] Python 3.5 does not build with Python 2.6.

2015-02-06 Thread Josh Rosenberg
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

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-20 Thread Josh Rosenberg
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

[issue23492] Argument Clinic: improve generated parser for 1-argument functions

2015-02-20 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue23492> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20126] sched doesn't handle events added after scheduler starts

2015-05-28 Thread Josh Rosenberg
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

[issue19270] Document that sched.cancel() doesn't distinguish equal events and can break order

2015-05-28 Thread Josh Rosenberg
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

[issue24327] yield unpacking

2015-05-30 Thread Josh Rosenberg
Josh Rosenberg added the comment: Should someone be closing this with "yield from already exists"? -- nosy: +josh.r ___ Python tracker <http://bugs.python.o

[issue24358] Should compression file-like objects provide .fileno(), misleading subprocess?

2015-06-01 Thread Josh Rosenberg
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

[issue24358] Should compression file-like objects provide .fileno(), misleading subprocess?

2015-06-01 Thread Josh Rosenberg
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

[issue24358] Should compression file-like objects provide .fileno(), misleading subprocess?

2015-06-02 Thread Josh Rosenberg
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

[issue24379] operator.subscript

2015-06-22 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <http://bugs.python.org/issue24379> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24503] csv.writer fails when within csv.reader

2015-06-24 Thread Josh Rosenberg
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

[issue19111] 2to3 should remove from future_builtins import *

2015-06-24 Thread Josh Rosenberg
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

<    2   3   4   5   6   7   8   9   >