[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On the topic average vs. minimum, it's interesting to see this pop up every now and then. When I originally wrote pybench late in 1997, I used average, since it gave good results on my PC at the time. Later on, before pybench was added to Tools/ in P

[issue45020] Freeze all modules imported during startup.

2021-09-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 22.09.2021 20:47, Brett Cannon wrote: > What about if there isn't a pre-computed location for __file__? I could > imagine a self-contained CPython build where there is no concept of a file > location on disk for anything using this.

[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2021-09-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 22.09.2021 21:02, Raymond Hettinger wrote: >> The language specification says that the dicts maintain insertion >> order, but the wording implies that this only to explicit >> dictionaries, not instance attribute or other namespace d

[issue45020] Freeze all modules imported during startup.

2021-09-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Eric, I noticed that you are freezing os.py. Please be aware that this module is often being used as indicator for where the stdlib was installed (the stdlib itself does this in site.py to read the LICENSE and the test suite also uses os.__file__ in a

[issue45020] Freeze all modules imported during startup.

2021-09-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 25.09.2021 18:20, STINNER Victor wrote: > > STINNER Victor added the comment: > > Marc-Andre: I suppose that you're talking about LANDMARK in Modules/getpath.c > and PC/getpathp.c. Now that you mention it: yes, that as well :-)

[issue36819] Crash during encoding using UTF-16/32 and custom error handler

2021-09-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Looking at the specs in PEP 293 (https://www.python.org/dev/peps/pep-0293/), it is certainly possible for the error handler to return a newpos outside the range start - end, meaning in most cases: a value >= end. There's a good reason for t

[issue36819] Crash during encoding using UTF-16/32 and custom error handler

2021-09-29 Thread Marc-Andre Lemburg
Change by Marc-Andre Lemburg : -- components: +Unicode nosy: +ezio.melotti ___ Python tracker <https://bugs.python.org/issue36819> ___ ___ Python-bugs-list mailin

[issue36819] Crash during encoding using UTF-16/32 and custom error handler

2021-09-29 Thread Marc-Andre Lemburg
Change by Marc-Andre Lemburg : -- nosy: +doerwalter ___ Python tracker <https://bugs.python.org/issue36819> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36819] Crash during encoding using UTF-16/32 and custom error handler

2021-09-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 29.09.2021 10:41, Serhiy Storchaka wrote: > > Restricting the returned position to be strictly larger than start would > solve the problem with infinite loop and OOM. But this is a different issue. Yes, this would make sense, since having

[issue45372] Unwarranted "certificate has expired" when urlopen-ing R3 sites

2021-10-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Are you sure that all updates on the failing machine have been correctly installed ? It's possible that the list of CA root certs is not up to date on the machine. You can use certmgr.msc to check the list of installed CA root certs. --

[issue45372] Unwarranted "certificate has expired" when urlopen-ing R3 sites

2021-10-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 05.10.2021 12:48, Aivar Annamaa wrote: > > I can list the root certs with certmgr, but I'm not sure which piece to > investigate further. Check the certs in the LE chain as listed on the page you quoted and compare them to the workin

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

2021-10-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: win32_ver() should be using the internal Windows APIs to figure out the version. I do wonder why those don't return the same version as the "ver" command line tool. Adding our Windows experts to the noisy list. -- nosy: +lemb

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

2021-10-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 05.10.2021 22:30, Steve Dower wrote: > The version number for "Windows 11" still starts with 10.0. Just like how > Windows 5.x and 6.x were around for a very long time each ;) > > There are tables in platform module that map t

[issue45395] Frozen stdlib modules are discarded if custom frozen modules added.

2021-10-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I'm not sure I follow, but in any case, please make sure that the freeze tool in Tools/ continues to work with the new mechanism. The freeze tool would also need to know which modules are already frozen via the new script, so that modules don&

[issue26651] Deprecate register_adapter() and register_converter() in sqlite3

2021-10-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: FWIW: I'm -1 on removing the possibility to register conversion or adapter hooks in sqlite3. Such mechanisms have become a standard with Python database modules and are widely used to adapt them to applications or middleware using the modules.

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

2021-10-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: It's probably time to extend the marketing version detection mechanism to use the build number as reference instead of the major.minor system version numbers. Here's a good reference for this: https://en.wikipedi

[issue29410] Moving to SipHash-1-3

2021-10-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Since the days this was discussed, a lot of new and faster hash algorithms have been developed. It may be worthwhile looking at those instead. E.g. xxHash is a lot more performant than siphash: https://github.com/Cyan4973/xxHash (the link also has a

[issue29410] Moving to SipHash-1-3

2021-10-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.10.2021 11:49, Inada Naoki wrote: > Hash DoS is not only for HTTP headers. Everywhere creating dict from > untrusted source can be attack vector. > For example, many API servers receive JSON as HTTP request body. Limiting > HTTP

[issue29410] Moving to SipHash-1-3

2021-10-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.10.2021 12:16, Christian Heimes wrote: > >> That's certainly true, but at the same time, just focusing on string > hashes only doesn't really help either, e.g. it is very easy to > create a DoS with numeric keys or other

[issue29410] Moving to SipHash-1-3

2021-10-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: BTW: We already use (a slight variant of) xxHash for tuples: https://bugs.python.org/issue34751 The issues is an interesting read, in particular on how xxHash was eventually chosen, with a whole set of other hash algorithms in between

[issue29410] Moving to SipHash-1-3

2021-10-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.10.2021 12:48, Christian Heimes wrote: > >> I don't quite follow. Why is it fine that you discuss DoS, but it's not > fine when others discuss DoS ? > > But this BPO is not about discussing mitigations against DoS attac

[issue29410] Moving to SipHash-1-3

2021-10-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.10.2021 15:29, Christian Heimes wrote: > > Christian Heimes added the comment: > > JP got back to me > > On 07/10/2021 14.34, Jean-Philippe Aumasson wrote: >> xxHash is much faster indeed, but collisions seem trivial

[issue45395] Frozen stdlib modules are discarded if custom frozen modules added.

2021-10-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.10.2021 16:40, Eric Snow wrote: > > On Thu, Oct 7, 2021 at 1:17 AM Marc-Andre Lemburg > wrote: >> I'm not sure I follow, but in any case, please make sure that >> the freeze tool in Tools/ continues to work with the new m

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

2021-10-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 08.10.2021 02:15, Eryk Sun wrote: > >> use the build number as reference instead of the major.minor > > It could check the (major, minor, build) tuple, which allows reporting 10.1+ > as "post11" and minimizes hard coding o

[issue45476] [C API] Convert "AS" functions, like PyFloat_AS_DOUBLE(), to static inline functions

2021-10-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I am with Raymond on this one. If "protecting against wrong use" is the only reason to go down the slippery path of starting to rely on compiler optimizations for performance critical operations, the argument is not good enough. If people do

[issue45476] [C API] Convert "AS" functions, like PyFloat_AS_DOUBLE(), to static inline functions

2021-10-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 15.10.2021 11:43, STINNER Victor wrote: > Again, I'm not aware of any performance issue caused by short static inline > functions like Py_TYPE() or the proposed PyFloat_AS_DOUBLE(). If there is a > problem, it should be addressed, sin

[issue45395] Frozen stdlib modules are discarded if custom frozen modules added.

2021-10-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 14.10.2021 22:56, Eric Snow wrote: > > @MAL, what's the best way to make sure Tools/freeze is still working? I > don't see any tests for it in the test suite. I tried running the test in > Tools/freeze/test, but I can't g

[issue45490] [meta][C API] Avoid C macro pitfalls and usage of static inline functions

2021-10-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Meta comment :-) ... wouldn't it be better to enable the Github wiki feature for such collections ? -- nosy: +lemburg ___ Python tracker <https://bugs.python.org/is

[issue45395] Frozen stdlib modules are discarded if custom frozen modules added.

2021-10-16 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 16.10.2021 01:31, Eric Snow wrote: > > @MAL, who's maintaining Tools/freeze? I'm not aware of who's using it (other > than you, of course). It looks like PyRun isn't compatible with anything > newer than 3.5, so it

[issue19459] Python does not support the GEORGIAN-PS charset

2021-10-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 19.10.2021 10:44, Serhiy Storchaka wrote: > > Possible solutions (they can be combined): > > 1. Add support for the GEORGIAN-PS charset and all other encodings used in > libc (issue22679). The problem is that it is difficult to g

[issue45395] Frozen stdlib modules are discarded if custom frozen modules added.

2021-10-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 16.10.2021 21:20, Eric Snow wrote: > > On Sat, Oct 16, 2021 at 5:01 AM Marc-Andre Lemburg > wrote: >> I can try to port PyRun to 3.9 and 3.10 to see whether I run into any issues. >> Would that help ? > > Yeah, that wo

[issue45395] Frozen stdlib modules are discarded if custom frozen modules added.

2021-10-20 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 19.10.2021 18:47, Marc-Andre Lemburg wrote: > >> On Sat, Oct 16, 2021 at 5:01 AM Marc-Andre Lemburg >> wrote: >>> I can try to port PyRun to 3.9 and 3.10 to see whether I run into any >>> issues. >>> Would

[issue45395] Frozen stdlib modules are discarded if custom frozen modules added.

2021-10-20 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 20.10.2021 16:25, Eric Snow wrote: > > Eric Snow added the comment: > > On Wed, Oct 20, 2021 at 6:01 AM Marc-Andre Lemburg > wrote: >> I have PyRun mostly working with Python 3.9. >> ... >> No changes were neces

[issue45562] python -d creates lots of tokenizer messages

2021-10-21 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg : python3.9 -d: Python 3.9.7 (default, Oct 21 2021, 20:51:19) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. Loaded pyinteractive.py. >>> python3.10 -d: Py

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-21 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg : In Python 3.10, it seems that top-level frames generated by running exec() have their f_lineno attribute set to None. inspect.getframeinfo() tries to build context lines and fails on this line in such a case: start = lineno - 1 - context//2

[issue45562] python -d creates lots of tokenizer messages

2021-10-21 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: What's even worse is that those debug lines get written to stdout, not stderr. -- ___ Python tracker <https://bugs.python.org/is

[issue45562] python -d creates lots of tokenizer messages

2021-10-21 Thread Marc-Andre Lemburg
Change by Marc-Andre Lemburg : -- components: +Parser nosy: +lys.nikolaou, pablogsal ___ Python tracker <https://bugs.python.org/issue45562> ___ ___ Python-bug

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-21 Thread Marc-Andre Lemburg
Change by Marc-Andre Lemburg : -- components: +Interpreter Core, Library (Lib), Parser nosy: +lys.nikolaou, pablogsal ___ Python tracker <https://bugs.python.org/issue45

[issue45395] Frozen stdlib modules are discarded if custom frozen modules added.

2021-10-21 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I have an initial version of PyRun for Python 3.10 running as well. This created a few more headaches in order to make it work with setuptools and some glitches which appear to be bugs in 3.10 (https://bugs.python.org/issue45563 and https://bugs.python.org

[issue45562] python -d creates lots of tokenizer messages

2021-10-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Yes, I know that (at the moment) it's only documented to work in the parser, but since Py_DebugFlag is a general purpose flag, this use could easily be extended to other parts of the interpreter as well, e.g. for parsing the command li

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: To add some more context: This came up while porting eGenix PyRun to Python 3.10. While installing setuptools 58.2.0 via "pyrun setup.py install", an exception was raised in getframeinfo(). PyRun uses exec() to run Python code

[issue45562] python -d creates lots of tokenizer messages

2021-10-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I had left a comment on Github about using stderr instead of stdout, to make the output more consistent (other parser error messages go to stderr). Note sure whether that's something you still want to change before closing the issue. --

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: In the case of setuptools, this would be the file setup.py, but I think the specific file is not relevant. I can try to come up with a shorter example. -- ___ Python tracker <https://bugs.python.

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Update: I've been trying hard to find a short version which triggers the issue, but so far it seems to only trigger when using exec() from a frozen Python module. There don't appear to be many ways frame->f_lineno can end up being -1 (whi

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I see this in modules frozen by the Tools/freeze/ tool. The line numbers shown for such frozen modules in the frameinfo stack are a bit off as well, compared normal Python. Could this be an indication that there's something not working quite

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I've looked at how the importlib freeze logic works, compared to Tools/freeze/freeze.py. The only difference I can spot is that importlib uses C to build the C array and does a compile followed by a marshal.dumps, whereas freeze.py loads all mo

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Turns out this was a bug in the freeze.py script I was using. I had added a bug work-around for the modulefinder module and even though it should work as advertised, it seems to be missing some code object attributes when recreating the objects which

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg
Change by Marc-Andre Lemburg : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Hmm, perhaps I should reopen the ticket, even though I now found the cause. After all, it is possible that lineno is None and inspect.getframeinfo() cannot handle it :-) And it may be worthwhile investigating why recreation of a code object using

[issue45548] Update Modules/Setup

2021-10-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: FYI: I've been working with a fixed Setup file in PyRun for a long while. There are indeed a number of modules missing from Setup, since the whole logic was left behind a bit after things moved to setup.py. The issue with _math.o is actually in the

[issue45548] Update Modules/Setup

2021-10-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I'm using a very simple conditional logic in Setup, which is based on sed, mostly to add platform specific variables: In Setup: # @if macosx: TIME_DEFS= # @if not macosx: TIME_DEFS=-lrt time -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/int

[issue45548] Update Modules/Setup

2021-10-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 23.10.2021 20:04, Christian Heimes wrote: > > PR GH-29179 or GH-29181 address the issue with _math.o I think those patches are both taking things a bit too far. This is a build problem, not a code problem. It's perfectly good style to li

[issue45548] Update Modules/Setup

2021-10-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 23.10.2021 21:30, Christian Heimes wrote: > > The trick would move the math function back into the core. Mark moved the > math functions out of the core on purpose, see bpo-7518. I don't follow you. With the _math.o target in Makefile.p

[issue45613] [sqlite3] set threadsafety attribute based on default SQLite threaded mode

2021-10-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: +1 on setting the attributes dynamically. Other DB-API modules use a similar approach. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45395] Frozen stdlib modules are discarded if custom frozen modules added.

2021-10-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 26.10.2021 16:02, Eric Snow wrote: > > FYI, I figured out the problem on my end. I wasn't using an installed > python. Once I did it worked fine. Oh, you mean you tried using it directly from the source tree ? I don't think I eve

[issue45548] Update Modules/Setup

2021-10-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 26.10.2021 16:17, Christian Heimes wrote: > > Christian Heimes added the comment: > > Brett, we can use AM_CONDITIONAL() to conditionally enable/disable a feature > and AC_CONFIG_FILES() to create a Modules/Setup from a templat

[issue45548] Update Modules/Setup

2021-10-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 26.10.2021 19:42, Christian Heimes wrote: > > Brett removed a lot of stuff in 01cf4fb9c1aa567484c2ffb1b11f9b3fe9949b05 to > make the file more readable. I removed unnecessary -D, -I, and -L to make the > file even more readable. You can

[issue45548] Update Modules/Setup

2021-10-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 26.10.2021 20:47, Marc-Andre Lemburg wrote: >> Brett removed a lot of stuff in 01cf4fb9c1aa567484c2ffb1b11f9b3fe9949b05 to >> make the file more readable. I removed unnecessary -D, -I, and -L to make >> the file even more readable. Y

[issue42738] subprocess: don't close all file descriptors by default (close_fds=False)

2021-10-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Gregory P. Smith wrote: > A higher level "best practices for launching child processes module" with > APIs reflecting explicit intents (performance vs security vs simplicity) > rather than requiring users to understand subproces

[issue45562] python -d creates lots of tokenizer messages

2021-10-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Hi Pablo, I think you missed one instance: print_escape(stdout, tok->cur, tok->inp - tok->cur); Cheers -- ___ Python tracker <https://bugs.python.or

[issue45562] python -d creates lots of tokenizer messages

2021-10-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Thanks, Pablo :-) -- ___ Python tracker <https://bugs.python.org/issue45562> ___ ___ Python-bugs-list mailing list Unsub

[issue45653] Freeze the encodings module.

2021-10-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: encodings is a package. I think you first have to check whether mixing frozen and non-frozen submodules are even supported. I've never tried having only part of a package frozen. Freezing the whole package certainly works. -- nosy: +le

[issue45548] Update Modules/Setup

2021-10-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 27.10.2021 22:58, Brett Cannon wrote: > > Brett Cannon added the comment: > >> Could Brett or you please add those notes back ? There's no other place > where such details are documented. > > It really depends on what

[issue45653] Freeze the encodings module.

2021-10-30 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 30.10.2021 17:54, Filipe Laíns wrote: > > I just tested partially freezing the package, and it seems to working fine :) FWIW: I think it's best not bother and simply freeze the whole thing. It's mostly char mappings which compress we

[issue45698] Error on importing getopt

2021-11-03 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Could you please provide more details regarding the OS, whether you compiled Python yourself and the env settings you used ? Thanks, -- Marc-Andre Lemburg eGenix.com -- nosy: +lemburg ___ Python tracker

[issue45476] [C API] Disallow using PyFloat_AS_DOUBLE() as l-value

2021-11-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 15.11.2021 08:54, Oleg Iarygin wrote: > > Oleg Iarygin added the comment: > > Marc-Andre: >> Inlining is something that is completely under the control of the > used compilers. Compilers are free to not inline function

[issue45476] [C API] Disallow using PyFloat_AS_DOUBLE() as l-value

2021-11-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 15.11.2021 10:54, STINNER Victor wrote: > > I don't understand what you are trying to prove about compilers not inlining > when you explicitly ask them... not to inline. I'm not trying to prove anything, Victor. I'm only

[issue45921] codecs module doesn't support iso-8859-6-i, iso-8859-6-e, iso-8859-8-i or iso-8859-8-i

2021-11-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Even though these are IANA recognized encodings, we need to apply he same logic as we do for all new encodings, which essentially boils down to: Are these encoding in wider spread use today ? Reading through the RFC 1556, it seems that the added -i or

[issue45902] Bytes and bytesarrays can be sorted with a much faster count sort.

