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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
$
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:
Ned Batchelder added the comment:
Yes, thanks, this fixes it.
--
___
Python tracker
<https://bugs.python.org/issue46331>
___
___
Python-bugs-list mailin
Ned Batchelder added the comment:
This fixes the problems I was seeing, thanks.
--
___
Python tracker
<https://bugs.python.org/issue46314>
___
___
Python-bug
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
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
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
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
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
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
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
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
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
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
Ned Batchelder added the comment:
Yes, this is fixed, thanks.
--
___
Python tracker
<https://bugs.python.org/issue46389>
___
___
Python-bugs-list mailin
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.
--
___
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
Changes by Ned Batchelder :
--
nosy: +nedbat
___
Python tracker
<http://bugs.python.org/issue13548>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
Changes by Ned Batchelder :
--
nosy: +nedbat
___
Python tracker
<http://bugs.python.org/issue11846>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Changes by Ned Batchelder :
--
assignee: -> nedbat
___
Python tracker
<http://bugs.python.org/issue11992>
___
___
Python-bugs-list mailing list
Unsubscri
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.
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
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
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
Ned Batchelder added the comment:
I tried rebooting my PC, but the problem persists.
--
___
Python tracker
<http://bugs.python.org/issue8101>
___
___
Python-bug
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
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
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
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
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
Changes by Ned Batchelder <[EMAIL PROTECTED]>:
--
nosy: +nedbat
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2516>
__
___
Python-bugs
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
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
Change by Ned Batchelder :
--
nosy: +Mark.Shannon, nedbat
___
Python tracker
<https://bugs.python.org/issue47085>
___
___
Python-bugs-list mailing list
Unsub
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
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
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
Change by Ned Batchelder :
--
resolution: rejected ->
status: closed -> open
___
Python tracker
<https://bugs.python.org/issue17894>
___
___
Python-bugs-
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
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
Change by Ned Batchelder :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue42823>
___
___
Pyth
Change by Ned Batchelder :
--
nosy: +nedbat
___
Python tracker
<https://bugs.python.org/issue43833>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
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."""
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."""
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
&
Ned Batchelder added the comment:
Thanks, this fixes my issue.
--
___
Python tracker
<https://bugs.python.org/issue43933>
___
___
Python-bugs-list mailin
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
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&
Ned Batchelder added the comment:
Thanks for the quick turnaround, this works!
--
___
Python tracker
<https://bugs.python.org/issue44298>
___
___
Python-bug
Change by Ned Batchelder :
--
nosy: +nedbat
___
Python tracker
<https://bugs.python.org/issue6>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
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
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
Ned Batchelder added the comment:
Based on https://github.com/nedbat/coveragepy/issues/1187, btw
--
___
Python tracker
<https://bugs.python.org/issue44
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
Ned Batchelder added the comment:
The corresponding coverage.py issue:
https://github.com/nedbat/coveragepy/issues/1158
--
___
Python tracker
<https://bugs.python.org/issue44
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
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
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.
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
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
Ned Batchelder added the comment:
This is the right call. Thanks!
--
___
Python tracker
<https://bugs.python.org/issue44672>
___
___
Python-bugs-list mailin
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
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
Ned Batchelder added the comment:
This fix looks good, thanks.
--
___
Python tracker
<https://bugs.python.org/issue44840>
___
___
Python-bugs-list mailin
Change by Ned Batchelder :
--
nosy: -nedbat
___
Python tracker
<https://bugs.python.org/issue45020>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ned Batchelder added the comment:
Looks like this is fixed with 3.10.0rc1, thanks.
--
___
Python tracker
<https://bugs.python.org/issue44450>
___
___
Python-bug
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
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
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
Ned Batchelder added the comment:
I can confirm that this fixes the problem.
--
___
Python tracker
<https://bugs.python.org/issue45709>
___
___
Python-bug
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 - 100 of 311 matches
Mail list logo