-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
os.getlogin() fails with OSError: [Errno 34] for usernames > 9 characters #135497
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
@alebcay would you like to submit a PR with the fix? |
Sure, I'd be happy to. |
alebcay
added a commit
to alebcay/cpython
that referenced
this issue
Jun 14, 2025
alebcay
added a commit
to alebcay/cpython
that referenced
this issue
Jun 14, 2025
alebcay
added a commit
to alebcay/cpython
that referenced
this issue
Jun 14, 2025
alebcay
added a commit
to alebcay/cpython
that referenced
this issue
Jun 14, 2025
picnixz
pushed a commit
that referenced
this issue
Jun 14, 2025
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 14, 2025
…GH-135508) (cherry picked from commit 2e15a50) Co-authored-by: Caleb Xu <calebcenter@live.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 14, 2025
…GH-135508) (cherry picked from commit 2e15a50) Co-authored-by: Caleb Xu <calebcenter@live.com>
This was referenced Jun 14, 2025
Thank you for the report & the fix! |
shuimu5418
pushed a commit
to shuimu5418/cpython001
that referenced
this issue
Jun 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
It appears that if Python is compiled in an environment without
HAVE_MAXLOGNAME
but withHAVE_UT_NAMESIZE
,getlogin_r
will return error 34 if username is >9 characters.This appears to be a regression introduced in #132751:
https://github.com/duaneg/cpython/blob/675342cf59ffe53337d92af989b97dad687a10ea/configure.ac#L5434
The correct header file to search for is
sys/param.h
, notsys/params.h
. As a result,HAVE_UT_NAMESIZE
is satisfied (viautmp.h
) butHAVE_MAXLOGNAME
is not.This was originally reported to Homebrew via Homebrew/homebrew-core#226857.
CPython versions tested on:
3.15
Operating systems tested on:
macOS
Linked PRs
MAXLOGNAME
detection inconfigure.ac
(GH-135508) #135516MAXLOGNAME
detection inconfigure.ac
(GH-135508) #135517The text was updated successfully, but these errors were encountered: