◐ Shell
reader mode source ↗
Skip to content

bpo-45944: Avoid calling isatty() for most open() calls#29870

Closed
collinanderson wants to merge 2 commits into
python:mainfrom
collinanderson:45944
Closed

bpo-45944: Avoid calling isatty() for most open() calls#29870
collinanderson wants to merge 2 commits into
python:mainfrom
collinanderson:45944

Conversation

@collinanderson

@collinanderson collinanderson commented Dec 1, 2021

Copy link
Copy Markdown

https://bugs.python.org/issue45944

isatty() is a system call on linux. Most open()s are files, and we're already getting the size of the file. If it has a size, then we know it's not a atty, and can avoid calling it.

https://bugs.python.org/issue45944

@tiran tiran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

That's a clever hack!

I made a few suggestions to use correct Py_ssize_t everwhere.

@github-actions

github-actions Bot commented Jan 1, 2022

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Jan 1, 2022
@eendebakpt

Copy link
Copy Markdown
Contributor

@collinanderson The PR has gone stale. Can you address the review comments? Or are you ok will someone else picking this up?

@bedevere-app

bedevere-app Bot commented Nov 28, 2023

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@cmaloney

cmaloney commented Oct 8, 2024

Copy link
Copy Markdown
Contributor

I think this can be closed now as a fix for bpo-45944 / gh-90102 has been committed and the issue closed out

@skirpichev

Copy link
Copy Markdown
Member

(And there is no signs of life anyway...)

@skirpichev skirpichev closed this Oct 8, 2024
@collinanderson

collinanderson commented Oct 8, 2024

Copy link
Copy Markdown
Author

Ohh awesome. Thank you! Yeah Sorry I'm not much of a C programmer. I'm super excited to see #120754 syscalls being optimized.

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

Labels

awaiting review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants