[issue36473] dictkeysobject: Add maximum iteration check for .values() and .items()

2019-03-31 Thread Thomas Perl
Thomas Perl added the comment: Repurposing this as per: https://github.com/python/cpython/pull/12619#issuecomment-478076996 -- title: Detect all dictionary changes during iteration -> dictkeysobject: Add maximum iteration check for .values() and .it

[issue36452] Detect dict iteration "overflow" when changing keys

2019-03-29 Thread Thomas Perl
Change by Thomas Perl : -- pull_requests: +12555 ___ Python tracker <https://bugs.python.org/issue36452> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36473] Detect all dictionary changes during iteration

2019-03-29 Thread Thomas Perl
Change by Thomas Perl : -- keywords: +patch pull_requests: +12554 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36473> ___ ___ Py

[issue36473] Detect all dictionary changes during iteration

2019-03-29 Thread Thomas Perl
New submission from Thomas Perl : On top of issue 36452, I noticed some other corner cases that are still not handled. For one, the patch (Github PR 12596) only handles iterating over keys, but not iterating over values or items: == a = {0: 0} it = iter(a.values()) print('Length hint

[issue36452] Detect dict iteration "overflow" when changing keys

2019-03-27 Thread Thomas Perl
New submission from Thomas Perl : Using: Python 3.8 (git commit ID: d5a5a33f12b60129d57f9b423b77d2fcba506834), the following code snippet: = a = {0: 0} for i in a: del a[i] a[i+1] = 0 print(i) = Prints the following output: = 0 1 2 3 4 = The reason

[issue30560] Py_SetFatalErrorAbortFunc: Allow embedding program to handle fatal errors

2017-06-03 Thread Thomas Perl
Thomas Perl added the comment: Quick fix for the patch: Of course, the line with abort() needs to be removed before this block: +if (_fatal_error_abort_func != NULL) { +_fatal_error_abort_func(msg); +} else { +abort

[issue30560] Py_SetFatalErrorAbortFunc: Allow embedding program to handle fatal errors

2017-06-03 Thread Thomas Perl
New submission from Thomas Perl: In our application that embeds a Python interpreter, we had the issue that certain system configurations (namely, a lone "libpython27.dll" without any standard library) caused silent failures (note that this is using Python 2.7, but Python

[issue27641] Do not build Programs/_freeze_importlib when cross-compiling

2016-07-31 Thread Thomas Perl
Thomas Perl added the comment: +1 on comment-out-regen.patch, makes things much cleaner and removes the shell "if" in the rule body. Just a small bikeshed issue: Instead of COMMENT_REGEN, maybe call it "CROSS_COMPILE_COMMENT" or "GENERATED_COMMENT" or "COMME

[issue27641] Do not build Programs/_freeze_importlib when cross-compiling

2016-07-28 Thread Thomas Perl
New submission from Thomas Perl: Based on http://bugs.python.org/issue27490 and http://bugs.python.org/msg271495, here is a patch that makes sure Programs/_freeze_importlib is only built when not cross-compiling. -- components: Cross-Build files: python-freeze-importlib-cross

[issue27490] Do not run pgen when it is not going to be used (cross-compiling)

2016-07-22 Thread Thomas Perl
Thomas Perl added the comment: Repurposing this bug as "do not run pgen". Documenting and using 'make PGEN_DEP=""' might also work; however, given that the configure script uses autoconf, and there's also code in place for PYTHON_FOR_BUILD, I've attached a patch that makes

[issue27490] ARM cross-compile: pgen built without $(CFLAGS) as $(LIBRARY) dependency

2016-07-13 Thread Thomas Perl
Thomas Perl added the comment: Adding "-mfloat-abi=hard" to LDFLAGS fixes the issue for me, and also allows $(BUILDPYTHON) to be built correctly in addition to $(PGEN). So I guess the resolution to this issue is "works for me" (with setting CC or LDFLAGS properly for cro

[issue27490] ARM cross-compile: pgen built without $(CFLAGS) as $(LIBRARY) dependency

2016-07-13 Thread Thomas Perl
Thomas Perl added the comment: Yes setting "CC" would fix the problem, but i guess the CFLAGS issue was just the original symptom (and my first reaction to fixing it), whereas the underlying problem is that pgen gets built in cases where it shouldn't be built at all. The solution

[issue27490] ARM cross-compile: pgen built without $(CFLAGS) as $(LIBRARY) dependency

2016-07-11 Thread Thomas Perl
Thomas Perl added the comment: Also related: https://bugs.python.org/issue22359 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27490] ARM cross-compile: pgen built without $(CFLAGS) as $(LIBRARY) dependency

2016-07-11 Thread Thomas Perl
New submission from Thomas Perl: Problem description: Trying to cross-compile $(LIBRARY) (libpython2.7.a for example) causes "pgen" to be built, even when it's not used in the cross-compilation case (only a file copy is done to generate $(GRAMMAR_H) and $(GRAMMAR_C)). The cu