[issue6715] xz compressor support

2011-10-12 Thread Nadeem Vawda
Nadeem Vawda added the comment: Patch update time! Noteworthy changes: * Windows build support, thanks to Amaury * Thread safety for LZMACompressor and LZMADecompressor, by means of per-instance locks * O(n) buffer growth strategy I've tried running the tests on Windows, but I've been getting

[issue6715] xz compressor support

2011-10-12 Thread Nadeem Vawda
Changes by Nadeem Vawda : Removed file: http://bugs.python.org/file23168/591277fe6b4a.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue6715] xz compressor support

2011-10-12 Thread Nadeem Vawda
Changes by Nadeem Vawda : Added file: http://bugs.python.org/file23393/bdf0afbbbd80.diff ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue12807] Optimization/refactoring for {bytearray, bytes, unicode}.strip()

2011-10-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Please double check the removal of _PyUnicode_XStrip. I think it's ok. It is private, undocumented, and the only references returned by Google Code Search are in Python itself. I'll review the patch later, thank you. -- title: Move strip() to string

[issue13150] Most of Python's startup time is sysconfig

2011-10-12 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue13154] pep-0000.txt doesn't build anymore

2011-10-12 Thread Senthil Kumaran
Senthil Kumaran added the comment: Fixed in 25ff1adf5f30 -- nosy: +orsenthil resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue13154] pep-0000.txt doesn't build anymore

2011-10-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue13159] _io.FileIO uses a quadratic-time buffer growth algorithm

2011-10-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch looks good to me, thanks. -- versions: +Python 2.7, Python 3.2 ___ Python tracker ___ ___