2021-11-29 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 26.11.2021 10:56, Ruben Vorderman wrote: > > $ python -m timeit -c "from bytes_sort import bytes_sort" "bytes_sort(b'')" > 50 loops, best of 5: 495 nsec per loop Shouldn't this read: $ python -m

[issue45927] timeit accepts -c/--clock and -t/--time without any functionality

2021-11-29 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg : >From the code: opts, args = getopt.getopt(args, "n:u:s:r:tcpvh", ["number=", "setup=", "repeat=", "time", "clock

[issue41921] REDoS in parseentities

2021-12-06 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Interesting that the tool still exists. It uses mxTextTools, but in a non-packaged version, so it's been broken for two decades now :-) I think it's safe to remove it from Tools\scripts. -- ___ Pyth

[issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores.

2020-01-14 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Just to clarify: the change in the C implementation was the breaking change. The patch just restores the previous behavior: https://github.com/python/cpython/blob/master/Lib/encodings/__init__.py#L43 Please note that external codec packages should not

[issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different

2020-03-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: It looks like Brian is expecting some kind of normalization of the strings before they enter the function, e.g. convert to lowercase, remove extra whitespace, convert diacritics to regular letters, combinations of such normalizations, etc. Since both

[issue21081] missing vietnamese codec TCVN 5712:1993 in Python

2020-04-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I have marked the messages as spam. Can't seem to remove them, though. -- ___ Python tracker <https://bugs.python.org/is

[issue21081] missing vietnamese codec TCVN 5712:1993 in Python

2020-04-28 Thread Marc-Andre Lemburg
Change by Marc-Andre Lemburg : -- Removed message: https://bugs.python.org/msg320603 ___ Python tracker <https://bugs.python.org/issue21081> ___ ___ Python-bug

[issue21081] missing vietnamese codec TCVN 5712:1993 in Python

2020-04-28 Thread Marc-Andre Lemburg
Change by Marc-Andre Lemburg : -- Removed message: https://bugs.python.org/msg367515 ___ Python tracker <https://bugs.python.org/issue21081> ___ ___ Python-bug

[issue21081] missing vietnamese codec TCVN 5712:1993 in Python

2020-04-28 Thread Marc-Andre Lemburg
Change by Marc-Andre Lemburg : -- Removed message: https://bugs.python.org/msg367514 ___ Python tracker <https://bugs.python.org/issue21081> ___ ___ Python-bug

[issue21081] missing vietnamese codec TCVN 5712:1993 in Python

2020-04-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Found an "Unlink" bottom at the bottom of the message view. This appears to remove the messages from the issue. -- ___ Python tracker <https://bugs.python.o

[issue40505] getpath.c doesn't know about lib64

2020-05-04 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg : On platforms which configure identifies as bi-arch platform, libdir is set to $[exec_prefix}/lib64, which results in the C extensions to get installed in e.g. /usr/local/lib64/python3.8/lib-dynload/. However, the getpath.c routines use a fixed &quo

[issue40505] getpath.c doesn't know about lib64

2020-05-04 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Just to clarify: the CONFIG_SITE script on OpenSUSE causes configure to use lib64, not the Python configure script itself. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40505] getpath.c doesn't know about lib64

2020-05-04 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: No, I have not opened a bug report on OpenSUSE. Since the OS uses bi-arch throughout, using lib64 is the natural thing to use for libdir on the OS. I think the issue lies with getpath.c only, since it makes an assumption about the libdir config value

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Hi Jason, to achieve better backwards compatibility, it's probably better to use the approach taken for CodeInfo in the codecs.py module: class CodecInfo(tuple): """Codec details when looking up the codec registry""

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ok, let me add some more context: When I wrote the uname interface I was aware that calling the API will take some resources. That's why I added the cache. IMO, that was enough as optimization. Now, you added a late binding optimization for the

[issue40570] len(platform.uname()) has changed in Python 3.9

2020-05-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Hi Jason, I think I have to review the whole set of changes again to understand what your motivation is/was. For https://bugs.python.org/issue35967 I had already stated that your use case is not special enough to make the platform.py logic more

[issue35967] Better platform.processor support

2020-05-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Reopening the ticket, since the implementation makes backwards incompatible changes to platform.uname(): see https://bugs.python.org/issue40570 for a discussion on a better approach to lazy evaluation of getting the processor information. Before we

[issue40578] Deprecate numeric item access for platform.uname()

2020-05-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I am closing this issue, since deprecations should really only be used when no other means are possible. The namedtuples returned by platform.uname() do support index access and so any implementation change altering this is surprising and backwards

[issue35967] Better platform.processor support

2020-05-18 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Thanks, Jason. I'll have a closer look at the issue and report back later this week. -- ___ Python tracker <https://bugs.python.org/is

[issue42257] platform.libc_ver() doesn't consider in case of executable is empty string

2020-12-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Reviewed. Please check on the PR for comments. -- ___ Python tracker <https://bugs.python.org/issue42257> ___ ___ Pytho

[issue42257] platform.libc_ver() doesn't consider in case of executable is empty string

2020-12-31 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Thanks for the patch. Merging is currently prevented by an unrelated test for nntplib failing. See e.g. https://github.com/python/cpython/pull/23140/checks?check_run_id=1630509357. This is being tracked in https://bugs.python.org/issue42794

[issue42794] test_nntplib fails on CI

2020-12-31 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: FWIW, I'm getting the same errors in PR https://github.com/python/cpython/pull/23140 Checking on the server that's being used, the newsgroup description is empty indeed: https://news.aioe.org/index.php?id=statistics-about-groups&group=co

[issue42794] test_nntplib fails on CI

2021-01-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 01.01.2021 13:57, Christian Heimes wrote: > > Does this issue mean that I should include nntplib in PEP 594 again? The test fails because it was relying on an external news server's configuratoin. This doesn't mean the code itself is

[issue42794] test_nntplib fails on CI

2021-01-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Thanks for the patch, Dong-hee Na. Christian: Tests relying on external resources will always have such issues. This doesn't mean that the code which is being tested is outdated or broken. It's just an issue with the tests. Perhaps we ought

[issue42257] platform.libc_ver() doesn't consider in case of executable is empty string

2021-01-02 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: https://github.com/python/cpython/pull/23140 merged. Thanks for the patch, Kurochan. -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue42257] platform.libc_ver() doesn't consider in case of executable is empty string

2021-01-02 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Note: I did not request a backport, since this really is a new feature. -- ___ Python tracker <https://bugs.python.org/issue42

[issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate

2021-01-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I think there's a bit of a misunderstanding here. When relying on a DB-API driver's transaction API, you are not allowed to issue separate transaction commands to the DB backend via the .execute() methods. You have to use conn.commit() and con

[issue39457] Add an autocommit property to sqlite3.Connection with a PEP 249 compliant manual commit mode and migrate

2021-01-06 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 05.01.2021 19:04, Géry wrote: > > @lemburg > >> I guess the SQLite driver does not start a new transaction for SELECTs, >> since these are usually read-only > > Nor for DDL statements (CREATE, DROP). Those are definitel

[issue42967] [security] Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread Marc-Andre Lemburg
Change by Marc-Andre Lemburg : -- title: Web cache poisoning - `;` as a query args separator -> [security] Web cache poisoning - `;` as a query args separator ___ Python tracker <https://bugs.python.org/issu

[issue42967] [security] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-01-20 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Sorry for the title mess: It seems that when replying to a ticket, RoundUp uses the subject line as the new header regardless of what it was set to before. -- ___ Python tracker <https://bugs.python.

[issue42988] Information disclosure via pydoc -p

2021-01-21 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Looking at the _url_handler() code in pydoc.py, this was clearly not written with web server standards in mind. None of the handlers apply security checks on the user input and there are most likely several other vulnerabilities in there to be found

[issue42988] Information disclosure via pydoc -p: /getfile?key=path allows to read arbitrary file on the filesystem

2021-01-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 22.01.2021 01:28, STINNER Victor wrote: > > STINNER Victor added the comment: > >> I'd suggest to print a big warning on the console, explaining that the web >> server will potentially make all content accessible by the

<    4   5   6   7   8   9   10   11   12   13   >