Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

f_lineno has different results on Windows and Linux #125422

Closed
Assignees
gaogaotiantian
Labels
3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@Almenon

Description

@Almenon

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 thebdb 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 Windowsimportlinecacheline=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

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

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

cd AREPL-backend/pythonpython -m pip install -r requirements.txtpytest

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Labels

3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp