You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
f_lineno has different results on Windows and Linux #125422
On Windows 10, f_lineno is 1. On WSL (Ubuntu 20), it is 611. I don't see any mention of cross-platform differences called out in the bdb docs, so I'm wondering if this is a bug.
importbdbf= {}
classareplDebug(bdb.Bdb):
# overridedefuser_line(self,frame):
globalff=frameb=areplDebug()
b.run('x=1+5',{},{})
print('frame lineno is '+str(f.f_lineno)) # 611 on Linux, 1 on Windows importlinecacheline=linecache.getline(f.f_code.co_filename, f.f_lineno)
print('frame file is: '+f.f_code.co_filename) # '/home/almenon/.pyenv/versions/3.12.7/lib/python3.12/bdb.py' on Linux, `<string>` on windowsprint('frame line is: '+line) # ' sys.settrace(None)\n' on Linux, None on Windows
Not all changes were listed on whatsnew :) Sometimes the changes were not user visible, or not important enough to make it (there are a lot of commits to stdlib in a version). This is not super serious but it is something we should fix. I'll work on it.
Activity
Almenon commentedon Oct 14, 2024
Another thing I should mention is that Python 3.8 through 3.11 all pass the unit tests in Linux (i.e.
f_linenois 1)No changes to bdb are mentioned in https://docs.python.org/3/whatsnew/3.12.html, so it's weird that the behavior would change with 3.12
gaogaotiantian commentedon Oct 14, 2024
Not all changes were listed on whatsnew :) Sometimes the changes were not user visible, or not important enough to make it (there are a lot of commits to stdlib in a version). This is not super serious but it is something we should fix. I'll work on it.
Almenon commentedon Oct 14, 2024
oh cool, it's an actual bug? This is the first bug I've found in Python :D
What should the desired behavior be? I'm not sure if 611 is correct or 1
gaogaotiantian commentedon Oct 14, 2024
It should be
1.611is frombdb.pyand the user should not receive any events frombdb.py.gh-125422: Don't set the caller's f_trace if it's botframe (#125427)
pythongh-125422: Don't set the caller's f_trace if it's botframe (pyt…
pythongh-125422: Don't set the caller's f_trace if it's botframe (pyt…
[3.12] gh-125422: Don't set the caller's f_trace if it's botframe (GH…
[3.13] gh-125422: Don't set the caller's f_trace if it's botframe (GH…
gaogaotiantian commentedon Oct 15, 2024
Thank you for reporting this, it's fixed in #125427.