thread/queue bug
I have a very strange bug. A thread in a .pyc stops dead. This program has many threads and queues and has worked great for months. One thread listens for UDP messages from other programs, and puts the messages in listenq. Procmsgs gets from listenq and for a certain kind of message creates another mq = Queue(0). I don't wish to distribute the source to pnetx.py so I have a short program pnet.py import it, that is pnetx.pyc. Then the procmsgs thread dies at the Queue statement. But if I run pnetx.py as the main program, all works fine. So if pnetx.py or .pyc is imported this thread dies. ??? I've tried this with 2.3.3 and 2.3.4. Anyone? ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1866] const arg for PyInt_FromString
New submission from phil: In PyInt_FromString(), please change the type of the first arg from char * to const char *. That is, of course, if the function indeed does not write to the string. (I took a quick look at the code; it doesn't appear to.) If the function does modify the string, it should be documented. I'm getting a compiler error in some C++ code when I use a std::string::c_str() as the arg. Of course, I could cast away the const, but paranoid as I am, I'd like reassurance that I can do so with impunity. :-) -- components: Extension Modules messages: 60108 nosy: philipdumont severity: minor status: open title: const arg for PyInt_FromString type: rfe versions: Python 2.5 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1866> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1866] const arg for PyInt_FromString
phil added the comment: Oh, all right. Just don't tell my boss -- he thinks I'm doing "real" work. :-) I haven't thoroughly studied the test harness, but it looked like /bin/python /lib/python2.5/test/autotest.py was what I should do? The output generated before/after the patch was identical. Added file: http://bugs.python.org/file9265/Python-2.5.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1866> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1866] const arg for PyInt_FromString
Changes by phil: Added file: http://bugs.python.org/file9266/autotest.out.after __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1866> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1866] const arg for PyInt_FromString
phil added the comment: Ok. Ran 'make test' before and after patch. Output identical. Attaching output after patch. Added file: http://bugs.python.org/file9417/make_test_after __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1866> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40124] Clearer assertion error
New submission from Phil : https://discuss.python.org/t/assertionerror-asyncio-streams-in-drain-helper/3743/4 I recently came across this error, which I now know how to fix. I think the error can be clearer and I've a PR which I think does so. -- components: asyncio messages: 365378 nosy: asvetlov, pgjones, yselivanov priority: normal severity: normal status: open title: Clearer assertion error versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue40124> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40124] Clearer assertion error
Change by Phil : -- keywords: +patch pull_requests: +18598 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19240 ___ Python tracker <https://bugs.python.org/issue40124> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43246] Dict copy optimization violates subclass invariant
Change by Phil : -- nosy: +pgjones ___ Python tracker <https://bugs.python.org/issue43246> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16361] HTTPS/TLS Problem in Python 3.3
New submission from Phil: I had converted some code for a scraper from 2.7.3 to 3.3.0 on Windows 7 and suddenly the code stopped working. Now the https fetch results in: Traceback (most recent call last): File "D:\Users\Phil\Desktop\demo.py", line 67, in page=getWebData() File "D:\Users\Phil\Desktop\demo.py", line 59, in getWebData response=urllib.request.urlopen(req, cadefault=False) File "D:\Program Files\Python33\lib\urllib\request.py", line 160, in urlopen return opener.open(url, data, timeout) File "D:\Program Files\Python33\lib\urllib\request.py", line 473, in open response = self._open(req, data) File "D:\Program Files\Python33\lib\urllib\request.py", line 491, in _open '_open', req) File "D:\Program Files\Python33\lib\urllib\request.py", line 451, in _call_chain result = func(*args) File "D:\Program Files\Python33\lib\urllib\request.py", line 1287, in https_open context=self._context, check_hostname=self._check_hostname) File "D:\Program Files\Python33\lib\urllib\request.py", line 1255, in do_open raise URLError(err) urllib.error.URLError: I have run Wireshark using Python 2.7.3 and Python 3.3.0 (see attached files) -- components: Library (Lib) files: demo.py messages: 174158 nosy: pventura priority: normal severity: normal status: open title: HTTPS/TLS Problem in Python 3.3 type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file27785/demo.py ___ Python tracker <http://bugs.python.org/issue16361> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16361] HTTPS/TLS Problem in Python 3.3
Changes by Phil : Added file: http://bugs.python.org/file27786/py2-filtered.pcapng ___ Python tracker <http://bugs.python.org/issue16361> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16361] HTTPS/TLS Problem in Python 3.3
Changes by Phil : Added file: http://bugs.python.org/file27787/py3-filtered.pcapng ___ Python tracker <http://bugs.python.org/issue16361> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16361] HTTPS/TLS Problem in Python 3.3
Phil added the comment: You will notice that in the Python 3.3.0 version after packet 54 (Client Hello), there seems to be no response from the server. Today, I was able to verify that the code worked under Python 3.2.3. -- ___ Python tracker <http://bugs.python.org/issue16361> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10681] PySlice_GetIndices() signature changed
New submission from Phil Thompson : In Python v3.2b1 the type of the first argument of PySlice_GetIndices() and PySlice_GetIndicesEx() has changed from PySliceObject* to PyObject*. The documentation does not reflect this change. Which is correct, the source code or the documentation? -- assignee: d...@python components: Documentation, Interpreter Core messages: 123809 nosy: Phil.Thompson, d...@python priority: normal severity: normal status: open title: PySlice_GetIndices() signature changed type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue10681> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10681] PySlice_GetIndices() signature changed
Phil Thompson added the comment: You might want to add a "Changed in Python v3.2" because as it is an incompatible change. -- ___ Python tracker <http://bugs.python.org/issue10681> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10681] PySlice_GetIndices() signature changed
Phil Thompson added the comment: It's source level incompatible - my extension modules compiled fine with v3.2a but failed with v3.2b1. -- ___ Python tracker <http://bugs.python.org/issue10681> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32092] mock.patch with autospec does not consume self / cls argument
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue32092> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38091] Import deadlock detection causes deadlock
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue38091> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30587] Mock with spec object does not ensure method call signatures
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue30587> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7897] Support parametrized tests in unittest
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue7897> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38122] AsyncMock force always creating an AsyncMock for child mocks
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue38122> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38384] An assertion failure in test_pickle
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue38384> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18108] shutil.chown should support dir_fd and follow_symlinks keyword arguments
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue18108> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38494] Add assert_not_called_with
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue38494> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23882] unittest discovery doesn't detect namespace packages when given no parameters
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue23882> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37052] Add examples for mocking async for and async context manager in unittest.mock docs
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue37052> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38505] Mock.call_args and Mock.call_args_list not propagated to parent Mock
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue38505> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25299] argparse: TypeError: __init__() takes at least 4 arguments (4 given)
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue25299> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35617] unittest discover does not work with implicit namespaces
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue35617> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25597] unittest.mock does not wrap dunder methods (__getitem__ etc)
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue25597> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36723] Unittest Discovery for namespace subpackages dot notation fails
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue36723> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44492] Building a C extension on Big Sur and SDK v10.15 fails
New submission from Phil Thompson : I am running macOS v11 (Big Sur) and using Xcode v12.1 (because this is the latest that includes SDK v10.15 rather than v11) to build a C extension. I'm using the older SDK because of 3rd party libraries that are not tested against the newer SDK. This version of Xcode/SDK does not support universal2 binaries. However because _supports_arm64_builds() in _osx_support only tests the macOS version and not the SDK version it returns True which means that distutils does not call compiler_fixup() to remove the '-arch arm64'. The compilation then fails. Should this work, or does Python v3.10 require SDK v11? -- components: Distutils messages: 396377 nosy: dstufft, eric.araujo, philthompson10 priority: normal severity: normal status: open title: Building a C extension on Big Sur and SDK v10.15 fails type: behavior versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue44492> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44492] Building a C extension on Big Sur and SDK v10.15 fails
Phil Thompson added the comment: Another aspect of this is when building a Python v3.10 C extension on macOS v10.15 (Catalina) with SDK 10.15, the wheel has the 'universal2' platform tag when it actually only contains an x86_64 implementation. -- ___ Python tracker <https://bugs.python.org/issue44492> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44548] ttk Indeterminate Progressbar Not Animating Correctly After `start`
New submission from Phil Soucheray : After running `start` on an indeterminate Progressbar, it animates to one side, goes back to the other and then right before it reaches the end it disappears. I've attached a sample script below and a screen recording. This is running on macOS 11.3 and python 3.9.6 with the tkinter version that is packaged with the 3.9.6 installer. ``` from tkinter import * from tkinter.ttk import * import time window = Tk() window.title('Test') window.geometry('400x250+1000+300') pb = Progressbar(window, orient=HORIZONTAL, length=100, mode='indeterminate') pb.pack(expand=True) Button(window, text='Start', command=pb.start).pack() window.mainloop() ``` -- components: Tkinter files: Screen Recording 2021-07-01 at 1.11.26 PM.mov messages: 396828 nosy: souch3 priority: normal severity: normal status: open title: ttk Indeterminate Progressbar Not Animating Correctly After `start` type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50137/Screen Recording 2021-07-01 at 1.11.26 PM.mov ___ Python tracker <https://bugs.python.org/issue44548> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44548] ttk Indeterminate Progressbar Not Animating Correctly After `start`
Phil Soucheray added the comment: It looks like that has done the trick. Is there an expected time when there won't be different installers? -- ___ Python tracker <https://bugs.python.org/issue44548> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44492] Building a C extension on Big Sur and SDK v10.15 fails
Phil Thompson added the comment: Is this likely to be fixed for v3.10? At the very least a wheel should have the correct platform tag. -- ___ Python tracker <https://bugs.python.org/issue44492> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38778] Document that os.fork is not allowed in subinterpreters
New submission from Phil Connell : Add a comment to the os.fork docs to note that forking from a subinterpreter is no longer allowed (see issue34651) -- assignee: docs@python components: Documentation messages: 356459 nosy: docs@python, eric.snow, pconnell priority: normal severity: normal status: open title: Document that os.fork is not allowed in subinterpreters versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue38778> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.
Change by Phil Connell : -- nosy: +pconnell ___ Python tracker <https://bugs.python.org/issue33608> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.
Phil Connell added the comment: Based on Victor's info from https://bugs.python.org/issue36114#msg337090 I believe the crash is essentially what's reproduced in the attached program. >From the root of a (built) cpython clone run: gcc -c -o fini_crash.o -IInclude -I. fini_crash.c && gcc -o fini_crash fini_crash.o libpython3.9.a -lcrypt -lpthread -ldl -lutil -lm && ./fini_crash The output should be: MAIN: allow other thread to execute OTHER: acquired GIL OTHER: released GIL MAIN: interpreter finalized OTHER: attempt to acquire GIL...crash! [1]266749 segmentation fault (core dumped) ./fini_crash And running it through valgrind: $ valgrind --suppressions=Misc/valgrind-python.supp fini_crash -- COMMAND -- 13:4[12/5973] ==266836== Memcheck, a memory error detector ==266836== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==266836== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==266836== Command: fini_crash ==266836== MAIN: allow other thread to execute OTHER: acquired GIL OTHER: released GIL MAIN: interpreter finalized OTHER: attempt to acquire GIL...crash! ==266836== Thread 2: ==266836== Invalid read of size 8 ==266836==at 0x15607D: PyEval_RestoreThread (ceval.c:389) ==266836==by 0x15479F: evil_main (in /home/phconnel/dev/cpython/fini_crash) ==266836==by 0x48B94CE: start_thread (in /usr/lib/libpthread-2.30.so) ==266836==by 0x4B232D2: clone (in /usr/lib/libc-2.30.so) ==266836== Address 0x4d17270 is 16 bytes inside a block of size 264 free'd ==266836==at 0x48399AB: free (vg_replace_malloc.c:540) ==266836==by 0x1773FF: tstate_delete_common (pystate.c:829) ==266836==by 0x1773FF: _PyThreadState_Delete (pystate.c:848) ==266836==by 0x1773FF: zapthreads (pystate.c:311) ==266836==by 0x1773FF: PyInterpreterState_Delete (pystate.c:321) ==266836==by 0x174920: finalize_interp_delete (pylifecycle.c:1242) ==266836==by 0x174920: Py_FinalizeEx.part.0 (pylifecycle.c:1400) ==266836==by 0x15487B: main (in /home/phconnel/dev/cpython/fini_crash) ==266836== Block was alloc'd at ==266836==at 0x483877F: malloc (vg_replace_malloc.c:309) ==266836==by 0x178D7C: new_threadstate (pystate.c:557) ==266836==by 0x178D7C: PyThreadState_New (pystate.c:629) ==266836==by 0x178D7C: PyGILState_Ensure (pystate.c:1288) ==266836==by 0x154759: evil_main (in /home/phconnel/dev/cpython/fini_crash) ==266836==by 0x48B94CE: start_thread (in /usr/lib/libpthread-2.30.so) ==266836==by 0x4B232D2: clone (in /usr/lib/libc-2.30.so) ==266836== ==266836== Invalid read of size 8 ==266836==at 0x156081: PyEval_RestoreThread (ceval.c:389) ==266836==by 0x15479F: evil_main (in /home/phconnel/dev/cpython/fini_crash) ==266836==by 0x48B94CE: start_thread (in /usr/lib/libpthread-2.30.so) ==266836==by 0x4B232D2: clone (in /usr/lib/libc-2.30.so) ==266836== Address 0x4c3a0f0 is 16 bytes inside a block of size 2,960 free'd ==266836==at 0x48399AB: free (vg_replace_malloc.c:540) ==266836==by 0x174920: finalize_interp_delete (pylifecycle.c:1242) ==266836==by 0x174920: Py_FinalizeEx.part.0 (pylifecycle.c:1400) ==266836==by 0x15487B: main (in /home/phconnel/dev/cpython/fini_crash) ==266836== Block was alloc'd at ==266836==at 0x483877F: malloc (vg_replace_malloc.c:309) ==266836==by 0x177153: PyInterpreterState_New (pystate.c:205) ==266836==by 0x1732BF: pycore_create_interpreter (pylifecycle.c:526) ==266836==by 0x1732BF: pyinit_config.constprop.0 (pylifecycle.c:695) ==266836==by 0x1766B7: pyinit_core (pylifecycle.c:879) ==266836==by 0x1766B7: Py_InitializeFromConfig (pylifecycle.c:1055) ==266836==by 0x1766B7: Py_InitializeEx (pylifecycle.c:1093) ==266836==by 0x154801: main (in /home/phconnel/dev/cpython/fini_crash) ==266836== -- Adde
[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.
Phil Connell added the comment: Just to summarise, I'm fairly sure this is exactly what Victor saw: a daemon thread attempts to reacquire the GIL via Py_END_ALLOW_THREADS after interpreter finalisation. Obviously the threadstate pointer held by the thread is then invalid...so we crash. So I see basically two options: 1. Don't (always) free threadstate structures in Py_Finalize, and figure out a way to avoid leaking them (if Python is re-initialized in the same process). 2. Ban this behaviour entirely, e.g. have Py_Finalize fail if there are live threads with threadstate objects. The discussion so far assumes that we should support this, i.e. #1. Any thoughts on that? (I'll have a think about whether this is actually doable!) -- ___ Python tracker <https://bugs.python.org/issue33608> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.
Phil Connell added the comment: The attached patch (wrap_threadstate.diff) is enough to stop the crash. It's a slightly dirty proof-of-concept, but equally could be the basis for a solution. The main functional issue is that there's still a race on the Py_BLOCK_THREADS side: it's possible that the "is threadstate still valid" check can pass, but the interpreter is finalised while the daemon thread is trying to reacquire the GIL in PyEval_RestoreThread. (The Py_UNBLOCK_THREADS side is non-racy as the GIL is held while the ts and wrapper updates are done). -- Added file: https://bugs.python.org/file48732/wrap_threadstate.diff ___ Python tracker <https://bugs.python.org/issue33608> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41376] site.getusersitepackages() incorrectly claims that PYTHONNOUSERSITE is respected
New submission from Phil Elson : The documentation for site.getusersitepackages() states at https://docs.python.org/3.10/library/site.html#site.getusersitepackages: Return the path of the user-specific site-packages directory, USER_SITE. If it is not initialized yet, this function will also set it, respecting PYTHONNOUSERSITE and USER_BASE. Yet the implementation does not agree: ``` $ python -c "import site; print(site.getusersitepackages())" /home/user/.local/lib/python3.7/site-packages $ PYTHONNOUSERSITE=1 python -c "import site; print(site.getusersitepackages())" /home/user/.local/lib/python3.7/site-packages ``` (same result for -s and -I flags) -- assignee: docs@python components: Documentation messages: 374139 nosy: docs@python, pelson priority: normal severity: normal status: open title: site.getusersitepackages() incorrectly claims that PYTHONNOUSERSITE is respected versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue41376> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41376] site.getusersitepackages() incorrectly claims that PYTHONNOUSERSITE is respected
Change by Phil Elson : -- keywords: +patch pull_requests: +20740 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21602 ___ Python tracker <https://bugs.python.org/issue41376> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14905] zipimport needs to support namespace packages when no 'directory' entry exists
Phil Connell added the comment: One version of the bug described here (and fixed in the old implementation under issue17633) exists in the Python implementation of zipimport: $ unzip -l namespace1.zip Archive: namespace1.zip Length DateTimeName - -- - 0 08-13-2020 06:30 one/ 0 08-13-2020 06:30 one/two/ 0 08-13-2020 06:30 one/two/three.py - --- 0 3 files $ unzip -l namespace2.zip Archive: namespace2.zip Length DateTimeName - -- - 0 08-13-2020 06:37 alpha/beta/gamma.py - --- 0 1 file $ PYTHONPATH=namespace1.zip:namespace2.zip ./python Python 3.10.0a0 (heads/master:c51db0ea40, Aug 13 2020, 06:41:20) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import one >>> import alpha Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'alpha' >>> In short, imports where there's no separate entry for directories in the zip file don't work. Any opinions on whether this *is* the problem this issue is trying to track? -- ___ Python tracker <https://bugs.python.org/issue14905> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO
New submission from Phil Thompson : The old unaccelerated ETree XMLParser accepts input from a io.StringIO, but the accelerated version does not. Any code that relies on this is broken by Python v3.3. -- components: XML messages: 155301 nosy: philthompson10 priority: normal severity: normal status: open title: Accelerated ETree XMLParser cannot handle io.StringIO type: behavior versions: Python 3.3 ___ Python tracker <http://bugs.python.org/issue14246> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO
Phil Thompson added the comment: This variation of your test doesn't... --- import io from xml.etree.ElementTree import parse stream = io.StringIO() stream.write(''' ''') stream.seek(0) parsed = parse(stream) print(parsed) --- Phil -- ___ Python tracker <http://bugs.python.org/issue14246> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37168] Decimal divisions sometimes 10x or 100x too large
New submission from Phil Frost : We've observed instances of Decimal divisions being incorrect a few times per day in a web application serving millions of requests daily. I've been unable to reproduce the issue but have been investigating core dumps which suggest either some issue in the C Python implementation or its execution environment. Python 2.7.15 on Alpine Linux Docker containers. A slightly modified decimal.py is attached. It's been modified to check that the answer is approximately correct and dumps core if not. It also has a few local variables added to provide additional insight. I've annotated the file with values from the core dump and my reasoning about what should happen. The crux of the problem is the loop at line 1389. There are 3 ways to determine how many times this loop executed: 1. the number of zeros removed from coeff 2. the number of times exp is incremented 3. the number of times division_counter is incremented Oddly, #1 and #3 indicate the loop happened 27 times, while #2 indicates the loop happened 28 times. One possible explanation (which makes about as much sense as any other) is that `exp += 1` sometimes adds 2 instead of 1. This means the loop happens 1 time fewer than it should, leaving `coeff` 10 times bigger than it should properly be. Or (very rarely) this happens twice and the result is 100 times bigger. I find it very odd that something as basic as `+= 1` should not work, but at the moment it is the best explanation I have. Unfortunately I can't share the core dump, as I've only been able to observe the issue in production so the core contains private information. But I'd welcome any ideas for further exploration. Or perhaps someone is aware of an existing bug that would explain this behavior. -- components: Interpreter Core files: decimal.py messages: 344772 nosy: Phil Frost priority: normal severity: normal status: open title: Decimal divisions sometimes 10x or 100x too large versions: Python 2.7 Added file: https://bugs.python.org/file48396/decimal.py ___ Python tracker <https://bugs.python.org/issue37168> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37168] Decimal divisions sometimes 10x or 100x too large
Phil Frost added the comment: I should note that while we do observe this issue with Decimal, my troubleshooting so far indicates the logic in decimal.py is fine. It seems instead the instructions in decimal.py aren't being correctly executed. I'm not sure if the problem is limited to only Decimal, or if we just notice it there because it's correlated with financial code, which when encountering the bug, introduces an error which is eventually caught by the accounting department. There could very well be errors happening at least frequently elsewhere which simply go unnoticed. -- ___ Python tracker <https://bugs.python.org/issue37168> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37168] Decimal divisions sometimes 10x or 100x too large
Phil Frost added the comment: skrah: Yes, that's correct. Since I can only produce this bug in production it will take me some days to build and validate a source build. But absent any better ideas, I will try. tim.peters: I've observed this bug across hundreds of EC2 hosts, in dozens of code paths, with all kinds of inputs. Moreover, the hosts aren't displaying any other symptoms of hardware failure such as random segfaults or mysteriously corrupted data. I've also deeply investigated two cores now which show specifically that `exp` seems to get 2 added when it should have been 1. I have a hard time explaining how a hardware failure can cause precisely the same failure so reliably. So I doubt hardware is to blame. Although, it does seem the issue occurs in "clumps" on individual hosts. So we might go 10 hours without seeing the issue, then it may happen 5 times within 30 minutes on one host. We might observe 1 or 2 more such clumps on the same host until the next deploy of the application, at which point all the containers are replaced with fresh ones. So this suggests there is some ephemeral state within a host that creates a propensity for the issue. I've also been unable to reproduce the problem in a development environment, even when that development environment is using the same kernel, instance class, and docker container as production. So I suspect the bug is precipitated by some particular concurrency or interaction that I haven't been able to replicate. -- ___ Python tracker <https://bugs.python.org/issue37168> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37168] Decimal divisions sometimes 10x or 100x too large
Phil Frost added the comment: > Alpine Linux apparently uses musl. Is that well supported and tested? Heh. Not really. Switching to a Debian container is probably just about as much work as building Python from source. Would that be preferable? -- ___ Python tracker <https://bugs.python.org/issue37168> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37168] Decimal divisions sometimes 10x or 100x too large
Phil Frost added the comment: So this is uminteresting (gdb) p small_ints[0] $2 = (PyIntObject *) 0x558ce65df528 (gdb) p *small_ints[0] $3 = {ob_refcnt = 18, ob_type = 0x7fe019b694c0 , ob_ival = -5} (gdb) p *small_ints[1] $4 = {ob_refcnt = 65, ob_type = 0x7fe019b694c0 , ob_ival = -3} (gdb) p *small_ints[2] $5 = {ob_refcnt = 204, ob_type = 0x7fe019b694c0 , ob_ival = -3} (gdb) p *small_ints[3] $6 = {ob_refcnt = 1872, ob_type = 0x7fe019b694c0 , ob_ival = -2} When is 1/1=10? When -5 + 1 = -3. So now I suppose the question is how this comes to be. -- ___ Python tracker <https://bugs.python.org/issue37168> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37168] Decimal divisions sometimes 10x or 100x too large
Phil Frost added the comment: Probably too many C extensions to feasibly audit them all. Also we can't rule out something busted in Alpine. So I'm going to set a watchpoint on small_ints[1]->ob_ival with a little gdb script to dump core right when it changes; hopefully inspecting that backtrace will lead directly to the culprit. -- ___ Python tracker <https://bugs.python.org/issue37168> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37168] Decimal divisions sometimes 10x or 100x too large
Phil Frost added the comment: I'm afraid that won't be of much use since the object is statically allocated. Besides, the trouble isn't finding what created the object, but what mutated an int object which should be immutable. -- ___ Python tracker <https://bugs.python.org/issue37168> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37356] Name of 64-bit OpenSSL v1.1.1 DLLs
New submission from Phil Thompson : In the 3.8b1 64-bit Windows installer the names of the OpenSSL DLLs do not have the -x64 suffix which seems to be the convention (and is the default when building OpenSSL from source). The convention is followed in the 3.7.0 to 3.7.3 installers. I haven't yet checked the 3.7.4rc1 installer. -- assignee: christian.heimes components: Installation, SSL, Windows messages: 346172 nosy: christian.heimes, paul.moore, philthompson10, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Name of 64-bit OpenSSL v1.1.1 DLLs versions: Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue37356> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37356] Name of 64-bit OpenSSL v1.1.1 DLLs
Phil Thompson added the comment: I think I was incorrect in saying the suffix was the default when building v1.1.1 from source, so any problem I have (trying to share the DLL with different pre-built packages) is not a Python problem. Sorry for the noise. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue37356> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37356] Name of 64-bit OpenSSL v1.1.1 DLLs
Phil Thompson added the comment: A clarification... It seems the suffix is added when configured as VC-WIN64A but omitted when configured as VC-WIN64A-masm. ...still not a Python problem. -- ___ Python tracker <https://bugs.python.org/issue37356> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37168] Decimal divisions sometimes 10x or 100x too large
Phil Frost added the comment: Not yet. I had a hell of a time getting gdb to follow gunicorn forks so it would watch the workers but not also every other thing using popen or os.system(). And the lldb package on Alpine doesn't seem to work. So we're currently in the process of testing a Debian container for production, hoping the issue just goes away. If not, I'll continue digging in with a debugger. ------ nosy: +Phil Frost2 ___ Python tracker <https://bugs.python.org/issue37168> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37588] Py_DEPRECATED and unavoidable warnings
New submission from Phil Thompson : I have a number of static PyTypeObject declarations. In order to avoid compiler warnings about missing field initialisers I always provide explicit 0 values for unused fields (protected by #if PY_HEX_VERSION >= ...). However with v3.8b2 this triggers new warnings from Py_DEPRECATED because of the initialiser for tp_print. I would like some way of locally suppressing Py_DEPRECATED. The attached trivial patch would do this by allowing me to define a null Py_DEPRECATED before including Python.h. -- components: Interpreter Core files: pyport.h.diff keywords: patch messages: 347848 nosy: philthompson10 priority: normal severity: normal status: open title: Py_DEPRECATED and unavoidable warnings type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file48478/pyport.h.diff ___ Python tracker <https://bugs.python.org/issue37588> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37588] Py_DEPRECATED and unavoidable warnings
Phil Thompson added the comment: I am not "touching" tp_print. I am simply defining it as 0 to avoid the missing initialiser warning. My point is that it should be possible to write code that doesn't trigger warnings (whether or not you suppress them). -- ___ Python tracker <https://bugs.python.org/issue37588> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37588] Py_DEPRECATED and unavoidable warnings
Phil Thompson added the comment: On 19/07/2019 11:37, Jeroen Demeyer wrote: > Jeroen Demeyer added the comment: > >> We have some reserved/deprecated/unused fields. Setting 0 to them >> makes forward incompatible code. > > Good point. tp_print is removed in 3.9 Which is why I protect the initialisation with #if PY_VERSION_HEX < 0x0309 As far as I can see this is the "right thing" to do. However doing the "right thing" means I cannot avoid warnings without resorting to compiler-specific build system changes. With the change I am asking for I can suppress the warning (because I have explicitly dealt with the issue) in the code itself without affecting the rest of the system. -- ___ Python tracker <https://bugs.python.org/issue37588> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37588] Py_DEPRECATED and unavoidable warnings
Phil Thompson added the comment: >> Which is why I protect the initialisation with #if PY_VERSION_HEX < > 0x0309 > > It is your specific case. We can not assume people do it, or even you > never forget it. So this is not the "right thing" we can recommend to > all users. > > Once you or other people suppress the deprecation warning and forget > the protect, compatibility issue happen again. Why such dangerous > option is needed? If I fail to protect against using a feature when it is no longer present then it's a bug in my code and it won't compile. Providing a deprecation warning gives me some notice that my code needs to be changed. That is helpful but not strictly necessary as I will soon find out when testing against the new version. There is nothing "dangerous" here. -- ___ Python tracker <https://bugs.python.org/issue37588> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35838] ConfigParser calls optionxform twice when assigning dict
New submission from Phil Kang : ConfigParser calls ConfigParser.optionxform twice per each key when assigning a dictionary to a section. The following code: ini = configparser.ConfigParser() ini.optionxform = lambda x: '(' + x + ')' # Bugged ini['section A'] = {'key 1': 'value 1', 'key 2': 'value 2'} # Not bugged ini.add_section('section B') ini['section B']['key 3'] = 'value 3' ini['section B']['key 4'] = 'value 4' inifile = io.StringIO() ini.write(inifile) print(inifile.getvalue()) ...results in an INI file that looks like: [section A] ((key 1)) = value 1 ((key 2)) = value 2 [section B] (key 3) = value 3 (key 4) = value 4 Here, optionxform has been called twice on key 1 and key 2, resulting in the double parentheses. This also breaks conventional mapping access on the ConfigParser: print(ini['section A']['key 1'])# Raises KeyError('key 1') print(ini['section A']['(key 1)']) # OK # Raises ValueError: too many values to unpack (expected 2) for key, value in ini['section A']: print(key + ', ' + value) -- components: Library (Lib) messages: 334439 nosy: Phil Kang priority: normal severity: normal status: open title: ConfigParser calls optionxform twice when assigning dict type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue35838> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35910] Curious problem with my choice of variables
New submission from Phil Dream : Firstable I am not a software expert just a hobby user so please be indulgent I use a Raspberry Pi3B+ with raspbian lite and Python 3.5.3 In my script, I need 2 nested "while" loops so I chose two variables to incriment them 'i' and j. This script don't work and I made a certain time to understand (I did not think Python could play me a trick). I needed to reset 'j' to go through the inner loop a few times and in fact I realized that when I initialized 'j', 'i' was also initialized !?!? Very curious isn't it ? I replaced 'i' by 'y' and no more problem, my script works very well. -- files: sirext.py messages: 334913 nosy: Phil Dream priority: normal severity: normal status: open title: Curious problem with my choice of variables type: behavior versions: Python 3.5 Added file: https://bugs.python.org/file48104/sirext.py ___ Python tracker <https://bugs.python.org/issue35910> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35910] Curious problem with my choice of variables
Phil Dream added the comment: OK, I am sorry I didn’t know Best regards De : Stéphane Wirtel Envoyé le :mercredi 6 février 2019 11:10 À : philsdr...@gmail.com Objet :[issue35910] Curious problem with my choice of variables Stéphane Wirtel added the comment: Hi Phil, This bug tracker is more for the core-dev and the contributors of CPython. I suggest to you to use the right mailing list for your issues. or use #python-fr on freenode Mailing list: https://mail.python.org/mailman/listinfo/python-list I close this issue because it's not related to the internals of Python. -- nosy: +matrixise resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35910> ___ -- ___ Python tracker <https://bugs.python.org/issue35910> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35910] Curious problem with my choice of variables
Phil Dream added the comment: OK, I am sorry I didn’t know Thanks for the advice Best regards De : Rémi Lapeyre Envoyé le :mercredi 6 février 2019 11:07 À : philsdr...@gmail.com Objet :[issue35910] Curious problem with my choice of variables Rémi Lapeyre added the comment: Hi @Phil Dream, you reuse i in your inner loop, in the for statement. By the way, I suggest you look at range() to replace your while loop: https://docs.python.org/3/library/functions.html#func-range. For your others questions, the mailing list are more appropriate than the bug tracker. Have a nice day! -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue35910> ___ -- ___ Python tracker <https://bugs.python.org/issue35910> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32141] configure with Spaces in Directory Name on macOS
New submission from Phil Thompson : When configure searches for a C compiler on macOS it fails to handle spaces in directory name on PATH. The fix is to enclose $as_dir in quotes. -- components: Build messages: 307004 nosy: philthompson10 priority: normal severity: normal status: open title: configure with Spaces in Directory Name on macOS type: behavior versions: Python 3.6 ___ Python tracker <https://bugs.python.org/issue32141> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18032] set methods should specify whether they consume iterators "lazily"
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker <http://bugs.python.org/issue18032> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18033] Example for Profile Module shows incorrect method
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker <http://bugs.python.org/issue18033> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18035] telnetlib incorrectly assumes that select.error has an errno attribute
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker <http://bugs.python.org/issue18035> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18036] "How do I create a .pyc file?" FAQ entry is out of date
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker <http://bugs.python.org/issue18036> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18043] No mention of `match.regs` in `re` documentation
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker <http://bugs.python.org/issue18043> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18042] Provide enum.unique class decorator
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker <http://bugs.python.org/issue18042> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18047] Descriptors get invoked in old-style objects and classes
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker <http://bugs.python.org/issue18047> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17792] Unhelpful UnboundLocalError due to del'ing of exception target
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker <http://bugs.python.org/issue17792> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18111] Add a default argument to min & max
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker <http://bugs.python.org/issue18111> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18112] PEP 442 implementation
Changes by Phil Connell : -- nosy: +isoschiz, pconnell ___ Python tracker <http://bugs.python.org/issue18112> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18129] Fatal Python error: Cannot recover from stack overflow.
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker <http://bugs.python.org/issue18129> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18208] Wrong bytecode generated for 'in' operation
New submission from Phil Connell: The following two expressions should have the same value: Python 3.4.0a0 (default:fae92309c3be, Jun 14 2013, 09:29:54) [GCC 4.8.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> 1 in [2] == False False >>> (1 in [2]) == False True It looks like this is a compiler issue - there shouldn't be a jump if the 'in' expression is false: >>> dis.dis("1 in [2] == False") 1 0 LOAD_CONST 0 (1) 3 LOAD_CONST 1 (2) 6 BUILD_LIST 1 9 DUP_TOP 10 ROT_THREE 11 COMPARE_OP 6 (in) 14 JUMP_IF_FALSE_OR_POP24 17 LOAD_CONST 2 (False) 20 COMPARE_OP 2 (==) 23 RETURN_VALUE >> 24 ROT_TWO 25 POP_TOP 26 RETURN_VALUE >>> -- components: Interpreter Core messages: 191108 nosy: benjamin.peterson, brett.cannon, georg.brandl, isoschiz, ncoghlan, pconnell priority: normal severity: normal status: open title: Wrong bytecode generated for 'in' operation ___ Python tracker <http://bugs.python.org/issue18208> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18213] py-bt errors on backtrace
New submission from Phil Muldoon: (gdb) py-bt #2 Frame 0xef8180, for file , line 1, in () Python Exception (2, 'No such file or directory', ''): Error occurred in Python command: (2, 'No such file or directory', '') This is the actual raw frame data: #0 frapy_pc (self=, args=0x0) at ../../gdb/gdb/python/py-frame.c:223 #1 0x003edf4dcfd6 in call_function (oparg=, pp_stack=0x7fffd378) at /usr/src/debug/Python-2.7.3/Python/ceval.c:4082 #2 PyEval_EvalFrameEx (f=f@entry=Frame 0xef8180, for file , line 1, in (), throwflag=throwflag@entry=0) at /usr/src/debug/Python-2.7.3/Python/ceval.c:2740 #3 0x003edf4ddcbf in PyEval_EvalCodeEx ( During symbol reading, Multiple children of DIE 0x3904c refer to DIE 0x38d87 as their abstract origin. co=co@entry=0x71adb8b0, globals=globals@entry= {'g': , '__builtins__': , 'GdbRemoveReadlineFinder': , '__package__': None, 'sys': , 'gdb': , '__name__': '__main__', '__doc__': None}, locals=locals@entry= {'g': , '__builtins__': , 'GdbRemoveReadlineFinder': , '__package__': None, 'sys': , 'gdb': , '__name__': '__main__', '__doc__': None}, args=args@entry=0x0, argcount=argcount@entry=0, kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0, closure=closure@entry=0x0) at /usr/src/debug/Python-2.7.3/Python/ceval.c:3330 -- components: Demos and Tools messages: 191131 nosy: dmalcolm, pmuldoon priority: normal severity: normal status: open title: py-bt errors on backtrace type: crash versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue18213> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18208] Wrong bytecode generated for 'in' operation
Phil Connell added the comment: Thanks Amaury. That's quite surprising, but I wouldn't advocate changing such long standing behaviour. I'm closing the issue. -- status: pending -> closed ___ Python tracker <http://bugs.python.org/issue18208> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18213] py-bt errors on backtrace with PyRun_SimpleString and friends
Phil Muldoon added the comment: Yes I did truncate the output, the backtrace was very long. This is my scenario: gdb --args ./gdb When the superior gdb loads, I did: (top-gdb) b frapy_pc (top-gdb) run In the inferior gdb, I did: (gdb) start (gdb) py g = gdb.selected_frame() (gdb) py print g.pc() This will hit the breakpoint in the inferior gdb and you will be returned to the superior gdb. I then did: (top-gdb) py-bt -- ___ Python tracker <http://bugs.python.org/issue18213> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18103] Create a GUI test framework for Idle
Changes by Phil Webster : -- nosy: +philwebster ___ Python tracker <http://bugs.python.org/issue18103> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
New submission from Phil Webster: This is a single test for RstripExtension.py, following from #15392. I also added a mock EditorWindow module with a Text widget for testing. test_rstripextension.py seems to run fine inside IDLE and produces the following output: >>> test_do_rstrip (__main__.Test_rstripextension) ... ok -- Ran 1 test in 0.100s OK However, when I run via the command line, I get the following output: philwebster@ubuntu:~/Dev/cpython$ ./python -m test -ugui test_idle [1/1] test_idle Warning -- warnings.showwarning was modified by test_idle 1 test altered the execution environment: test_idle I attempted to replicate the results from #18189, but saw the same message. Any thoughts? -- components: IDLE messages: 191618 nosy: JayKrish, philwebster priority: normal severity: normal status: open title: IDLE Unit test for RstripExtension.py type: enhancement versions: Python 2.7, Python 3.4 ___ Python tracker <http://bugs.python.org/issue18279> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Changes by Phil Webster : -- nosy: +Todd.Rovito ___ Python tracker <http://bugs.python.org/issue18279> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Changes by Phil Webster : -- nosy: +terry.reedy ___ Python tracker <http://bugs.python.org/issue18279> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Changes by Phil Webster : -- keywords: +patch Added file: http://bugs.python.org/file30664/test_rstripext.patch ___ Python tracker <http://bugs.python.org/issue18279> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Phil Webster added the comment: Thank you for the feedback Terry. I'm not seeing the traceback without '-ugui' either, so I'm going to look into that. I get the same results with requires('gui') moved inside of setUp, is that what you mean by wrapping? For mock_ewin I used a real Text widget because RstripExtension uses index(), get(), and delete() and I was not able to figure out how the widget implemented these (is there a single string with the contents?). I can work on a non-gui test though if that's what needs to be done. Thanks! -- ___ Python tracker <http://bugs.python.org/issue18279> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Phil Webster added the comment: Modified the first patch to get rid of mock EditorWindow in favor of the real thing. Also renamed the test to 'test_rstrip'. -- Added file: http://bugs.python.org/file30694/test_rstrip.patch ___ Python tracker <http://bugs.python.org/issue18279> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18292] IDLE Improvements: Unit test for AutoExpand.py
Changes by Phil Webster : -- nosy: +philwebster ___ Python tracker <http://bugs.python.org/issue18292> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Phil Webster added the comment: I'm not sure if this is worth pursuing, but I made a mock Text Widget that behaves more like an actual Text Widget. I've attached my modified mock_tk.py which I used to create a mock editor window. This works for the test I made in #18279, but I am also working on a version similar to Todd's for that issue. -- Added file: http://bugs.python.org/file30746/mock_tk.py ___ Python tracker <http://bugs.python.org/issue18226> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Phil Webster added the comment: Added to Terry's Text Widget code (in #18226) and created mock_idle.py for the mock EditorWindow. Todd's FormatParagraph test in the aforementioned issue also passes with the mock EditorWindow. -- Added file: http://bugs.python.org/file30777/test_rstrip2.patch ___ Python tracker <http://bugs.python.org/issue18279> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Phil Webster added the comment: I made slight modifications to Todd's initial patch to test the mock Text widget from #18365. Thank you for the helpful feedback Terry! -- Added file: http://bugs.python.org/file30853/18226IDLEUnitTestFormatParagraph2.patch ___ Python tracker <http://bugs.python.org/issue18226> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18365] Idle: mock Text class and test thereof
Phil Webster added the comment: Added Text class to mock_tk.py and GUI/non-GUI tests in test_text.py. Running the IDLE tests produced no errors for me. -- keywords: +patch Added file: http://bugs.python.org/file30851/mock_text.patch ___ Python tracker <http://bugs.python.org/issue18365> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Phil Webster added the comment: This patch contains mock_idle.py and the rstrip test using the mock text widget from #18365. Terry- For some reason, the Text widget always contains a '\n' as the last character even when there is nothing visible. Doing a text.get('1.0','end') always has a '\n' at the end from what I can tell. I'm not sure about the filename changing, is it worth creating a new issue for? -- Added file: http://bugs.python.org/file30852/test_rstrip3.patch ___ Python tracker <http://bugs.python.org/issue18279> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18409] IDLE Improvements: Unit test for AutoComplete.py
New submission from Phil Webster: I've started writing this test which depends on #18365. -- components: IDLE messages: 192711 nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE Improvements: Unit test for AutoComplete.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.org/issue18409> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18410] IDLE Improvements: Unit test for SearchDialog.py
New submission from Phil Webster: Continuing the IDLE unittest framework from #15392. Depends on #18365. -- components: IDLE messages: 192713 nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE Improvements: Unit test for SearchDialog.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.org/issue18410> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18425] IDLE Unit test for IdleHistory.py
Changes by Phil Webster : -- nosy: +philwebster ___ Python tracker <http://bugs.python.org/issue18425> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18365] Idle: mock Text class and test thereof
Phil Webster added the comment: Thanks Terry, I will start PEP8-checking my code before I submit (as well as testing more thoroughly). I was thinking the same thing about the logic behind _decode and index functions needing to be combined. How would you recommend adding functionality to the decode function to handle expressions like "1.2 +5 chars" or "1.0 lineend-5c"? AutoComplete.py (#18409) uses this kind of index, so it will be needed soon. I'm thinking that splitting off the base index then parsing the remaining modifier expressions is the way to go. I was also thinking that a _checkIndex method would be good to have especially when using the +/-line and +/-char expressions. -- ___ Python tracker <http://bugs.python.org/issue18365> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18365] Idle: mock Text class and test thereof
Phil Webster added the comment: Using tk.Text for more involved tests sounds good (at least as a start). The pass functions were used to get the FormatParagraph test (#18226) working. I've been using the same effbot.org site as a reference and haven't found anything more detailed. -- ___ Python tracker <http://bugs.python.org/issue18365> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Phil Webster added the comment: Added tests for FormatParagraph using single/multiline comment blocks and single/multiline strings in the mock editor window. Here is a summary of the changes: FormatParagraph.py - description for format_paragraph_event - modified so that selecting a long comment line will comment the new wrapped line - if __name__ == __main__"... mock_tk.py - FormatParagraph uses the 'insert' tag, so I implemented tag_add using a dict (not sure if this is the best option...) - index returns '' if the index refers to selection that doesn't exist (this replicates the real Text widget). It does this by excepting a TypeError and I'm guessing there is a better way to do it than this. - tags (i.e. 'sel.first') can be set to 'end' or other indexes which would not work with a regular Text widget, but it may be useful here. mock_idle.py - added undo start/stop for the mock text widget - used 'sel.first' and 'sel.last' for get_selection_indices() test_rstrip.py - This test used the 'insert' tag, so I set 'insert' to an index to keep the tests passing. test_text.py - Same issue with 'insert' as test_rstrip Should I be submitting multiple patches for these changes or is it ok to combine them? I was also wondering if it would be a good idea to split up the FormatParagraph tests into separate tests. -- Added file: http://bugs.python.org/file30947/18226IDLEUnitTestFormatParagraph3.patch ___ Python tracker <http://bugs.python.org/issue18226> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Phil Webster added the comment: After reading Terry's comments on the initial patch I turned FormatParagraph's initial comments into a docstring and made sure that all lines were < 80 characters. -- Added file: http://bugs.python.org/file30960/18226IDLEUnitTestFormatParagraph4.patch ___ Python tracker <http://bugs.python.org/issue18226> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com