[issue39801] list.insert is slow, likely due to manual memmove

2020-02-29 Thread Stefan Pochmann
Stefan Pochmann added the comment: I misspoke. I do the insertions at -1 and -500 not on the same list but each on a fresh list (of length 2**20+1). -- ___ Python tracker <https://bugs.python.org/issue39

[issue39794] Add --without-decimal-contextvar option to use just threads in decimal

2020-03-02 Thread Stefan Krah
Stefan Krah added the comment: For the people who find this issue via a search engine: 1) The defaults in 3.7, 3.8 and 3.9 are unchanged (you get the ContextVar). 2) ./configure --without-decimal-contextvar enables the exact TLS context code from 3.3-3.6. There is no new code

[issue39794] Add --without-decimal-contextvar option to use just threads in decimal

2020-03-02 Thread Stefan Krah
Stefan Krah added the comment: > If someone builds an interpreter with this configure flag, does it break > compatibility with anything that code may have started to expect as of 3.7? Yes, anything that relies on the implicit context being coroutine-safe does not work. The only tes

[issue39794] Add --without-decimal-contextvar option to use just threads in decimal

2020-03-02 Thread Stefan Krah
Stefan Krah added the comment: To make things more clear (it is good that Gregory asked): ONLY use this flag if you don't use coroutines at all OR control ALL async libraries in your application. Random async libraries from PyPI may rely on the ContextVar and silently give incorrect re

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah
Change by Stefan Krah : -- keywords: +patch pull_requests: +18101 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18746 ___ Python tracker <https://bugs.python.org/issu

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah
Stefan Krah added the comment: I think the PR fixes the issue but I have to run longer tests still. Threads created by PyGILState_Ensure() could have a duplicate tstate->id, which confused the ContextVar caching machinery. -- ___ Python trac

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah
Stefan Krah added the comment: New changeset b3b9ade4a3d3fe00d933bcd8fc5c5c755d1024f9 by Stefan Krah in branch 'master': bpo-39776: Lock ++interp->tstate_next_unique_id. (GH-18746) (#18746) https://github.com/python/cpython/commit/b3b9ade4a3d3fe00d933bcd8fc5

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah
Change by Stefan Krah : -- pull_requests: +18107 pull_request: https://github.com/python/cpython/pull/18752 ___ Python tracker <https://bugs.python.org/issue39

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-02 Thread Stefan Krah
Change by Stefan Krah : -- pull_requests: +18108 pull_request: https://github.com/python/cpython/pull/18753 ___ Python tracker <https://bugs.python.org/issue39

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-03 Thread Stefan Krah
Stefan Krah added the comment: New changeset 5a92f42d8723ee865be80f028d402204649da15d by Stefan Krah in branch '3.8': bpo-39776: Lock ++interp->tstate_next_unique_id. (GH-18746) (#18746) (#18752) https://github.com/python/cpython/commit/5a92f42d8723ee865be80f028d4

[issue39776] Crash in decimal module in heavy-multithreaded scenario

2020-03-03 Thread Stefan Krah
Stefan Krah added the comment: New changeset 852aee69f49c654a03ad1f64d90a78ba8848e2c6 by Stefan Krah in branch '3.7': bpo-39776: Lock ++interp->tstate_next_unique_id (GH-18746) https://github.com/python/cpython/commit/852aee69f49c654a03ad1f64d90

[issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id

2020-03-03 Thread Stefan Krah
Change by Stefan Krah : -- title: Crash in decimal module in heavy-multithreaded scenario -> PyContextVar_Get(): crash due to race condition in updating tstate->id ___ Python tracker <https://bugs.python.org/i

[issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id

2020-03-03 Thread Stefan Krah
Change by Stefan Krah : -- assignee: -> skrah ___ Python tracker <https://bugs.python.org/issue39776> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id

2020-03-03 Thread Stefan Krah
Stefan Krah added the comment: Since many duplicate tstate ids are generated in the test case before the crash happens, I guess a set of tstates with the same id silently uses the cached context of the "winner" tstate. This can lead to incorrect results without noticing. -

[issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id

2020-03-03 Thread Stefan Krah
Change by Stefan Krah : Added file: https://bugs.python.org/file48945/pydecimal_cases.zip ___ Python tracker <https://bugs.python.org/issue39776> ___ ___ Python-bug

[issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id

2020-03-03 Thread Stefan Krah
Stefan Krah added the comment: Also _pydecimal was affected. This is a modified version of Evgeny's test case: from _pydecimal import * from time import sleep from random import randint import sys sys.setswitchinterval(0.001) def usleep(x): sleep(x/100.0) class Test:

[issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id

2020-03-03 Thread Stefan Krah
Stefan Krah added the comment: Setting to release blocker, but please move to deferred again if a release is almost finished. -- nosy: +lukasz.langa, ned.deily priority: deferred blocker -> release blocker ___ Python tracker <

[issue39794] Add --without-decimal-contextvar option to use just threads in decimal

2020-03-03 Thread Stefan Krah
Stefan Krah added the comment: #39776 is fixed, but _pydecimal was also affected, see msg363266. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id

2020-03-03 Thread Stefan Krah
Change by Stefan Krah : -- stage: patch review -> resolved ___ Python tracker <https://bugs.python.org/issue39776> ___ ___ Python-bugs-list mailing list Un

[issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id

2020-03-03 Thread Stefan Krah
Change by Stefan Krah : -- resolution: -> fixed ___ Python tracker <https://bugs.python.org/issue39776> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39776] PyContextVar_Get(): crash due to race condition in updating tstate->id

2020-03-03 Thread Stefan Krah
Stefan Krah added the comment: Thanks Ned, closing then. Evgeny, please reopen if you see it again (I ran the tests for about 20 min, way above the usual reproduction time of 1 min). Thanks for the very instructive test case! -- status: open -> clo

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-11 Thread Stefan Krah
Stefan Krah added the comment: Concerning memoryview, I've looked at this very briefly: memoryview does not pack values directly, it casts first, which is legal: #define PACK_SINGLE(ptr, src, type) \ do { \ t

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-11 Thread Stefan Krah
Stefan Krah added the comment: So which memoryview test (unless it is using the struct module) relies on UB? -- ___ Python tracker <https://bugs.python.org/issue39

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-11 Thread Stefan Krah
Stefan Krah added the comment: Okay, in memoryview the cast tests can trigger UB checks. memoryview assumes that bool is packed correctly, so just casting does not work. Casting anything to bool is of course a bit silly anyway. diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-11 Thread Stefan Krah
Stefan Krah added the comment: I checked that NumPy also packs correctly: >>> import numpy as np >>> x = np.array([0,1,2,3], dtype=np.bool) >>> x.tobytes() b'\x00\x01\x01\x01' So I vote for not handling incorrectly packed values and removing &quo

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah
Stefan Krah added the comment: The docs for native mode (we now always assume C99): "The '?' conversion code corresponds to the _Bool type defined by C99." The memoryview tests that fail are essentially auto-generated and not prescriptive. They just happened to work wi

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah
Stefan Krah added the comment: The memcpy() is NOT a hack and performs exactly the same operation as casting the pointer and then dereferencing, only in a manner that avoids unaligned accesses. On platforms like x86 the memcpy() is optimized to a simple assignment. Casting the pointer and

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah
Change by Stefan Krah : -- pull_requests: +18312 pull_request: https://github.com/python/cpython/pull/18964 ___ Python tracker <https://bugs.python.org/issue39

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah
Stefan Krah added the comment: New changeset 1ae9cde4b2323235b5f9ff4bc76e4175a2257172 by Stefan Krah in branch 'master': bpo-39689: Do not test undefined casts to _Bool (GH-18964) https://github.com/python/cpython/commit/1ae9cde4b2323235b5f9ff4bc76e41

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah
Stefan Krah added the comment: New changeset 636eecc16229432ec8e26e6da287c52f3ca3 by Miss Islington (bot) in branch '3.7': bpo-39689: Do not test undefined casts to _Bool (GH-18964) (#18965) https://github.com/python/cpython/commit/636eecc16229432ec8e26e6da2

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah
Stefan Krah added the comment: New changeset f8ce3e2dae277baa2ef92e8a3e935953dc6c3f39 by Miss Islington (bot) in branch '3.8': bpo-39689: Do not test undefined casts to _Bool (GH-18964) (#18966) https://github.com/python/cpython/commit/f8ce3e2dae277baa2ef92e8a3e9359

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah
Stefan Krah added the comment: memoryview only supports the native format, so I've disabled the (wrong) test that casts arrays with arbitrary values to _Bool. So memoryview is done. IMO the problem in _struct is that it swaps the x->unpack function for the native one, which does

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-12 Thread Stefan Krah
Change by Stefan Krah : -- pull_requests: +18317 pull_request: https://github.com/python/cpython/pull/18969 ___ Python tracker <https://bugs.python.org/issue39

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah
Stefan Krah added the comment: > This looks like a "new feature/improvement". Why was this code backported to > a stable version? Thanks for the lecture. This is an esoteric case between bugfix and feature that only occurs with very large context precisions. If Bloomberg

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah
Stefan Krah added the comment: > This code has introduced a regression in AIX in Python 3.7.7 Also this is a rather bold statement since probably no one has ever run _decimal on AIX with MAX_PREC. -- ___ Python tracker <https://bugs.pyth

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah
Stefan Krah added the comment: > Well, I just did and I can confirm that reverting the 3.7 backport fixes the > problem. If you are fortunate enough to have access to an AIX system, I guess you have to find out why POWER6 AIX 3.8 and PPC64 AIX 3.8 apparently work on

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah
Stefan Krah added the comment: Hi Michael, in case you have built 3.7.7 on AIX, have you observed any problems with test_decimal? -- nosy: +Michael.Felt ___ Python tracker <https://bugs.python.org/issue39

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah
Stefan Krah added the comment: These flags worked for xlc when snakebite was still up: ./configure CC=xlc_r AR="ar -X64" CFLAGS="-q64 -qmaxmem=7" LDFLAGS="-q64" -qmaxmem was always finicky, I remember segfaults too (AIX

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah
Stefan Krah added the comment: BTW, if you are compiling with xlc and there"s no xlc buildbot, perhaps a company-that-shall-not-be-named should provide one. I mean, it's not okay to complain about a regression and then mention xlc about 10 m

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah
Change by Stefan Krah : -- assignee: -> skrah ___ Python tracker <https://bugs.python.org/issue39576> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-16 Thread Stefan Krah
Change by Stefan Krah : -- assignee: -> skrah keywords: -3.7regression, patch ___ Python tracker <https://bugs.python.org/issue39576> ___ ___ Python-bugs-lis

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Stefan Krah
Stefan Krah added the comment: A focused issue report would include at least the following: 1) Acknowledge that gcc builds work on the AIX buildbots (a fact that has been entirely ignored so far). 2) State the exact regression: msg364373 (which was also ignored, are you using

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Stefan Krah
Stefan Krah added the comment: It is also instructive how Granlund views xlc: https://gmplib.org/list-archives/gmp-bugs/2010-November/002119.html -- ___ Python tracker <https://bugs.python.org/issue39

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Stefan Krah
Stefan Krah added the comment: "The **exact** regression is that I could run the test suite without any crash or freeze on this AIX system with 3.7.6 and I cannot in 3.7.7. At the very least this is due to the fact that there is a new test that crashes/hangs." In other words, c

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-17 Thread Stefan Krah
Stefan Krah added the comment: Sorry, I'm reacting like Granlund now and close. These discussions lead nowhere. -- status: open -> closed ___ Python tracker <https://bugs.python.org

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-17 Thread Stefan Krah
Stefan Krah added the comment: > So it's clear that something has to change. IMO, preserving (2) and relaxing > (1) is the more useful choice. But not in this issue I think. GH-18969 is a minimal change that *removes* UB for the standard sizes. UB for the native type

[issue39689] struct and memoryview tests rely on undefined behavior (as revealed by clang 9)

2020-03-18 Thread Stefan Krah
Stefan Krah added the comment: I think this issue should be about fixing the tests so that people looking at the sanitizer buildbots can move on. GH-18969 fixes "?" and "!?", which clearly used wrong semantics with the new compiler behavior. This should be an uncontrov

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-18 Thread Stefan Krah
Stefan Krah added the comment: Since xlc has elementary bugs like https://github.com/openssl/openssl/issues/10624 it may be worth checking out if this is an optimizer bug with -q64. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-19 Thread Stefan Krah
Stefan Krah added the comment: The lower MAX_PREC for 32-bit could be the reason. On the other hand, historically, suncc and xlc have had a lot of problems with the 64-bit build. The winner is suncc, which seriously miscompiled libmpdec without a whole litany of flags: https

[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-21 Thread Stefan Behnel
Stefan Behnel added the comment: > I think Cython makes use of PEP-489 so unless I am missing something all > generated extensions use PEP-489 structures. Cython doesn't make complete use of PEP-489 yet, specifically not of the module state feature (nor module subclasses). This c

[issue40077] Convert static types to PyType_FromSpec()

2020-03-27 Thread Stefan Krah
Stefan Krah added the comment: > Wouldn't having less static types slow down startup time? Yes, and not only startup time: https://bugs.python.org/issue15722 -- nosy: +skrah ___ Python tracker <https://bugs.python.org

[issue40077] Convert static types to PyType_FromSpec()

2020-03-27 Thread Stefan Krah
Stefan Krah added the comment: > Or maybe _decimal_state_global was used in "hot code". Yes, _decimal has problems here that most modules don't have. Modules like atexit are obviously fine. :) I just posted it as an example why one should be a bit cautious. > The PEP

[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-04-03 Thread Stefan Krah
Stefan Krah added the comment: Has anything emerged xlc-wise? Traceback, does it work --without-pymalloc? I have the feeling that (in many OSS projects) the more complex xlc issues never get resolved after the initial report. So I'm contemplating to do the same as

[issue40206] Multiplying 4.6*100 will result in 459.99999999999994

2020-04-07 Thread Stefan Krah
Stefan Krah added the comment: You can also set the decimal.FloatOperation trap to avoid accidental errors: >>> from decimal import * >>> c = getcontext() >>> Decimal(4.6) * 100 Decimal('459.9644728632120') >>> c.traps[FloatOperation]

[issue40223] Add -fwrapv for new icc versions

2020-04-08 Thread Stefan Krah
New submission from Stefan Krah : Newer icc version require -fwrapv: https://software.intel.com/en-us/forums/intel-c-compiler/topic/849064 -- components: Build messages: 365976 nosy: skrah priority: normal severity: normal stage: needs patch status: open title: Add -fwrapv for new icc

[issue40226] Leak in tstate->interp->ceval.pending

2020-04-08 Thread Stefan Krah
New submission from Stefan Krah : 50e6e991781db761c496561a995541ca8d83ff87 causes or exposes a leak. Possibly the leak was there before but showed up under "still reachable". Now it is "definitely lost", so tstate->interp->ceval.pending needs to be cleaned up. ==11

[issue40244] AIX: build: _PyObject_GC_TRACK Asstertion failure

2020-04-10 Thread Stefan Krah
Stefan Krah added the comment: Since I just had a similar incident with the Intel compiler, I just want to point out that compiling CPython still requires -fwrapv. I've mentioned this before in AIX issues, and no one has pointed out the corresponding xlc flag. https://gcc.gnu.org/lega

[issue40249] __import__ doesn't honour globals

2020-04-10 Thread Stefan Seefeld
New submission from Stefan Seefeld : I'm trying to import custom scripts that expect the presence of certain variables in the global namespace. It seems `__import__('script', globals=dict(foo='bar'))` doesn't have the expected effect of injecting "fo

[issue40249] __import__ doesn't honour globals

2020-04-10 Thread Stefan Seefeld
Stefan Seefeld added the comment: OK, thanks for the clarification. I think this is obscure enough to warrant at least a paragraph or two to clarify the semantics of these arguments. I changed the issue "components" and "type" to reflect that. -- assignee: ->

[issue40244] AIX: build: _PyObject_GC_TRACK Asstertion failure

2020-04-11 Thread Stefan Krah
Change by Stefan Krah : -- nosy: -skrah ___ Python tracker <https://bugs.python.org/issue40244> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39011] ElementTree attributes replace "\r" with "\n"

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 5fd8123dfdf6df0a9c29363c8327ccfa0c1d41ac by mefistotelis in branch 'master': bpo-39011: Preserve line endings within ElementTree attributes (GH-18468) https://github.com/python/cpython/commit/5fd8123dfdf6df0a9c29363c8327cc

[issue39011] ElementTree attributes replace "\r" with "\n"

2020-04-12 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: Also see the later fix in issue 39011, where the EOL normalisation in attribute text was removed again. This change was applied in Py3.9. -- ___ Python tracker <https://bugs.python.org/issue17

[issue32476] Add concat functionality to ElementTree xpath find

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: I think the use case of quote escaping is too niche for a feature like concat(), where I (at least) would expect to be able to dynamically concatenate text content, not just constant strings. There seem to be at least a few alternatives to the usage of

[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: This has been pending for a while too long, but the fixes look good to me. They should still go at least into Py3.8 and later. -- versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.6, Python 3.7 ___ Python

[issue13743] xml.dom.minidom.Document class is not documented

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 63e5b59c06fc99f95d274e7f181296e094cc3ee7 by Alex Itkes in branch 'master': bpo-13743: Add some documentation strings to xml.dom.minidom (GH-16355) https://github.com/python/cpython/commit/63e5b59c06fc99f95d274e7f181296

[issue13743] xml.dom.minidom.Document class is not documented

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: A first PR was applied, but I'll leave this ticket open since it changes nothing for the "Document" class. :) -- versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.5, Python 3.6, Python

[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 402e1cdb132f384e4dcde7a3d7ec7ea1fc7ab527 by Oren Milman in branch 'master': bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) https://github.com/python/cpyt

[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 61511488cf4e7a1cb57a38efba7e0a84a387fe58 by Miss Islington (bot) in branch '3.8': bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) (GH-19485) https://github.com/python/cpyt

[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: Let's add it to the last bug fix release of 3.7 as well. It fixes a crash bug, after all. -- stage: patch review -> backport needed versions: +Python 3.7 ___ Python tracker <https://bugs.python.org

[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 096e41aa4e558b28b7260fe01eb21414b1458b20 by Miss Islington (bot) in branch '3.7': [3.7] bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) (GH-19487) https://github.com/python/cpyt

[issue31758] various refleaks in _elementtree, and crashes when using an uninitialized XMLParser object

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for the fix, Oren! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40279] Documentation example of module init function lacks error handling

2020-04-13 Thread Stefan Behnel
New submission from Stefan Behnel : The example in the docs that shows how to initialise an embedded module gives a wrong impression about error handling. Most of the functions that it calls return error codes, but those do not get looked at. Innocent users who copy and paste the example may

[issue40249] __import__ doesn't honour globals

2020-04-14 Thread Stefan Seefeld
Stefan Seefeld added the comment: I'm not entirely sure, but have to admit that the sentence "The function imports the module name, potentially using the given globals and locals to determine how to interpret the name in a package context." is a bit obscure. What does &q

[issue40279] Documentation example of module init function lacks error handling

2020-04-24 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset d4f3923d5901ef1ccdbe6ad6c5a753af90832a0f by Cajetan Rodrigues in branch 'master': bpo-40279: Add some error-handling to the module initialisation docs example (GH-19705) https://github.com/python/cpyt

[issue40279] Documentation example of module init function lacks error handling

2020-04-24 Thread Stefan Behnel
Stefan Behnel added the comment: Hi Cajetan, thank you for your contribution! That's a nice documentation improvement. -- nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed ___

[issue40279] Documentation example of module init function lacks error handling

2020-04-24 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 882a7f44da08c6fb210bd9a17f80903cbca84034 by Miss Islington (bot) in branch '3.8': bpo-40279: Add some error-handling to the module initialisation docs example (GH-19705) (GH-19710) https://github.com/python/cpyt

[issue38787] PEP 573: Module State Access from C Extension Methods

2020-04-28 Thread Stefan Behnel
Stefan Behnel added the comment: What can we do to move this forward? I see that the original PR was closed in January. Is there or will there be a new one? Can I help with anything? -- ___ Python tracker <https://bugs.python.org/issue38

[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-04 Thread Stefan Behnel
Stefan Behnel added the comment: Christian, I understand your complaint, but I've actually never seen code in the wild that didn't provide a fallback for the import, usually something like what Serhiy spelled out and explained above: try: import xml.etree.cElement

[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-05 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks Miro, that's beautiful. Good to know that I'm not the only one who doesn't read documentation. ;-) So, how do we deal with this? We can't warn about the deprecation without annoying everyone. We can't just remove the empty mod

[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-05 Thread Stefan Behnel
Stefan Behnel added the comment: It's not like the deprecation was hidden – the ET docs have this line right at the top: "Changed in version 3.3: This module will use a fast implementation whenever available. The xml.etree.cElementTree module is deprecated." https://do

[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-05 Thread Stefan Behnel
Stefan Behnel added the comment: >> But as I said, people don't read docs. > After seven, eight years we should do our users a service and point out the > deprecation with a concrete deadline. ¯\_(ツ)_/¯ Honestly, let's just keep it. Maybe we can add an invisible Pen

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-05-07 Thread Stefan Behnel
Stefan Behnel added the comment: Adding to the list above: "f_lasti" is used in "libpython.py", which is an almost exact copy of the one in CPython's "Tools/gdb/" for debugging Python code in gdb. If that implementation changes, we can probably adap

[issue40575] _PyDict_GetItemIdWithError() should call _PyDict_GetItem_KnownHash()

2020-05-09 Thread Stefan Behnel
New submission from Stefan Behnel : _PyDict_GetItemIdWithError() looks up interned strings, which always have their hash value initialised. It can call _PyDict_GetItem_KnownHash() directly. -- messages: 368506 nosy: scoder priority: low severity: normal stage: needs patch status: open

[issue40575] _PyDict_GetItemIdWithError() should call _PyDict_GetItem_KnownHash()

2020-05-09 Thread Stefan Behnel
Change by Stefan Behnel : -- components: +Interpreter Core keywords: +easy (C) ___ Python tracker <https://bugs.python.org/issue40575> ___ ___ Python-bugs-list m

[issue40575] _PyDict_GetItemIdWithError() should call _PyDict_GetItem_KnownHash()

2020-05-09 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +19329 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/20018 ___ Python tracker <https://bugs.python.org/issu

[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-10 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +19334 pull_request: https://github.com/python/cpython/pull/20024 ___ Python tracker <https://bugs.python.org/issue38

[issue40575] _PyDict_GetItemIdWithError() should call _PyDict_GetItem_KnownHash()

2020-05-10 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 6067d4bc3ce5ff4cfa5b47ceecc84a3941bc031c by scoder in branch 'master': bpo-40575: Avoid unnecessary overhead in _PyDict_GetItemIdWithError() (GH-20018) https://github.com/python/cpython/commit/6067d4bc3ce5ff4cfa5b47ceecc84a

[issue40575] _PyDict_GetItemIdWithError() should call _PyDict_GetItem_KnownHash()

2020-05-10 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue22079] Ensure in PyType_Ready() that base class of static type is static

2020-05-12 Thread Stefan Behnel
Stefan Behnel added the comment: Since it's not clear from this ticket what the original problem was, is there a chance it could have been related to issue 35810? -- nosy: +scoder ___ Python tracker <https://bugs.python.org/is

[issue22622] ElementTree only writes declaration when passed encoding

2020-05-17 Thread Stefan Behnel
Stefan Behnel added the comment: Right, thanks. Closing since this works in Py3. -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42653] Expose ISO-TP Contants for Linux >= 5.10

2020-12-16 Thread Stefan Tatschner
New submission from Stefan Tatschner : Linux >= 5.10 gained a new SocketCAN module called ISOTP. This is an implementation of ISO 15765-2 which is mainly used in vehicle CAN networks. Expose the constants from linux/can/isotp.h in the socket module. These constants are not entirely

[issue43037] Importlib reload by module name (String)

2021-01-27 Thread Stefan Mosoi
New submission from Stefan Mosoi : Weird behaviour (maybe it's my opinion) in reload from importlib if i do: import importlib import sys import datetime importlib.reload(datetime.timedelta.__module__) I get Typeerror: reload() argument must be a module but if i do import importlib i

[issue43037] Importlib reload by module name (String)

2021-01-27 Thread Stefan Mosoi
Stefan Mosoi added the comment: The motivation behind my request is as follow: I have a dynamic set class (i don't "know" it) and calling __module__ for that class return a string, reload requires Module(and i don't think __module__ will be changed to module). The oth

[issue43037] Importlib reload by module name (String)

2021-01-27 Thread Stefan Mosoi
Stefan Mosoi added the comment: Also > without having a reference to module itself reload() just gets the name of the module try: name = module.__spec__.name except AttributeError: name = module.__name__ and then if sys.modules.get(name) is not module So it mi

[issue43037] Importlib reload by module name (String)

2021-01-27 Thread Stefan Mosoi
Stefan Mosoi added the comment: I understand. I was using to reload some classes that might have changed/added (updates and stuff) without having to reload the hole project. There might be some other ways (i found this, and didn't keep researching after). The documentation didn

[issue43399] xml.etree.ElementTree.extend does not work with iterators when using the Python implementation

2021-03-04 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for the report and the PR. I would argue that this can still be fixed in Py3.8, given the low impact (but not earlier). The behaviour is clearly wrong (in a subtle way) and most users won't notice it because they won't switch off the C a

[issue40703] PyType_FromSpec*() overwrites the type's "__module__"

2020-05-20 Thread Stefan Behnel
New submission from Stefan Behnel : The PyType_FromSpec() functions set the type's "__module__" attribute at the end: https://github.com/python/cpython/blob/0509c4547fc95cc32a91ac446a26192c3bfdf157/Objects/typeobject.c#L3154-L3172 There are only two possible cases, either it

[issue40703] PyType_FromSpec*() overwrites the type's "__module__"

2020-05-20 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +19553 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20273 ___ Python tracker <https://bugs.python.org/issu

[issue40724] Support buffer protocol with type specs

2020-05-22 Thread Stefan Behnel
New submission from Stefan Behnel : As far as I can see it in typeslots.h [1], the buffer protocol is still not supported when using type specs: /* Disabled, see #10181 */ #undef Py_bf_getbuffer #undef Py_bf_releasebuffer It seems that the discussion in issue 10181 did not lead anywhere at

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