Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

f_lineno has different results on Windows and Linux #125422

Copy link
Copy link
Closed
@Almenon

Description

@Almenon
Issue body actions

Bug report

Bug description:

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.

import bdb

f = {}

class areplDebug(bdb.Bdb):
    # override
    def user_line(self,frame):
        global f
        f = frame

b = areplDebug()
b.run('x=1+5',{},{})

print('frame lineno is ' + str(f.f_lineno)) # 611 on Linux, 1 on Windows 
import linecache
line = 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 windows
print('frame line is: ' + line) # '            sys.settrace(None)\n' on Linux, None on Windows

It's not a WSL-specific issue because I'm getting the same error in Github CI. See https://github.com/Almenon/AREPL-backend/actions/runs/11316437382/job/31468723754?pr=193

Reproduction:
Checkout https://github.com/Almenon/AREPL-backend/tree/8aab53e834be9ec4c1a41de08831107446051bc5. Then:

cd AREPL-backend/python
python -m pip install -r requirements.txt
pytest

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Labels

3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.