[issue13163] `port` and `host` are confused in `_get_socket

2011-10-12 Thread Ram Rachum
New submission from Ram Rachum : Look here: http://hg.python.org/cpython/file/3313ce92cef7/Lib/smtplib.py#l279 `port` and `host` are confused. I saw this is fixed on 3.2; possibly it should be fixed in the next 2.7 micro release too. -- components: Library (Lib) messages: 145442 nosy

[issue13162] Trying to install a binary extension as a resource file causes pysetup to give a traceback

2011-10-12 Thread Paul Moore
New submission from Paul Moore : I am trying to create a pysetup package that contains a precompiled binary extension, which can be installed without compiling, by using the resource file feature of setup.cfg. This may be incorrect usage of pysetup, but at a minimum, a proper error message sho

[issue13157] Build Python outside the source directory

2011-10-12 Thread Roumen Petrov
Roumen Petrov added the comment: I wonder why you are not stopped by: configure: error: source directory already configured; run "make distclean" there first. (for sure you remove some files but not all) Applied patch is save but I cannot understand what actually is resolved. Note that someone

[issue13151] pysetup3 run bdist_wininst fails

2011-10-12 Thread Vinay Sajip
Vinay Sajip added the comment: > On line 118, replacing 'install' with 'install_dist' should fix it. Sadly, it just defers the problem: vinay@eta-natty:~/projects/dory$ pysetup3 run bdist_wininst running bdist_wininst running build running build_py running build_scripts installing to build/bdi

[issue13155] Optimize finding the max character width

2011-10-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > find_max_char5.patch: > - don't use adjusted ~mask+1: "precompute" the right max_char > - rename findwidth.h to find_max_char.h > - add some #undef Thank you, I've committed this version. -- resolution: -> fixed stage: -> committed/rejected status:

[issue13155] Optimize finding the max character width

2011-10-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9c7d3207fc15 by Antoine Pitrou in branch 'default': Issue #13155: Optimize finding the optimal character width of an unicode string http://hg.python.org/cpython/rev/9c7d3207fc15 -- nosy: +python-dev ___

[issue13157] Build Python outside the source directory

2011-10-12 Thread STINNER Victor
STINNER Victor added the comment: > Which is platform with broken VPATH support and/or make ? Well, my commit is maybe useless... I tried to have two builds at the same time: - debug in Python source code (e.g. ~/python) - release in a subdirectory in the Python source code (e.g. ~/python/rel

[issue13146] Writing a pyc file is not atomic

2011-10-12 Thread STINNER Victor
STINNER Victor added the comment: > with atomic_create(, 'b') as f: See issues #8604 and #8828. -- ___ Python tracker ___ ___ Python

[issue13157] Build Python outside the source directory

2011-10-12 Thread Roumen Petrov
Roumen Petrov added the comment: Which is platform with broken VPATH support and/or make ? -- nosy: +rpetrov ___ Python tracker ___ _

[issue13154] pep-0000.txt doesn't build anymore

2011-10-12 Thread Mike Hoy
Mike Hoy added the comment: :~/peps$ find . -name "*.txt" | xargs grep "canterbury" ./pep-3152.txt:Author: Gregory Ewing ./pep-0380.txt:Author: Gregory Ewing ./pep-0284.txt:Greg Ewing ./pep-0335.txt:Author: Gregory Ewing Looks like pep-0335.txt has a "Gregory Ewing" with a different ema

[issue13155] Optimize finding the max character width

2011-10-12 Thread STINNER Victor
STINNER Victor added the comment: find_max_char5.patch: - don't use adjusted ~mask+1: "precompute" the right max_char - rename findwidth.h to find_max_char.h - add some #undef -- Added file: http://bugs.python.org/file23392/find_max_char5.patch __

[issue12393] Packaging should provide support for extensible categories

2011-10-12 Thread Vinay Sajip
Vinay Sajip added the comment: > Great.  Do you want to update the docs (packaging/setupscript and maybe > packaging/commandref too) or shall I do it? Feel free to do it, if that's OK with you. I've got a couple of other pythonv issues which are taking my time at the moment, plus I am also l

[issue13146] Writing a pyc file is not atomic

2011-10-12 Thread Charles-François Natali
Charles-François Natali added the comment: > Or perhaps append the PID to the name of the temp file ? > (easier done in Python than in C :-)) I don't really like appending PIDs to generate file names: - if you have multiple processes at the same time, they'll all write their own file which will

[issue13154] pep-0000.txt doesn't build anymore

2011-10-12 Thread Mike Hoy
Changes by Mike Hoy : -- nosy: +mikehoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3313ce92cef7 by Charles-François Natali in branch '2.7': Issue #13156: Add an entry in Misc/NEWS. http://hg.python.org/cpython/rev/3313ce92cef7 -- ___ Python tracker

[issue13155] Optimize finding the max character width

2011-10-12 Thread STINNER Victor
STINNER Victor added the comment: With find_max_char4.patch: python3.3 -m timeit 'x="é"+"x"*1' 'x[1:]' 10 loops, best of 3: 1.96 usec per loop -- ___ Python tracker ___

[issue13155] Optimize finding the max character width

2011-10-12 Thread STINNER Victor
STINNER Victor added the comment: Without the patch: python3.2 -m timeit 'x="é"+"x"*1' 'x[1:]' 10 loops, best of 3: 2.18 usec per loop python3.3 -m timeit 'x="é"+"x"*1' 'x[1:]' 10 loops, best

[issue12602] Missing cross-references in Doc/using

2011-10-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Since *script* is a file -- that is all variable -- that seems appropriate. Bold italic tends to be more notably different from bold italic than the normal pair. In any case, italic is the doc standard for function parameter names. It seems more sensible tha

[issue13157] Build Python outside the source directory

2011-10-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1811c4e5527f by Victor Stinner in branch 'default': Issue #13157: Fix building Python outside its source tree http://hg.python.org/cpython/rev/1811c4e5527f -- nosy: +python-dev ___ Python tracker

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-12 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a patch for 3.2 and default which calls PyThread_set_key_value() only if there was an auto thread state previously associated (while the current code works with pthread TLS, there are other implementations which may behave strangely, and there's

[issue13150] Most of Python's startup time is sysconfig

2011-10-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Since #9878 proposes an *alternate* solution to *part* of the sysconfig problem, I disagree with 'supersede'. A Python solution would be more useful for other implementations if enough of the sysconfig info is not CPython specific. A CPython design feature i

[issue13063] test_concurrent_futures failures on Windows: IOError('[Errno 232] The pipe is being closed') on _send_bytes()

2011-10-12 Thread STINNER Victor
STINNER Victor added the comment: The issue has been fixed by the merge of the PEP 3151: I now get a BrokenPipeError with errno=32 and winerror=232. -- status: open -> closed ___ Python tracker __

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset ee4fe16d9b48 by Charles-François Natali in branch '2.7': Issue #13156: revert changeset f6feed6ec3f9, which was only relevant for native http://hg.python.org/cpython/rev/ee4fe16d9b48 -- nosy: +python-dev ___

[issue12367] select.error has no errno attribute

2011-10-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8bbfb24d4824 by Victor Stinner in branch 'default': Issue #12367: Add a test on error attribute of select.error http://hg.python.org/cpython/rev/8bbfb24d4824 -- nosy: +python-dev ___ Python tracker

[issue12344] Add **kwargs to get_reinitialized_command

2011-10-12 Thread Thomas Holmes
Thomas Holmes added the comment: Still working with Éric to determine the proper behavior of get_reinitialized_commands. Latest patch is known incorrect but a step closer to our destination. -- ___ Python tracker

[issue12344] Add **kwargs to get_reinitialized_command

2011-10-12 Thread Thomas Holmes
Changes by Thomas Holmes : Added file: http://bugs.python.org/file23390/1bb1132840e6.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue13159] _io.FileIO uses a quadratic-time buffer growth algorithm

2011-10-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13159] _io.FileIO uses a quadratic-time buffer growth algorithm

2011-10-12 Thread Nadeem Vawda
Changes by Nadeem Vawda : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13159] _io.FileIO uses a quadratic-time buffer growth algorithm

2011-10-12 Thread Nadeem Vawda
Nadeem Vawda added the comment: I've attached a patch that makes the suggested change to FileIO, and also to _bz2.BZ2Compressor/Decompressor (which currently have the same issue). -- keywords: +patch Added file: http://bugs.python.org/file23389/buffer-growth.diff __

[issue12393] Packaging should provide support for extensible categories

2011-10-12 Thread Éric Araujo
Éric Araujo added the comment: Great. Do you want to update the docs (packaging/setupscript and maybe packaging/commandref too) or shall I do it? -- ___ Python tracker ___ ___

[issue3902] Packages containing only extension modules have to contain __init__.py

2011-10-12 Thread Éric Araujo
Éric Araujo added the comment: Looks good, will commit. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue12344] Add **kwargs to get_reinitialized_command

2011-10-12 Thread Thomas Holmes
Changes by Thomas Holmes : Added file: http://bugs.python.org/file23388/7db732ac6796.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue13146] Writing a pyc file is not atomic

2011-10-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > This new patch also fixes importlib. > > """ > path_tmp = path + '.tmp' > with _io.FileIO(path_tmp, 'wb') as file: > file.write(data) > _os.rename(path_tmp, path) > """ > > I don't know ex

[issue12602] Missing cross-references in Doc/using

2011-10-12 Thread Ezio Melotti
Ezio Melotti added the comment: The italics parts are easier to recognize when they are within regular text (e.g. :file:`path/with/python{XY}/file`). If the whole text is in italic people might not notice the difference. -- ___ Python tracker

[issue13146] Writing a pyc file is not atomic

2011-10-12 Thread Charles-François Natali
Charles-François Natali added the comment: > Here is a patch for import.c. Looks good to me. > This new patch also fixes importlib. """ path_tmp = path + '.tmp' with _io.FileIO(path_tmp, 'wb') as file: file.write(data) _os.re

[issue11751] Increase distutils.filelist / packaging.manifest test coverage

2011-10-12 Thread Éric Araujo
Éric Araujo added the comment: I made a few edits and committed to distutils and packaging. Then I ported the packaging patch to distutils2, which supports Python 2.4-2.7, and got this failure: FAIL: test_glob_to_re (__main__.ManifestTestCase)

[issue13161] problems with help() documentation of __i*__ operators

2011-10-12 Thread Eli Bendersky
New submission from Eli Bendersky : Report from Joao Carneiro in the docs@ maillist: I would like to report that I found a mistake in the document of "help(set)". In the document all the __i*__ methods are described exactly like the same methods without i before t

[issue12602] Missing cross-references in Doc/using

2011-10-12 Thread Éric Araujo
Éric Araujo added the comment: > I suggest that it do so in this instance also, using *script* (in > bold-faced italic) as the entry title. What do you think about :file:`{script}`? file+{} is what Sphinx uses for filenames with replaceable parts, which map to the HTML var element, which the

[issue6715] xz compressor support

2011-10-12 Thread Nadeem Vawda
Nadeem Vawda added the comment: > To elaborate on the policy: giving bogus data in cases of race > conditions is ok; crashing the interpreter or corrupting memory > is not. If bogus data is given, it would be useful if the bogosity > can be specified (e.g. when multiple threads read from the sam

[issue13151] pysetup3 run bdist_wininst fails

2011-10-12 Thread Éric Araujo
Changes by Éric Araujo : -- dependencies: +Rename install_dist to install ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue13160] Rename install_dist to install

2011-10-12 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +tarek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue13160] Rename install_dist to install

2011-10-12 Thread Éric Araujo
New submission from Éric Araujo : When we first added actions to pysetup, the install command was renamed to install_dist to avoid a name conflict between the install command and the install action. Later, the run action was introduced and now serves to namespace all commands. Thus, we have

[issue6715] xz compressor support

2011-10-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: >> Correct. I copied the algorithm from _io.FileIO, under the assumption >> that there was a reason for not using a simpler O(n log n) doubling >> strategy. Do you know of any reason for this? Or is it safe to ignore it? > > I don't know, but I'd say it's safe

[issue13151] pysetup3 run bdist_wininst fails

2011-10-12 Thread Éric Araujo
Éric Araujo added the comment: On line 118, replacing 'install' with 'install_dist' should fix it. -- ___ Python tracker ___ ___ Pyth

[issue6715] xz compressor support

2011-10-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: >>> Modules/_lzmamodule.c:364: Py_BEGIN_ALLOW_THREADS >> It seems that the Windows version at least is not thread-safe. If so, you >> would need an LZMA lock when releasing the GIL. > > Does the class need to be thread-safe, though? As a matter of principle, P

[issue13149] optimization for append-only StringIO

2011-10-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, these are things I've been wondering about. The use-case for an append-only StringIO is obviously overlapping with the use-case for using ''.join(). However, the implementation I'm proposing is better than ''.join() when writing very small strings, since

[issue13159] _io.FileIO uses a quadratic-time buffer growth algorithm

2011-10-12 Thread Nadeem Vawda
New submission from Nadeem Vawda : As mentioned in issue 6715, the buffer growth strategy used by _io.FileIO has quadratic running time if each reallocation is O(n). The code in question is new_buffersize() from Modules/_io/fileio.c: if (currentsize > SMALLCHUNK) { /* Keep doubling u

[issue13150] Most of Python's startup time is sysconfig

2011-10-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Actually, #9878 should supersede this bug: it proposes to generate a C > module to avoid parsing Makefile and pyconfig.h, and your patch > proposes to generate a Python module with the same goal. Well, #9878 doesn't have a patch, but perhaps Barry is willing

[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: If you don't use git-style diffs, Rietveld will much better accommodate patches that don't apply to tip cleanly. Unfortunately, hg git-style diffs don't indicate the base revision, so Rietveld guesses that the base line is tip, and then fails if it doesn't a

[issue13149] optimization for append-only StringIO

2011-10-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: It would be interesting to see how often the "bad" case triggers, i.e. that a write-only stringio sees any of the other methods invoked at all. As a special case, you may consider that .truncate(0) doesn't really need to realize the buffer first. I also wond

[issue8668] Packaging: add a 'develop' command

2011-10-12 Thread Éric Araujo
Éric Araujo added the comment: Thanks for the updated patch. There are things that should be removed (for example functions like get_develop_method, given that we only support packaging-based projects), and there are a few things to clean up in the tests. What’s more practical for you, a re

[issue13150] Most of Python's startup time is sysconfig

2011-10-12 Thread Éric Araujo
Éric Araujo added the comment: Actually, #9878 should supersede this bug: it proposes to generate a C module to avoid parsing Makefile and pyconfig.h, and your patch proposes to generate a Python module with the same goal. -- ___ Python tracker

[issue13150] Most of Python's startup time is sysconfig

2011-10-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13150] Most of Python's startup time is sysconfig

2011-10-12 Thread Éric Araujo
Éric Araujo added the comment: #9878 should also help with start-up time. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue12659] Add tests for packaging.tests.support

2011-10-12 Thread Éric Araujo
Éric Araujo added the comment: Yes, you did. There are a few minor edits I’ll make to the patch, but otherwise this is good to commit. -- assignee: tarek -> eric.araujo versions: +3rd party ___ Python tracker __

[issue6807] No such file or directory: 'msisupport.dll' in msi.py

2011-10-12 Thread Brian Curtin
Changes by Brian Curtin : -- components: +Windows nosy: +brian.curtin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue6807] No such file or directory: 'msisupport.dll' in msi.py

2011-10-12 Thread Sébastien Sablé
Sébastien Sablé added the comment: I had the same issue today. The patch solved the problem. Thanks -- nosy: +sable ___ Python tracker ___ ___

[issue8668] Packaging: add a 'develop' command

2011-10-12 Thread higery
Changes by higery : Added file: http://bugs.python.org/file23387/adb2cb19ca9b.diff ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue4431] Distutils MSVC doesn't create manifest file (with fix)

2011-10-12 Thread David Schnur
David Schnur added the comment: I haven't commented since opening this issue, but I've been following along. Regarding Marc-Andre's latest comment, I think whether to embed a manifest or not is a separate issue. The current behavior is to embed a manifest, and so it should ensure that the f

[issue13158] tarfile.TarFile.getmembers misses some entries

2011-10-12 Thread Sebastien Binet
New submission from Sebastien Binet : hi there, it seems tarfile in python 3.2.2 (as installed in archlinux, but I don't see any additional patch applied on top of the vanilla sources: http://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/python ) has troubles givin

[issue13157] Build Python outside the source directory

2011-10-12 Thread STINNER Victor
Changes by STINNER Victor : -- components: +Build ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue13157] Build Python outside the source directory

2011-10-12 Thread STINNER Victor
New submission from STINNER Victor : It is no more possible to build Python outside its source directory. Try using: cd mkdir release cd release ../configure make Attached patch should fix this issue. -- files: build.patch keywords: patch messages: 145392 nosy: haypo, loewis, neologix

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > How many moons before Python 2.7.3 though? If you convince python-dev that's it's a critical bug (is it?) I suppose it could happen soon. -- ___ Python tracker ___

[issue4431] Distutils MSVC doesn't create manifest file (with fix)

2011-10-12 Thread Sébastien Sablé
Sébastien Sablé added the comment: I got this problem again this morning while compiling pywin32. This problem is not specific to me, anyone using Visual Studio 2010 to compile Python is experiencing the same issue: http://nukeit.org/compile-python-2-7-packages-with-visual-studio-2010-express

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-12 Thread Graham Dumpleton
Graham Dumpleton added the comment: True. Doesn't appear to be an issue with Python 3.2.2. Only Python 2.7.2. I was not aware that the TLS mechanism was changed in Python 3.X so assumed would also affect it. So, looks like the change shouldn't have been applied to Python 2.7. How many moons

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-12 Thread Charles-François Natali
Charles-François Natali added the comment: > So the solution would be simply to backout this patch on 2.7 and 3.2. Actually, I just checked, and the native TLS implementation is present in 3.2, so this problem shouldn't show up: did you test it with 3.2? AFAICT, this should only affect 2.7 (fo

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-12 Thread Charles-François Natali
Charles-François Natali added the comment: > So, the documentation you quote is only to do with the main > interpreter and is not how things work for sub interpreters. You're right, my bad. However, it would probably be better to destroy/reset the autoTLSkey even if the current thread doesn't h

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-12 Thread Graham Dumpleton
Graham Dumpleton added the comment: The PyGILState_Ensure() function is only for when working with the main interpreter. These external threads are not calling into the main interpreter. Because they are external threads, calling PyGILState_Ensure() and then PyGILState_Release() will cause a

[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2011-10-12 Thread Charles-François Natali
Charles-François Natali added the comment: Note that this doesn't apply to default: the problem is that 2.7 and 3.2 don't use native TLS, and with the ad-hoc TLS implementation, a NULL value isn't supported: """ /* Internal helper. * If the current thread has a mapping for key, the appropri