[issue1520] 'without make' documentation build anomaly

2007-12-03 Thread Tim Golden
Tim Golden added the comment: Joseph Armbruster wrote: > The bad news [should a different bug be created for this?] > > See cmdline.rst: > .. cmdoption:: -c > .. cmdoption:: -m > .. describe::

[issue1555] Print-media stylesheet for sphinx docs incomplete

2007-12-04 Thread Tim Golden
New submission from Tim Golden: The print-media stylesheet in the sphinx docs did not completely eliminate the on-screen layout. The attached patch is against r59327 of sphinx/style/default.css and has been tested against html, htmlhelp and web under native Win32. -- components

[issue1202] zlib.crc32() and adler32() return value

2007-12-09 Thread Tim Lesher
Tim Lesher added the comment: Both CRC-32 and ADLER32 are standards (described in ISO 3309 and RFC 1950 respectively); whatever fix implemented should make sure that the output complies. ISO 3309 isn't available online as far as I can see, but CRC-32 reference code is published in RFC

[issue1580] Use shorter float repr when possible

2007-12-10 Thread Tim Peters
Tim Peters added the comment: There is nothing you can do to repr() that's sufficient by itself to ensure eval(repr(x)) == x. The other necessary part is correctly rounded float /input/ routines. The 754 standard does not require correctly rounding input or output routines. It does re

[issue1580] Use shorter float repr when possible

2007-12-10 Thread Tim Peters
Tim Peters added the comment: Again, without replacing float input routines too, this is /not/ good enough to ensure eval(repr(x)) == x even across just 100%-conforming 754 platforms. It is good enough to ensure (well, assuming the code is 100% correct) eval(repr(x)) == x across conforming 754

[issue1580] Use shorter float repr when possible

2007-12-11 Thread Tim Peters
Tim Peters added the comment: [Raymond] > ... > NaNs in particular are a really > difficult case because our equality testing routines > have a fast path where identity implies equality. Works as intended in 2.5; this is Windows output: 1.#INF >>> nan = inf - inf >>

[issue1580] Use shorter float repr when possible

2007-12-11 Thread Tim Peters
Tim Peters added the comment: [Guido] > ... We can just say that Python > won't work correctly unless your float input routine is rounding > correctly; a unittest should detect whether this is the case. Sorry, but that's intractable. Correct rounding is a property that need

[issue1580] Use shorter float repr when possible

2007-12-11 Thread Tim Peters
Tim Peters added the comment: [Guido] > I take it your position is that this can never be done 100% correctly No. David Gay's code is believed to be 100% correctly-rounded and is also reasonably fast in most cases. I don't know of any other "open" string<->

[issue1580] Use shorter float repr when possible

2007-12-17 Thread Tim Peters
Tim Peters added the comment: It's not a question of bugs. Call the machine writing the string W and the machine reading the string R. Then there are 4 ways R can get back the double W started with when using the suggested algorithm: 1. W and R are the same machine. This is the way t

[issue1635] Float patch for inf and nan on Windows (and other platforms)

2007-12-18 Thread Tim Peters
Tim Peters added the comment: [Guido] > ... > (2) Will the Windows input routine still accept the *old* > representations for INF and NAN? IMO that's important (a) so as to be > able to read old pickles or marshalled data, (b) so as to be able to > read data files writte

[issue1635] Float patch for inf and nan on Windows (and other platforms)

