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

gh-122170: Fix interpreter exiting due to ValueError fromos.stat for too long filename on Windows#122175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

devdanzin
Copy link
Contributor

@devdanzindevdanzin commentedJul 23, 2024
edited by bedevere-appbot
Loading

This PR fixes the interpreter exiting on Windows in 3.13.0b4 and main due toValueError: stat: path too long for Windows being raised byos.stat() inupdatecache() in linecache.py when trying to print a traceback with a too long filename.

Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

checkcache is may also be subject to the same issue (it callsos.stat).

You can pick what I wrote here:405a921

@@ -98,7 +98,7 @@ def updatecache(filename, module_globals=None):
fullname = filename
try:
stat = os.stat(fullname)
except OSError:
except(OSError, ValueError):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This one should not be suppressed on Unix platforms.

@@ -280,6 +280,10 @@ def test_loader(self):
self.assertEqual(linecache.getlines(filename, module_globals),
['source for x.y.z\n'])

@unittest.skipUnless(support.MS_WINDOWS, "Test only relevant in Windows.")
def test_filename_too_long(self):
self.assertEqual(linecache.updatecache("s" * 999999), [])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Also checkcheckcache (which I forgot on my branch).

@devdanzin
Copy link
ContributorAuthor

Closing due to@picnixz's version being more complete and polished, thanks!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@picnixzpicnixzpicnixz left review comments

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@devdanzin@picnixz

[8]ページ先頭

©2009-2025 Movatter.jp