[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-09 Thread Ned Batchelder
New submission from Ned Batchelder : Under tox, sys._base_executable is not an actual file for 3.11.0a3. It was fine in 3.11.0a2. To reproduce: --- 8< # tox.ini [tox] envlist = py{310,311a2,311} skipsdist = True [testenv] commands = python -c "import sys

[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-10 Thread Ned Batchelder
Ned Batchelder added the comment: git bisect also identifies that commit as the first bad: 99fcf1505218464c489d419d4500f126b6d6dc28 is the first bad commit commit 99fcf1505218464c489d419d4500f126b6d6dc28 Author: Steve Dower Date: Fri Dec 3 00:08:42 2021 + bpo-45582: Port getpath

[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-11 Thread Ned Batchelder
Ned Batchelder added the comment: Tox isn't needed, just venv from the stdlib: $ python3.11.0a2 -m venv venv_a2 $ venv_a2/bin/python -c "import sys,os.path; print(e := sys._base_executable); print(os.path.exists(e))" /private/tmp/venv_a2/bin/python True $ python3.11.0a3

[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-11 Thread Ned Batchelder
Ned Batchelder added the comment: The two venvs seem analogous: $ cat venv_a2/pyvenv.cfg home = /usr/local/bin include-system-site-packages = false version = 3.11.0 $ ls -al venv_a2/bin total 72 drwxr-xr-x 13 nedbatchelder wheel 416 Dec 11 10:43 ./ drwxr-xr-x 6 nedbatchelder wheel

[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-13 Thread Ned Batchelder
Ned Batchelder added the comment: This started because a set of tests in the coverage.py test suite fail with 3.11.0a3. They attempt to create a venv in the test, and the test is already running inside a virtualenv. The venv creation fails, with a reference to a non-existent file. I

[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-13 Thread Ned Batchelder
Ned Batchelder added the comment: Demonstration of a problem with only stdlib, and no undocumented features. This is on a Mac: This works: $ python3.10 -V Python 3.10.0 $ python3.10 -m venv v310 $ v310/bin/python -m venv v310-nested $ v310-nested/bin/python -V Python 3.10.0 This does

[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-14 Thread Ned Batchelder
Ned Batchelder added the comment: > I assume /private/tmp/bpo-46028/311-nested/bin/python3.11 exists though? Yes, that file exists, but it's a symlink to a non-existent file: $ ls -al 311-nested/bin total 0 drwxr-xr-x 5 nedbatchelder wheel 160 Dec 13 18:04 ./ drwxr-xr-x 6 nedba

[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-16 Thread Ned Batchelder
Ned Batchelder added the comment: Here's the experiment again with 3.10.1 and 3.11.0a3, and more ls's: $ python3.10 -V Python 3.10.1 $ python3.10 -m venv v310 $ ls -al v310/bin total 72 drwxr-xr-x 12 nedbatchelder wheel 384 Dec 16 06:42 ./ drwxr-xr-x 6 nedbatchelder wheel

[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-16 Thread Ned Batchelder
Ned Batchelder added the comment: Thanks, your change looks good. The exact symlinks in the nested venv's are different for 3.10.1 and your 3.11, but they both work: $ python3.10 -c "import sys; print(sys.version)" 3.10.1 (main, Dec 14 2021, 08:30:13) [Clang 12.0.0 (cla

[issue46225] f_lasti behaves differently for lambdas returned from loops

2022-01-02 Thread Ned Batchelder
New submission from Ned Batchelder : Python 3.11.0a3 changed how f_lasti behaves when calling a function in some situations. This example shows returning a lambda from a function. If the lambda is returned in a loop, then frame.f_lasti is 0 when it is called. If the lambda is not in a loop

[issue46225] f_lasti behaves differently for lambdas returned from loops

2022-01-02 Thread Ned Batchelder
Ned Batchelder added the comment: Also, this only happens with a Python trace function. With a C trace function, pPyFrameObject->f_frame->f_lasti is -1. -- ___ Python tracker <https://bugs.python.org/i

[issue46234] 3.11: Tracing of decorators now visits the decorator line before the decorator function

2022-01-02 Thread Ned Batchelder
New submission from Ned Batchelder : Sometime after 3.11.0a3, tracing of decorators changed so that each decorator line is revisited as the decorator is invoked. Is this intentional? ---< dectrace.py >--- import linecache, sys def trace(frame, even

[issue46314] Stray RESUME opcode for unused lambda

2022-01-09 Thread Ned Batchelder
New submission from Ned Batchelder : This code seems to get a RESUME opcode where no function call is happening: a = 1 fn = lambda 2 b = 3 Here is the disassembly. Offset 6 has a RESUME opcode for line 2: Python 3.11.0a3+ (heads/main:0fc58c1e05, Jan 8 2022, 19:45:58) [Clang

[issue46225] f_lasti behaves differently for lambdas returned from loops

2022-01-09 Thread Ned Batchelder
Ned Batchelder added the comment: Thanks, it does help. While updating coverage.py to use the RESUME information, I found another problem: https://bugs.python.org/issue46314 -- ___ Python tracker <https://bugs.python.org/issue46

[issue46331] 3.11: tracing revisits class line after class docstring

2022-01-10 Thread Ned Batchelder
New submission from Ned Batchelder : See the starred line in the trace output for 3.11: $ cat class_def.py class theClass: ''' the docstring. ''' def __init__(self): ''' Another docstring. ''' self.a = 1 $

[issue46344] 3.11: except/else/if/raise traced incorrectly

2022-01-11 Thread Ned Batchelder
New submission from Ned Batchelder : This code shows a raise inside an except/else/if that isn't run, but incorrectly appears in the trace output (see the * line): $ cat arcs_1160.py def func(x): try: b = 6 except ZeroDivisionError: pass else:

[issue46331] 3.11: tracing revisits class line after class docstring

2022-01-12 Thread Ned Batchelder
Ned Batchelder added the comment: Yes, thanks, this fixes it. -- ___ Python tracker <https://bugs.python.org/issue46331> ___ ___ Python-bugs-list mailin

[issue46314] Stray RESUME opcode for unused lambda

2022-01-12 Thread Ned Batchelder
Ned Batchelder added the comment: This fixes the problems I was seeing, thanks. -- ___ Python tracker <https://bugs.python.org/issue46314> ___ ___ Python-bug

[issue46389] 3.11: unused generator comprehensions cause f_lineno==None

2022-01-15 Thread Ned Batchelder
New submission from Ned Batchelder : In Python 3.11, unused generator comprehensions cause trace events with f_lineno set to None. %< - import linecache, sys def trace(frame, event, arg): # The weird globals here is to avoi

[issue46402] Enhance sqlite3 to avoid implicit creation?

2022-01-16 Thread Ned Batchelder
New submission from Ned Batchelder : The sqlite3 library implicitly creates the database if the requested file doesn't exist. I would like to be able to avoid that implicit creation. (Actually, it would be enough to know whether I had created the database, but the underlying SQLite li

[issue46402] Enhance sqlite3 to avoid implicit creation?

2022-01-17 Thread Ned Batchelder
Ned Batchelder added the comment: @Erlend: thanks for the URI tip, I missed that as a possibility in the SQLite docs. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46402] Enhance sqlite3 to avoid implicit creation?

2022-01-18 Thread Ned Batchelder
Ned Batchelder added the comment: BTW, I'm fine with this being closed, since the functionality I wanted is available and documented. -- ___ Python tracker <https://bugs.python.org/is

[issue42197] Disable automatic update of frame locals during tracing

2022-01-21 Thread Ned Batchelder
Ned Batchelder added the comment: Off the top of my head, I'm not sure this affects coverage.py at all, but I could be missing something. Does PR 23028 have all the changes, or is there some other python/cpython branch I can test

[issue42197] Disable automatic update of frame locals during tracing

2022-01-21 Thread Ned Batchelder
Ned Batchelder added the comment: I ran the coverage.py test suite using https://github.com/faster-cpython/cpython/tree/dont-fast-to-locals-in-trampoline, and there were no failures. -- ___ Python tracker <https://bugs.python.org/issue42

[issue42197] Disable automatic update of frame locals during tracing

2022-01-21 Thread Ned Batchelder
Ned Batchelder added the comment: And btw, the tests with that branch ran at least twice as fast as with 3.10! -- ___ Python tracker <https://bugs.python.org/issue42

[issue46282] return value of builtins is not clearly indicated

2022-02-07 Thread Ned Batchelder
Ned Batchelder added the comment: > When you state the obvious... Obvious to who? New learners coming to Python don't know the same things as people with experience. -- nosy: +nedbat ___ Python tracker <https://bugs.python.org

[issue46282] return value of builtins is not clearly indicated

2022-02-08 Thread Ned Batchelder
Ned Batchelder added the comment: What we're debating here is a micro-cosm of the broader "documentation philosophy" questions that I'm hoping the Documentation WG can iron out. What is "obvious"? Is it obvious that print returns None when file.write does n

[issue46911] Early tracing has lineno=None for modules

2022-03-03 Thread Ned Batchelder
New submission from Ned Batchelder : Coverage.py has a trick to measure the early execution of stdlib modules. It has an "encodings.py" file that sets a trace function, then gets out of the way to let the real encodings.py execute. In 3.11.0a5, that early trace function gets None

[issue46389] 3.11: unused generator comprehensions cause f_lineno==None

2022-03-03 Thread Ned Batchelder
Ned Batchelder added the comment: Yes, this is fixed, thanks. -- ___ Python tracker <https://bugs.python.org/issue46389> ___ ___ Python-bugs-list mailin

[issue46911] Early tracing has lineno=None for modules

2022-03-05 Thread Ned Batchelder
Ned Batchelder added the comment: Maybe I'm missing something during normal execution, but I'm only seeing this effect now during this super-early encodings.py trick. I don't mind just special-casing the Nones in this case. -- ___

[issue13530] Docs for os.lseek neglect to mention what it returns

2011-12-04 Thread Ned Batchelder
New submission from Ned Batchelder : The docs for os.lseek don't make any mention of its return value. I believe it's the new offset in the file, but I'm not sure if there are other subtleties to be mentioned. -- assignee: docs@python components: Documentation messag

[issue13548] Invalid 'line' tracer event on pass within else clause

2011-12-07 Thread Ned Batchelder
Changes by Ned Batchelder : -- nosy: +nedbat ___ Python tracker <http://bugs.python.org/issue13548> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12397] re match object methods have no docstrings

2011-06-24 Thread Ned Batchelder
New submission from Ned Batchelder : If I have a match object in hand, and ask for help on its methods, there is no information: >>> m = re.match("a", "a") >>> help(m.group) Help on built-in function group: group(...) >>> -- messages

[issue11561] "coverage" of Python regrtest cannot see initial import of libs

2011-08-21 Thread Ned Batchelder
Ned Batchelder added the comment: The tip of the coverage.py repo (https://bitbucket.org/ned/coveragepy) has a new implementation of the encodings hack which seems to work well. Of course, an option to run a module before anything else in the interpreter would make the whole thing much

[issue11846] Remove non-guaranteed implementation details from docs.

2011-04-24 Thread Ned Batchelder
Changes by Ned Batchelder : -- nosy: +nedbat ___ Python tracker <http://bugs.python.org/issue11846> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11992] sys.settrace doesn't disable tracing if a local trace function returns None

2011-05-03 Thread Ned Batchelder
New submission from Ned Batchelder : The docs say: The trace function is invoked (with event set to 'call') whenever a new local scope is entered; it should return a reference to a local trace function to be used that scope, or None if the scope shouldn’t be traced. The l

[issue11992] sys.settrace doesn't disable tracing if a local trace function returns None

2011-05-03 Thread Ned Batchelder
Changes by Ned Batchelder : -- assignee: -> nedbat ___ Python tracker <http://bugs.python.org/issue11992> ___ ___ Python-bugs-list mailing list Unsubscri

[issue11065] Fatal "can't locate locale" errors when zip file with directories is on the PYTHONPATH.

2011-01-29 Thread Ned Batchelder
New submission from Ned Batchelder : Run this shell script against 3.2, and it will fail. Against 3.1, it succeeds. I've been running tests on Ubuntu 10.10. mkdir -p sub cat >sub/modzip.py < <http://bugs.python.

[issue11065] Fatal "can't locate locale" errors when zip file with directories is on the PYTHONPATH.

2011-01-29 Thread Ned Batchelder
Ned Batchelder added the comment: With help from ned_deily in #python-dev, we confirmed this is a dup of http://bugs.python.org/issue10955, and is already fixed. -- resolution: -> duplicate ___ Python tracker <http://bugs.python.org/issu

[issue8101] w32-shared-ptr.c assertion on Windows 7 with 2.6.4

2010-03-09 Thread Ned Batchelder
New submission from Ned Batchelder : 2.6.4 had been working fine for me. Today, though, it will not stay up. I run the Django development server on Windows 7, and 2.6.4 is repeatedly crashing on me: This application has requested the Runtime to terminate it in an unusual way. Please contact

[issue8101] w32-shared-ptr.c assertion on Windows 7 with 2.6.4

2010-03-09 Thread Ned Batchelder
Ned Batchelder added the comment: I got it from python.org, the .msi Windows installer: 03/02/10 05:27:37p 14,890,496 \kit\python-2.6.4.msi -- ___ Python tracker <http://bugs.python.org/issue8

[issue8101] w32-shared-ptr.c assertion on Windows 7 with 2.6.4

2010-03-09 Thread Ned Batchelder
Ned Batchelder added the comment: I tried rebooting my PC, but the problem persists. -- ___ Python tracker <http://bugs.python.org/issue8101> ___ ___ Python-bug

[issue8101] w32-shared-ptr.c assertion on Windows 7 with 2.6.4

2010-03-09 Thread Ned Batchelder
Ned Batchelder added the comment: Yup, you're both right! I had a C extension (for coverage.py) built for 2.5 in the 2.6 path. Sorry for the false alarm. -- status: open -> closed ___ Python tracker <http://bugs.python.or

[issue2506] Line tracing of continue after always-taken if is incorrect

2008-03-29 Thread Ned Batchelder
New submission from Ned Batchelder <[EMAIL PROTECTED]>: When tracing line execution with sys.settrace, a particular code structure fails to report an executed line. The line is a continue statement after an if condition in which the if condition is true every time it is executed. Attac

[issue2506] Line tracing of continue after always-taken if is incorrect

2008-03-29 Thread Ned Batchelder
Ned Batchelder <[EMAIL PROTECTED]> added the comment: I see that the cause of the problem is the peephole optimizer. That doesn't mean this isn't a problem. I am measuring the code coverage of a set of tests, and one of my lines is being marked as not executed. This is not

[issue2506] Line tracing of continue after always-taken if is incorrect

2008-03-29 Thread Ned Batchelder
Ned Batchelder <[EMAIL PROTECTED]> added the comment: I recognize that this is an unusual case, but it did come up in the real world. I found this while measuring test coverage, and the continue line was marked as not executed, when it was. I don't understand "when the peephol

[issue2506] Line tracing of continue after always-taken if is incorrect

2008-03-30 Thread Ned Batchelder
Ned Batchelder <[EMAIL PROTECTED]> added the comment: Raymond, do you have a cannon-less recommendation of how to kill this particular mosquito? __ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue2516] Instance methods are misreporting the number of arguments

2008-03-30 Thread Ned Batchelder
Changes by Ned Batchelder <[EMAIL PROTECTED]>: -- nosy: +nedbat __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2516> __ ___ Python-bugs

[issue2506] Line tracing of continue after always-taken if is incorrect

2008-04-01 Thread Ned Batchelder
Ned Batchelder <[EMAIL PROTECTED]> added the comment: It's hard for me to agree with your assessment that for no practical good would come from disabling the optimizer. Broadly speaking, there are two types of code execution: the vast majority of the time, you execute the code so tha

[issue47046] Add `f_state` attribute to FrameObjects.

2022-03-17 Thread Ned Batchelder
Ned Batchelder added the comment: These look great. Currently, coverage.py only tries to distinguish between return/yield, which I guess will now be COMPLETED and SUSPENDED? -- ___ Python tracker <https://bugs.python.org/issue47

[issue47085] missing frame.f_lineno on JUMP_ABSOLUTE

2022-03-21 Thread Ned Batchelder
Change by Ned Batchelder : -- nosy: +Mark.Shannon, nedbat ___ Python tracker <https://bugs.python.org/issue47085> ___ ___ Python-bugs-list mailing list Unsub

[issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used

2022-03-30 Thread Ned Batchelder
New submission from Ned Batchelder : In this code, the same regex is compiled with and without re.VERBOSE. Without, it compiles fine. With, it fails with an "unterminated subpattern" error. list_num_rx1 = r"""(?P\()?(\d+|#|[a-z])(?(paren)\)|\.)"&qu

[issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used

2022-03-30 Thread Ned Batchelder
Ned Batchelder added the comment: I realized my mistake... never mind! -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue17894] Edits to descriptor howto

2019-10-10 Thread Ned Batchelder
Ned Batchelder added the comment: I think it's a bad precedent to have pages in the official docs that belong to a single author. If you want to maintain that kind of control, it should go on your blog. Part of the agreement for having material added to the official docs should b

[issue17894] Edits to descriptor howto

2019-10-10 Thread Ned Batchelder
Change by Ned Batchelder : -- resolution: rejected -> status: closed -> open ___ Python tracker <https://bugs.python.org/issue17894> ___ ___ Python-bugs-

[issue38735] PYTHONPYCACHEPREFIX fails when importing a module from the root ("/")

2019-11-07 Thread Ned Batchelder
New submission from Ned Batchelder : On the manylinux docker images, the current directory is "/". If I create a file there and try to import it with PYTHONPYCACHEPREFIX set, I get a stack trace: $ docker run -it --init --rm -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 bash [root@29

[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2021-03-16 Thread Ned Batchelder
Ned Batchelder added the comment: Is there a reason PEP 626 isn't yet mentioned in https://docs.python.org/3.10/whatsnew/3.10.html ? -- ___ Python tracker <https://bugs.python.org/is

[issue42823] Incorrect frame.f_lineno when frame.f_trace is set

2021-04-04 Thread Ned Batchelder
Change by Ned Batchelder : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue42823> ___ ___ Pyth

[issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators

2021-04-13 Thread Ned Batchelder
Change by Ned Batchelder : -- nosy: +nedbat ___ Python tracker <https://bugs.python.org/issue43833> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-04-26 Thread Ned Batchelder
Ned Batchelder added the comment: Mark, you say: > The traceback for 3.9 is incorrect, the program is not on line 10 when > __exit__ is called. It's kind of not on any line in main(), but line 10 is the most useful line to indicate. It's the last bit of the user's

[issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems

2021-05-01 Thread Ned Batchelder
Ned Batchelder added the comment: I just spent an hour debugging this problem. I don't understand the intricacies of how setup.py is looking for files, but more and more people will have Catalina and the issue this presents. I can confirm that Andrew's suggestion works. Can w

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-01 Thread Ned Batchelder
Ned Batchelder added the comment: I'm trying to see if these changes affect coverage.py, but pytest 6.2.3 fails with: === CPython 3.10.0a7+ (rev 558df90109) with Python tracer (.tox/anypy/bin/python) === ImportError while loading conftest '/Users/nedbatchelder/coverage/t

[issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems

2021-05-01 Thread Ned Batchelder
Change by Ned Batchelder : -- keywords: +patch pull_requests: +24475 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25785 ___ Python tracker <https://bugs.python.org/issu

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Ned Batchelder
Ned Batchelder added the comment: Thanks, tip of pytest works for me. Is this error going to happen for everyone testing with 3.10b1? If so, can we get a release of pytest? -- ___ Python tracker <https://bugs.python.org/issue43

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Ned Batchelder
Ned Batchelder added the comment: The pytest failure still happens with 3.10.0b1 and pytest 6.2.3. I'm asking if pytest can make a release to update. -- ___ Python tracker <https://bugs.python.org/is

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Ned Batchelder
Ned Batchelder added the comment: Mark, I'm not clear if the line number can still be None in some circumstances. With this code (from site.py in the stdlib): 545: def execsitecustomize(): 546: """Run custom site specific code, if available."""

[issue44088] traced line number can be None

2021-05-09 Thread Ned Batchelder
New submission from Ned Batchelder : Mark, I'm not clear if the line number can still be None in some circumstances. With this code (from site.py in the stdlib): 545: def execsitecustomize(): 546: """Run custom site specific code, if available."""

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-11 Thread Ned Batchelder
Ned Batchelder added the comment: BTW, I created a separate issue about this: https://bugs.python.org/issue44088 because I wasn't sure if I should continue on this one, sorry. Feel free to close either one. -- ___ Python tracker &

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-13 Thread Ned Batchelder
Ned Batchelder added the comment: Thanks, this fixes my issue. -- ___ Python tracker <https://bugs.python.org/issue43933> ___ ___ Python-bugs-list mailin

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Ned Batchelder
New submission from Ned Batchelder : Python 3.10 now traces back to with statements when exiting the with block. When the exit is a break statement, the with exit is visited before the break statement is. This seems confusing. --- 8< - imp

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Ned Batchelder
Ned Batchelder added the comment: (I'm not sure whether to create other issues for further details) I'm also seeing a return in a with will trace withexit/return for a plain "return" statement, but return/withexit/return for a return with a value ("return 17&

[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Ned Batchelder
Ned Batchelder added the comment: Thanks for the quick turnaround, this works! -- ___ Python tracker <https://bugs.python.org/issue44298> ___ ___ Python-bug

[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Ned Batchelder
Change by Ned Batchelder : -- nosy: +nedbat ___ Python tracker <https://bugs.python.org/issue6> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44450] Generator expressions trace differently on Windows than on Mac

2021-06-18 Thread Ned Batchelder
New submission from Ned Batchelder : Here is a trace involving generator expressions. Using 3.10.0b3 on Mac, there are "line" events within the expression. Those events are missing on Windows. --- 8< --- import linecache, sys def trace(fram

[issue44450] Generator expressions trace differently on Windows than on Mac

2021-06-19 Thread Ned Batchelder
Ned Batchelder added the comment: This happens with all the 3.10 betas, and does not happen in 3.9 and earlier: https://github.com/nedbat/coveragepy/runs/2864611225 (Sorry, other failures with earlier 3.10 betas obscured the mac/win difference

[issue44450] Generator expressions trace differently on Windows than on Mac

2021-06-21 Thread Ned Batchelder
Ned Batchelder added the comment: I tried adding that rewritten doit as a new test, and it does not show a mac/win difference on 3.9. In fact, it doesn't show a mac/win difference on 3.10! https://github.com/nedbat/coveragepy/actions/runs/9567

[issue44450] Generator expressions trace differently on Windows than on Mac

2021-06-21 Thread Ned Batchelder
Ned Batchelder added the comment: This was with 3.10.0b3. I haven't got a way (yet) to build with my own-built versions of CPython. -- ___ Python tracker <https://bugs.python.org/is

[issue44570] 3.10.0b3 doesn't trace line events for return in some cases

2021-07-05 Thread Ned Batchelder
New submission from Ned Batchelder : (from https://github.com/nedbat/coveragepy/issues/1184) This code runs the return statement on line 17 twice. The second time, there is a "line" event and then a "return" event for that line. But the first time, there is only a &q

[issue44570] 3.10.0b3 doesn't trace line events for return in some cases

2021-07-08 Thread Ned Batchelder
Ned Batchelder added the comment: I can confirm that those two pull requests fix the problem reported here. -- ___ Python tracker <https://bugs.python.org/issue44

[issue44600] match/case statements trace incorrectly in 3.10.0b4

2021-07-11 Thread Ned Batchelder
New submission from Ned Batchelder : Some simple match/case statements show incorrect tracing. Below is the code to run, as well as the output. Output lines with initial stars are incorrect: they incorrectly indicate that case bodies are executing when they are not. Sorry for the bulk here

[issue44616] Incorrect tracing for "except" with variable

2021-07-12 Thread Ned Batchelder
New submission from Ned Batchelder : This construct isn't traced properly: except ExceptionName as var: if something: raise Here's a reproducer: -- 8< - import linecache, sys def trace(frame, event, arg): # The weird

[issue44616] Incorrect tracing for "except" with variable

2021-07-12 Thread Ned Batchelder
Ned Batchelder added the comment: Based on https://github.com/nedbat/coveragepy/issues/1187, btw -- ___ Python tracker <https://bugs.python.org/issue44

[issue44621] Python 3.9 traces async for/else incorrectly

2021-07-13 Thread Ned Batchelder
New submission from Ned Batchelder : Python 3.9 traces this code incorrectly. Note: 3.8 and 3.10 are correct, only 3.9 gets it wrong. --- import linecache, sys def trace(frame, event, arg): # The weird globals here is to avoid a NameError on shutdown

[issue44621] Python 3.9 traces async for/else incorrectly

2021-07-13 Thread Ned Batchelder
Ned Batchelder added the comment: The corresponding coverage.py issue: https://github.com/nedbat/coveragepy/issues/1158 -- ___ Python tracker <https://bugs.python.org/issue44

[issue44622] async-for loops are traced incorrectly in Python 3.10

2021-07-13 Thread Ned Batchelder
New submission from Ned Batchelder : In Python 3.10, the traces at the end of an async-for loop are incorrect and different than at the end of a for-loop. -- import linecache, sys def trace(frame, event, arg): # The weird globals here is to avoid a NameError

[issue44626] Incorrect tracing of nested if/if/for/yield

2021-07-13 Thread Ned Batchelder
New submission from Ned Batchelder : In Python 3.10, this code is traced incorrectly. I don't know if there's a simpler format that would show the problem. This code is already simplified from https://github.com/nedbat/coveragepy/issues/1188. -- import

[issue44626] Incorrect tracing of nested if/if/for/yield

2021-07-14 Thread Ned Batchelder
Ned Batchelder added the comment: The original reporter of the coverage.py issue says they have a simpler reproducer: https://github.com/nedbat/coveragepy/issues/1188#issuecomment-879572874 -- ___ Python tracker <https://bugs.python.

[issue44616] Incorrect tracing for "except" with variable

2021-07-15 Thread Ned Batchelder
Ned Batchelder added the comment: Barry, is it possible you accidentally used the beta 4? I ran the test suite with a freshly built 3.10, but by mistake was still using the beta, and was surprised. Once I really got the latest build in place (Python 3.10.0b4+ (heads/3.10:47695e3c88, Jul

[issue44672] Final "pass" is traced incorrectly in 3.9 (and before)

2021-07-19 Thread Ned Batchelder
New submission from Ned Batchelder : A simple function with a last "pass" statement gets traced incorrectly, attributing the return to the pass instead of the actual last statement executed: --- 8< -- import linecache, sys def trace(frame, event, ar

[issue44672] Final "pass" is traced incorrectly in 3.9 (and before)

2021-07-19 Thread Ned Batchelder
Ned Batchelder added the comment: This is the right call. Thanks! -- ___ Python tracker <https://bugs.python.org/issue44672> ___ ___ Python-bugs-list mailin

[issue44621] Python 3.9 traces async for/else incorrectly

2021-07-19 Thread Ned Batchelder
Ned Batchelder added the comment: @lukasz.langa, I guess this 3.9 tracing bug should also be closed as wont-fix? -- ___ Python tracker <https://bugs.python.org/issue44

[issue44840] Nested if/else gets phantom else trace again (3.10)

2021-08-05 Thread Ned Batchelder
New submission from Ned Batchelder : Note: this is very similar to https://bugs.python.org/issue42810 This was originally reported against coverage.py: https://github.com/nedbat/coveragepy/issues/1205 ---8<- import linecache, sys def trace(frame, event, arg): # The we

[issue44840] Nested if/else gets phantom else trace again (3.10)

2021-08-09 Thread Ned Batchelder
Ned Batchelder added the comment: This fix looks good, thanks. -- ___ Python tracker <https://bugs.python.org/issue44840> ___ ___ Python-bugs-list mailin

[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Ned Batchelder
Change by Ned Batchelder : -- nosy: -nedbat ___ Python tracker <https://bugs.python.org/issue45020> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44450] Generator expressions trace differently on Windows than on Mac

2021-08-31 Thread Ned Batchelder
Ned Batchelder added the comment: Looks like this is fixed with 3.10.0rc1, thanks. -- ___ Python tracker <https://bugs.python.org/issue44450> ___ ___ Python-bug

[issue45709] 3.11 regression: tracing with-statement on exit from block

2021-11-04 Thread Ned Batchelder
New submission from Ned Batchelder : Python 3.11 seems to have reverted a behavior that was new in 3.10.0b1: exiting a with-statement re-visits the with line on the way out. --- %< bug2.py -- import linecache, sys def trace(frame, event, arg): # The weird glob

[issue45709] 3.11 regression: tracing with-statement on exit from block

2021-11-04 Thread Ned Batchelder
Ned Batchelder added the comment: BTW, this is the coverage.py issue: https://github.com/nedbat/coveragepy/issues/1270 -- ___ Python tracker <https://bugs.python.org/issue45

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

2021-11-10 Thread Ned Batchelder
Ned Batchelder added the comment: I went ahead and changed the coverage.py code to this: #if PY_VERSION_HEX >= 0x030B00A0 // 3.11 moved f_lasti into an internal structure. This is totally the wrong way // to make this work, but it's all I've got until https://bugs.python.org/iss

[issue45709] 3.11 regression: tracing with-statement on exit from block

2021-11-21 Thread Ned Batchelder
Ned Batchelder added the comment: I can confirm that this fixes the problem. -- ___ Python tracker <https://bugs.python.org/issue45709> ___ ___ Python-bug

[issue39114] Python 3.9.0a2 changed how finally/return is traced

2019-12-21 Thread Ned Batchelder
New submission from Ned Batchelder : The way trace function reports return-finally has changed in Python 3.9.0a2. I don't know if this change is intentional or not. (BTW: I want to put a 3.9regression keyword on this, but it doesn't exist.) Consider this co

  1   2   3   4   >