2007-12-18 Thread Tim Peters
Tim Peters added the comment: Historical note: Guido is probably thinking of "the old" pickle and marshal here, which did have problems with inf and NaN on Windows (as in they didn't work at all). Michael Hudson changed them to use special bit patterns instead, IIRC

[issue1580] Use shorter float repr when possible

2007-12-18 Thread Tim Peters
Tim Peters added the comment: Guido, right, for that to work reliably, double->str and str->double must both round correctly on the platform doing the repr(), and str->double must round correctly on the platform reading the string. It's quite easy to understand why at a high le

[issue1669] shutils.rmtree fails on symlink, after deleting contents

2007-12-20 Thread Tim Koopman
New submission from Tim Koopman: When using rmtree with a symlink to a directory as path, it will first follow the symlink, (try to) remove all the contents of the source directory and then raise the exception "OSError: [Errno 20] Not a directory". Expected behaviour: The function s

[issue1669] shutil.rmtree fails on symlink, after deleting contents

2007-12-20 Thread Tim Koopman
Changes by Tim Koopman: -- title: shutils.rmtree fails on symlink, after deleting contents -> shutil.rmtree fails on symlink, after deleting contents __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.o

[issue1669] shutil.rmtree fails on symlink, after deleting contents

2007-12-20 Thread Tim Koopman
Tim Koopman added the comment: > While we are removing the contents of the target directory as expected, This is not what I expected at all. I expected the function to fail, because the target was not a directory, just a symlink to a directory. That, or behavior similar to the command &quo

[issue1580] Use shorter float repr when possible

2007-12-22 Thread Tim Peters
Tim Peters added the comment: If someone has a more recent version of MS's compiler, I'd be interested to know what this does: inc = 2.0**-43 base = 1024.0 xs = ([base + i*inc for i in range(-4, 0)] + [base] + [base + 2*i*inc for i in (1, 2)]) print xs print ["%.16g&q

[issue1580] Use shorter float repr when possible

2007-12-30 Thread Tim Peters
Tim Peters added the comment: Thanks, Amaury! That settles an issue raised earlier: MS's string<->double routines still don't do correct rounding, and "aren't even close" (the specific incorrect rounding showed here isn't

[issue1694] floating point number round failures under Linux

2007-12-31 Thread Tim Peters
Tim Peters added the comment: Right, Unix-derived C libraries generally do IEEE-754 "round to nearest/even" rounding, while Microsoft's do "add a half and chop" rounding. The Python reference manual says nothing about this, and neither does the C standard (well, C89

[issue1694] floating point number round failures under Linux

2007-12-31 Thread Tim Peters
Tim Peters added the comment: Nice example! Yes, the round() implementation is numerically naive, in this particular case ignoring that x+0.5 isn't necessarily representable (it multiplies the input by 10.0, adds 0.5, takes the floor, then divides by 10.0, and in this specific case addin

[issue1640] Enhancements for mathmodule

2008-01-03 Thread Tim Peters
Tim Peters added the comment: The functionality of what was called (and I agree confusingly so) "sign()" here is supplied by "signbit()" in C99. That standard isn't free, but the relevant part is incorporated in the free Open Group standards: http://www.opengroup

[issue789290] Minor FP bug in object.c

2008-01-03 Thread Tim Peters
Tim Peters added the comment: Unassigned myself -- I don't care about this 4 years later either ;-) -- assignee: tim_one -> nobody nosy: +nobody Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue1781] ConfigParser: add_section('DEFAULT') causes duplicate sections.

2008-01-09 Thread Tim Lesher
New submission from Tim Lesher: ConfigParser doesn't prevent "manually" adding a section named DEFAULT; however, doing so creates a duplicate, inaccessible [DEFAULT] section in the config file: >>> import sys, ConfigParser >>> c = ConfigParser.ConfigPa

[issue1733134] sqlite3.dll cannot be relocated

2008-01-11 Thread Tim Delaney
Tim Delaney added the comment: I've got no further details on this bug - I've never encountered it myself. _ Tracker <[EMAIL PROTECTED]> <http://bugs.pyth

[issue1640] Enhancements for mathmodule

2008-01-20 Thread Tim Peters
Tim Peters added the comment: Mark, these are the "spirit of 754" rules: 1. If the mathematical result is a real number, but of magnitude too large to approximate by a machine float, overflow is signaled and the result is an infinity (with the appropriate sign). 2. If the mathemati

[issue1964] Slight adjustment to sphinx print-media stylesheet

2008-01-29 Thread Tim Golden
New submission from Tim Golden: My previous patch to the print stylesheet used by Sphinx was a little overenthusiastic and resulted in the right edge of the text truncating on some printers. This version reverts a part of that and gives a useful result on the printers I've tried. Patch att

[issue2194] Tiny patch to docs

2008-02-26 Thread Tim Golden
New submission from Tim Golden: A patch against r61085 of /doc to correct some very minor typos in the docs -- components: Documentation files: python-doc-r61085.patch keywords: patch messages: 63048 nosy: tim.golden severity: minor status: open title: Tiny patch to docs versions

[issue2207] Bug in Sphinx highlighting when pygments not available

2008-02-29 Thread Tim Golden
New submission from Tim Golden: When pygments is not available to the sphinx build environment, the PygmentsBridge in the highlighting.py module raises an exception in the unhighlighted function. This function attempts to use the .dest attribute which isn't set in the __init__ if the pyg

[issue2208] Patch to doc/make.bat to allow non-standard HTML Help location

2008-02-29 Thread Tim Golden
New submission from Tim Golden: The doc/make.bat file for building the docs under Windows assumes the standard location for the HTML Help Workshop. The attached patch looks for an env var called HTMLHELP and uses that if it's set, falling back to the standard location. -- compo

[issue2208] Patch to doc/make.bat to allow non-standard HTML Help location

2008-02-29 Thread Tim Golden
Tim Golden added the comment: Corrected patch which replaces the @echo off at the top of the file. Added file: http://bugs.python.org/file9573/doc-make-r61125.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/

[issue2239] Tiny patch to cmdline docs

2008-03-05 Thread Tim Golden
New submission from Tim Golden: The docs for the PYTHONPATH var indicate that its items are separated by colons. In fact they're separated by whatever's customary for the O/S. Patch attached. -- components: Documentation files: doc-using-cmdline-r61249.patch keywords: patc

[issue2239] Tiny patch to cmdline docs

2008-03-05 Thread Tim Golden
Tim Golden added the comment: Alexander Belopolsky wrote: > Alexander Belopolsky added the comment: > > PYTHONPATH variable is likely to be defined by sysadmins who may not know > what os.pathsep is. Maybe it is better to say "OS-dependent separator > (';' on W

[issue2239] Tiny patch to cmdline docs

2008-03-05 Thread Tim Golden
Tim Golden added the comment: Alexander Belopolsky wrote: > Alexander Belopolsky added the comment: > >> .. but I have made the doc reference a link to the os.pathsep > > I knew you would say that :-). I was making my comment out of real life > experience: sysadmi

[issue2239] Tiny patch to cmdline docs

2008-03-05 Thread Tim Golden
Tim Golden added the comment: Alexander Belopolsky wrote: > Alexander Belopolsky added the comment: > >> Feel free to propose an alternative wording for the patch > > I thought I already did in my first post. The complete sentence should > read: > > "&q

[issue1471934] Python libcrypt build problem on Solaris 8

2008-03-13 Thread Tim Mooney
Tim Mooney <[EMAIL PROTECTED]> added the comment: Paul, your comment in your patch, about this being fixed post Solaris 9, doesn't appear to be correct. I have x86_64-sun-solaris2.10 with all patches applied and the problem exists there too. I'm using Workshop 12. --

[issue1306248] Add 64-bit Solaris 9 build instructions to README

2008-03-13 Thread Tim Mooney
Tim Mooney <[EMAIL PROTECTED]> added the comment: I agree with Terry's comment -- Python's build machinery for multi-abi systems is suboptimal, but documenting some methods that work for some people would at least help. -- nosy: +enchanter _

[issue2294] Bug in Pickle protocol involving __setstate__

2008-03-15 Thread Tim Gordon
Tim Gordon <[EMAIL PROTECTED]> added the comment: You've missed off the two underscores after the name __setstate__ :p -- nosy: +QuantumTim __ Tracker <[EMAIL PROTECTED]> <http://bugs.

[issue2304] subprocess under windows fails to quote properly under Windows when shell=True

2008-03-16 Thread Tim Golden
New submission from Tim Golden <[EMAIL PROTECTED]>: The subprocess.Popen function reorganises the command line for process creation when shell=True is passed in under Windows. It runs the existing executable & arguments as arguments to %COMSPEC% /c. However this fails when a second

[issue2304] subprocess under windows fails to quote properly when shell=True

2008-03-16 Thread Tim Golden
Changes by Tim Golden <[EMAIL PROTECTED]>: -- title: subprocess under windows fails to quote properly under Windows when shell=True -> subprocess under windows fails to quote properly when shell=True __ Tracker <[EMAIL PROTE

[issue2304] subprocess under windows fails to quote properly when shell=True

2008-03-17 Thread Tim Golden
Tim Golden <[EMAIL PROTECTED]> added the comment: Gabriel Genellina wrote: > Gabriel Genellina <[EMAIL PROTECTED]> added the comment: > > You aren't testing the modified code, the Popen call should say > shell=True. > > I think that a more PEP8-complian

[issue2304] subprocess under windows fails to quote properly when shell=True

2008-03-18 Thread Tim Golden
Tim Golden <[EMAIL PROTECTED]> added the comment: Updated patch against r61514. Test code now PEP8-compliant (I hope). New tests cover spaces in command and parameter with and without shell=True, both as simple command string and as list of command/args. Added file: http://bugs.pyth

[issue2421] doc\make.bat fails for htmlhelp because of hardcoded filename

2008-03-19 Thread Tim Golden
New submission from Tim Golden <[EMAIL PROTECTED]>: doc\make.bat, used to build the docs under Windows, retains the hardcoded pydoc.hhp name when building htmlhelp. Now that the help files are built as .chm this file no longer exists and the build fails. The attached patch to make.bat

[issue2528] Change os.access to check ACLs under Windows

2008-04-01 Thread Tim Golden
New submission from Tim Golden <[EMAIL PROTECTED]>: At present, os.access under Windows simply calls GetFileAttributes to determine the readonly attribute (ignoring directories). The patch attached combines this with the use of the AccessCheck API to compare the user's permissions

[issue2584] numeric overflow in IDLE

2008-04-08 Thread Tim Wilcoxson
New submission from Tim Wilcoxson <[EMAIL PROTECTED]>: According to the documentation there is not suppose to be numeric overflow in python 2.5. However If you run a for loop with the range(1, 3)a couple of times (for me 2 or 3 times worked) in the IDLE (1.2.2)GUI . It will

[issue2584] numeric overflow in IDLE

2008-04-08 Thread Tim Wilcoxson
Tim Wilcoxson <[EMAIL PROTECTED]> added the comment: msg65177, i did try to close cmd. thats why it closed. i wasnt clear enough. my apologies. it merely lags in command line in gives a memory error. in IDLE, it wont respond, and it gives a logon process erorr in windows if you try to vi

[issue2584] numeric overflow in IDLE

2008-04-08 Thread Tim Wilcoxson
Tim Wilcoxson <[EMAIL PROTECTED]> added the comment: not a nick aye? lol. I am new cant you tell. And when i ran the script nothing could be closed. And, yes, I realize it could be a memory exhaustion issue with windows. windows is notorious for crappy resource handling. However, my c

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2008-04-15 Thread Tim Lesher
New submission from Tim Lesher <[EMAIL PROTECTED]>: The urllib.quote docstring implies that it quotes only characters in RFC 2396's "reserved" set. However, urllib.quote currently escapes all characters except those in an "always_safe" list, which consists of alph

[issue1674032] Make threading.Event().wait(timeout=3) return isSet

2008-05-06 Thread Tim Lesher
Tim Lesher <[EMAIL PROTECTED]> added the comment: This one-line change to threading.py makes Event.wait() return isSet(). Also includes the corresponding update to documentation in threading.rst. -- keywords: +patch nosy: +tlesher Added file: http://bugs.python.org/file10203/even

[issue1674032] Make threading.Event().wait(timeout=3) return isSet

2008-05-06 Thread Tim Lesher
Changes by Tim Lesher <[EMAIL PROTECTED]>: -- assignee: -> georg.brandl components: +Documentation, Library (Lib) -Interpreter Core nosy: +georg.brandl _ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue2779] Python 3.0a4 crashes on script in a path with non-ASCII characters (Windows)

2008-05-07 Thread Tim Pietzcker
New submission from Tim Pietzcker <[EMAIL PROTECTED]>: When I try to run a script that is contained in a directory whose path contains non-ASCII characters (e. g. Umlauts), Python 3.0a4 crashes with the following error message: (Windows cmd console): E:\Eigene Dateien\Kl

[issue2780] Python 3.0a4 crashes on script in a path with non-ASCII characters (Windows)

2008-05-07 Thread Tim Pietzcker
New submission from Tim Pietzcker <[EMAIL PROTECTED]>: Apologies if this has been reported before; I couldn#T find it on a search but maybe I used the wrong search terms. When I try to run a script that is contained in a directory whose path contains non-ASCII characters (e. g. Umlauts),

[issue2779] Python 3.0a4 crashes on script in a path with non-ASCII characters (Windows)

2008-05-07 Thread Tim Pietzcker
Tim Pietzcker <[EMAIL PROTECTED]> added the comment: Please delete this issue - clicked on "Submit" too soon. Sorry again. __ Tracker <[EMAIL PROTECTED]> <http://

[issue2781] Tiny patch to _winreg docs

2008-05-07 Thread Tim Golden
New submission from Tim Golden <[EMAIL PROTECTED]>: The docs for _winreg refer to RegLoadKey, which is the underlying API. The function is actually exposed as LoadKey. Patch attached. -- assignee: georg.brandl components: Documentation files: _winreg.patch keywords: patch me

[issue2780] Python 3.0a4 crashes on script in a path with non-ASCII characters (Windows)

2008-05-08 Thread Tim Pietzcker
Tim Pietzcker <[EMAIL PROTECTED]> added the comment: I should perhaps add that this happened on a German Windows XP Pro SP2 installation. __ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue4115] split() method

2008-10-13 Thread Tim Gordon
Tim Gordon <[EMAIL PROTECTED]> added the comment: This is the intended behaviour. See http://www.python.org/doc/2.5.2/lib/string-methods.html for details. -- nosy: +QuantumTim ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue4081] Error copying directory to _static in Sphinx

2008-10-18 Thread Tim Delaney
Tim Delaney <[EMAIL PROTECTED]> added the comment: Confirmed fixed in 0.43 - this issue can be closed. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue4203] adapt sphinx-quickstart for windows

