Skip to content
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

feat(os): closes #24655 #24656

Open
wants to merge 7 commits into
base: devel
Choose a base branch
from
Open

Conversation

litlighilit
Copy link
Contributor

@litlighilit litlighilit commented Jan 29, 2025

closes #24655

  • getHomeDir(username)
  • expandTilde supports "~bob".

@litlighilit litlighilit force-pushed the lit-impr-os branch 2 times, most recently from 5d668e1 to aff357e Compare January 31, 2025 13:10
@litlighilit
Copy link
Contributor Author

litlighilit commented Feb 6, 2025

ping @Araq
or the new getHomeDir variant shall be renamed?

@Araq
Copy link
Member

Araq commented Feb 14, 2025

The code is ugly.

@litlighilit
Copy link
Contributor Author

but that's how CPython implemented it (if you refer to body of getHomeDir(username: string)?)

@Araq
Copy link
Member

Araq commented Feb 15, 2025

Why would I care how CPython does things... We need to live with this code for good, so clean it up so that the control flow doesn't look like it came from hell.

@litlighilit
Copy link
Contributor Author

Why would I care how CPython does things...

Sure. I just mean there's an implementation doing so, which has alreadly reviewed by many contributors


clean it up so that the control flow doesn't look like it came from hell.

If referring to the condition compile branch,
I never wanna make it a hell either... But it's the fact that:

  1. some posix like Mac lacks SC_GETPW_R_SIZE_MAX
  2. some platform lacks dynamic memory allocate functions.

Also I used to have a try but have no idea.
Pointing out which part requires amend would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

os.expandTilde "~user" support
2 participants