2008-10-25 Thread Tim Michelsen
New submission from Tim Michelsen <[EMAIL PROTECTED]>: Hello, for users on the windows platform, it could be of great help if the sphinx-quickstart would be adjuste to their platform. Here are my suggestions: * create a batch file instead of the Makefile * make-docs.bat, contents:

[issue4203] adapt sphinx-quickstart for windows

2008-10-25 Thread Tim Michelsen
Changes by Tim Michelsen <[EMAIL PROTECTED]>: -- type: -> feature request ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4203> ___ __

[issue4488] Python Documentation not Newb Friendly

2008-12-02 Thread Tim Golden
Tim Golden <[EMAIL PROTECTED]> added the comment: What would be helpful would be a specific suggestion from the OP (or, better still, a doc patch) as to exactly what should change or at least what kind of words should go where. As it stands, this report highlights a real but quite g

[issue4483] Error to build _dbm module during make

2008-12-04 Thread Tim Lesher
Changes by Tim Lesher <[EMAIL PROTECTED]>: -- nosy: +tlesher ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4483> ___ ___ Python

[issue4633] file.tell() gives wrong result

2008-12-11 Thread Tim Gordon
Tim Gordon <[EMAIL PROTECTED]> added the comment: See the documentation for file.next (http://docs.python.org/library/stdtypes.html#file.next). As you can see, file.next uses a buffer which will mess with the result of other methods, such as file.tell. -- nosy: +Quan

[issue4633] file.tell() gives wrong result

2008-12-11 Thread Tim Gordon
Tim Gordon <[EMAIL PROTECTED]> added the comment: Try using the readline method instead of next. I don't think that applies the same buffering. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.

[issue4638] 1 is 1 is allways true while 1.0 is 1.0 may sometimes be true

2008-12-11 Thread Tim Peters
Tim Peters added the comment: "is" is for testing object identity, not numeric equality. That "1 is 1" is always true is simply an implementation detail common to all recent versions of CPython, due to CPython caching "very small" integer objects. The language d

[issue4638] 1 is 1 is allways true while 1.0 is 1.0 may sometimes be true

2008-12-11 Thread Tim Peters
Tim Peters added the comment: Please take requests for discussion to comp.lang.python. Many people there understand this behavior and will be happy to explain it in as much detail as you want. The bug tracker is not the place for this. ___ Python tracker

[issue4680] deque class should include high-water mark

2008-12-17 Thread Tim Peters
Tim Peters added the comment: There's no need to keep asking -- this report was already rejected ;-) Seriously, the efficiency argument carries no weight with me -- in 15 years of using Queue in a variety of applications, the time it takes to .put and .get "here's a piec

[issue4723] os.path.basename error on directory names with numbers

2008-12-22 Thread Tim Golden
Tim Golden added the comment: You need to use raw strings or to use forward-slashes in your pathnames: r"c:\downloads\hacking\0812logcompress" or "c:/downloads/hacking/0812logcompress" The sequence \0 has a special meaning in strings, introducing an octal escape, I thi

[issue5015] The Py_SetPythonHome C API function is undocumented

2009-02-03 Thread Tim Lesher
Changes by Tim Lesher : -- nosy: +tlesher ___ Python tracker <http://bugs.python.org/issue5015> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5242] eval() function in List Comprehension doesn't work

2009-02-13 Thread Tim Gordon
Tim Gordon added the comment: If you know what variable you are going to be eval-ing, or at least, have a list of those that might be eval-ed, you can get around this issue by making sure they are explicitly referenced in the inner scope (i.e., in the list comprehension). For example, even

[issue5261] with lock fails on multiprocessing

2009-02-14 Thread Tim Golden
Tim Golden added the comment: Reproduced on trunk r69621 -- nosy: +tim.golden versions: +Python 2.7 ___ Python tracker <http://bugs.python.org/issue5261> ___ ___

[issue5261] with lock fails on multiprocessing

2009-02-14 Thread Tim Golden
Tim Golden added the comment: Problem seems to be in Modules/_multiprocessing/semaphore.c line 549 where "__enter__" is defined as an alias for semlock_acquire, as is "acquire" a few lines above. However, while "acquire" specifies METH_VARARGS | METH_

[issue5261] with lock fails on multiprocessing

2009-02-15 Thread Tim Golden
Changes by Tim Golden : -- type: -> crash ___ Python tracker <http://bugs.python.org/issue5261> ___ ___ Python-bugs-list mailing list Unsubscri

[issue2733] mmap resize fails on anonymous memory (Windows)

2009-02-16 Thread Tim Golden
Tim Golden added the comment: OK, I can see why this is happening and in fact there are two levels of problem. The trouble is that, in my ignorance, I can't work out exactly why the existing code is doing what it's doing. (References to mmapmodule.c at r69666) Problem 1: At lin

[issue2733] mmap resize fails on anonymous memory (Windows)

2009-02-16 Thread Tim Golden
Tim Golden added the comment: Patch attached to mmapmodule.c and test_mmap.py -- keywords: +patch Added file: http://bugs.python.org/file13107/mmapmodule.patch ___ Python tracker <http://bugs.python.org/issue2

[issue1285] setp.py error "The process cannot access the file ..."

2009-02-16 Thread Tim Golden
Tim Golden added the comment: Can't reproduce under Python 2.6 or Python 2.5.2. Likelihood is a virus checker / indexer process. -- nosy: +tim.golden ___ Python tracker <http://bugs.python.org/i

[issue5282] mmap.resize and offset

2009-02-16 Thread Tim Golden
Tim Golden added the comment: Have a look at issue 2733 http://bugs.python.org/issue2733 where I've just proposed a patch in this area. I'm also not sure exactly what's going on, but I have patched what I believe is a linked pair of bugs in that code. -- no

[issue46990] Surprising list overallocation from .split()

2022-03-11 Thread Tim Peters
New submission from Tim Peters : When looking into a StackOverflow question about surprisingly high memory use, I stumbled into this (under 3.10.1, Win64): >>> import sys >>> s = "1 2 3 4 5".split() >>> s ['1', '2', '3', &#x

[issue46990] Surprising list overallocation from .split()

2022-03-11 Thread Tim Peters
Change by Tim Peters : -- type: behavior -> resource usage ___ Python tracker <https://bugs.python.org/issue46990> ___ ___ Python-bugs-list mailing list Un

[issue46990] Surprising list overallocation from .split()

2022-03-11 Thread Tim Peters
Tim Peters added the comment: Well, that's annoying ;-) In context, the OP was saving a list of 10 million splits. So each overallocation by a single element burned 80 million bytes of RAM. Overallocating by 7 burned 560 million bytes. Which is unusual. Usually a split result is short-

[issue47037] Build problems on Windows

2022-03-16 Thread Tim Peters
Tim Peters added the comment: Actually, I see this ('Debug Assertion Failed!' in the same spot) every time I try to run the test suite with a debug build, starting yesterday. Didn't have time to track it down. It _appeared_ to an obscure consequence of this commit:

[issue47037] Build problems on Windows

2022-03-16 Thread Tim Peters
Tim Peters added the comment: BTW, the frequency of this new failure mode appears to be vastly increased if running the debug tests with "-j0". For example, the box popping up is reliably the very first sign of life if I run this from the PCBuild directory: rt

[issue47037] Build problems on Windows

2022-03-16 Thread Tim Peters
Tim Peters added the comment: Christian, yes, but only in a debug build. See Eryk Sun's message a bit above: the machinery to prevent this is already present, but isn't getting called early enough. -- ___ Python tracker <https://bu

[issue36744] functools.singledispatch: Shouldn't require a positional argument if there is only one keyword argument

2022-03-17 Thread Tim Mitchell
Tim Mitchell added the comment: I would really prefer the dispatch logic remains simple and fast, rather than handle single keyword arguments. -- nosy: +Tim Mitchell2 ___ Python tracker <https://bugs.python.org/issue36

[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2022-03-17 Thread Tim Mitchell
Tim Mitchell added the comment: I've come up with a version that does not require a base class. Seems a bit hacky as the descriptor __get__ method now modifies the class to put the dispatch table in place the first time the method is accessed. -- Added file: https://bugs.pytho

[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2022-03-17 Thread Tim Mitchell
Change by Tim Mitchell : Added file: https://bugs.python.org/file50689/test_sdm.py ___ Python tracker <https://bugs.python.org/issue36457> ___ ___ Python-bugs-list mailin

[issue47080] Use atomic groups to simplify fnmatch

2022-03-20 Thread Tim Peters
New submission from Tim Peters : I added some excruciatingly obscure technical tricks to ensure that fnmatch.py's regexps can't fall into exponential-time match failures. It's hard to stop re from useless backtracking. But the new "atomic groups" make that easy i

[issue47080] Use atomic groups to simplify fnmatch

2022-03-21 Thread Tim Peters
Change by Tim Peters : -- keywords: +patch pull_requests: +30118 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32029 ___ Python tracker <https://bugs.python.org/issu

[issue47080] Use atomic groups to simplify fnmatch

2022-03-21 Thread Tim Peters
Tim Peters added the comment: New changeset 5c3201e146b251017cd77202015f47912ddcb980 by Tim Peters in branch 'main': bpo-47080: Use atomic groups to simplify fnmatch (GH-32029) https://github.com/python/cpython/commit/5c3201e146b251017cd77202015f47

[issue47080] Use atomic groups to simplify fnmatch

2022-03-21 Thread Tim Peters
Change by Tim Peters : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue47114] random.choice and random.choices have different distributions

2022-03-24 Thread Tim Peters
Tim Peters added the comment: Definitely a duplicate, and I doubt Mark or Raymond will change their mind. One observation: while floats are not uniformly dense in [0, 1), random() results are uniformly spaced. Each is of the form I / 2**53 for an integer I in range(2**53). -- nosy

[issue45382] platform() is not able to detect windows 11

2022-03-28 Thread Tim Golden
Tim Golden added the comment: > I don't see why the wmi module ( https://pypi.org/project/WMI/ ) can't be > used instead to get the information Well I can speak here as the author of that module and as an (occasional) core developer. The wmi module stands on the shouldere

[issue47145] Improve graphlib.TopologicalSort by removing the prepare step

2022-03-30 Thread Tim Peters
Tim Peters added the comment: Various kinds of tasks: - "Power switch must be on." Needs to done the first time. _May_ need to be done again later (if some later task turns the power off again). Can be done any number of times without harm (beyond the expense of checking), so lo

[issue47145] Improve graphlib.TopologicalSort by removing the prepare step

2022-03-30 Thread Tim Peters
Tim Peters added the comment: I believe I'm elaborating on your "footgun". It doesn't matter to me whether we pick some scheme and document it, _if_ that scheme is incoherent, impossible to remember, error-prone, etc. That's how, e.g., regular expression syn

[issue47121] math.isfinite() can raise exception when called on a number

2022-04-05 Thread Tim Peters
Tim Peters added the comment: I'll testify that I won't volunteer one second of my time pursuing these abstract "purity" crusades ;-) `isfinite()` et alia were added to supply functions defined by current standards to work on IEEE floating-point values. People work

[issue37863] Speed hash(fractions.Fraction)

2019-08-14 Thread Tim Peters
New submission from Tim Peters : Recording before I forget. These are easy: 1. As the comments note, cache the hash code. 2. Use the new (in 3.8) pow(denominator, -1, modulus) to get the inverse instead of raising to the modulus-2 power. Should be significantly faster. If not, the new

[issue37863] Speed up hash(fractions.Fraction)

2019-08-15 Thread Tim Peters
Tim Peters added the comment: Why I expected a major speedup from this: the binary exponentiation routine (for "reasonably small" exponents) does 30 * ceiling(exponent.bit_length() / 30) multiply-and-reduces, plus another for each bit set in the exponent. That's a major dif

[issue37863] Speed up hash(fractions.Fraction)

2019-08-15 Thread Tim Peters
Tim Peters added the comment: Well, details matter ;-) Division in Python is expensive. In the exponentiation algorithm each reduction (in general) requires a 122-by-61 bit division. In egcd, after it gets going nothing exceeds 61 bits, and across iterations the inputs to the division

[issue37863] Speed up hash(fractions.Fraction)

2019-08-15 Thread Tim Peters
Tim Peters added the comment: Mark, I did just a little browsing on this. It seems it's well known that egcd beats straightforward exponentiation for this purpose in arbitrary precision contexts, for reasons already sketched (egcd needs narrower arithmetic from the start, benefits fro

[issue29535] datetime hash is deterministic in some cases

2019-08-16 Thread Tim Peters
Tim Peters added the comment: I'm with Mark: leave numeric hashes alone. There's no reason to change them, and in addition to what Mark wrote it's a positively Good Thing that `hash(i) == i` for all sufficiently small ints. Not only is that efficient to compute, it guara

[issue37863] Speed up hash(fractions.Fraction)

2019-08-17 Thread Tim Peters
Tim Peters added the comment: Some random notes: - 1425089352415399815 appears to be derived from using the golden ratio to contrive a worst case for the Euclid egcd method. Which it's good at :-) Even so, the current code runs well over twice as fast as when replacing the pow(tha

[issue37863] Speed up hash(fractions.Fraction)

2019-08-18 Thread Tim Peters
Tim Peters added the comment: For posterity: "Modular Inverse Algorithms Without Multiplications for Cryptographic Applications" Laszlo Hars https://link.springer.com/article/10.1155/ES/2006/32192 """ On the considered computational platforms fo

[issue37893] pow() should disallow inverse when modulus is +-1

2019-08-20 Thread Tim Peters
New submission from Tim Peters : For example, these should all raise ValueError instead: >>> pow(2, -1, 1) 0 >>> pow(1, -1, 1) 0 >>> pow(0, -1, 1) 0 >>> pow(2, -1, -1) 0 >>> pow(1, -1, -1) 0 >>> pow(0, -1, -1) 0 -- component

<    1   2   3   4   5   6   7   8   9   10   >