Skip to content

os: Fix open keyword arguments #2594

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

Merged
merged 1 commit into from
Apr 26, 2021
Merged

os: Fix open keyword arguments #2594

merged 1 commit into from
Apr 26, 2021

Conversation

deantvv
Copy link
Contributor

@deantvv deantvv commented Apr 25, 2021

Following code used to fail due to the way used to define
os.open in rust. To fix this, we need to use FromArgs
to define struct OpenArgs {...}.

f = os.open(path=__file__, flags=os.O_RDONLY, mode=0o777, dir_fd=None)

Noted that the original open is now rename to rust_open
and is also exported. The only usage of rust_open is only in io.rs.

Related to #1175

Following code used to fail due to the way used to define
os.open in rust. To fix this, we need to use `FromArgs`
to define `struct OpenArgs {...}`.
```
f = os.open(path=__file__, flags=os.O_RDONLY, mode=0o777, dir_fd=None)
```

Noted that the original `open` is now rename to `os_open`
and is exported as `open`.

Related to #1175
@coolreader18 coolreader18 merged commit d226cb8 into RustPython:master Apr 26, 2021
@coolreader18
Copy link
Member

Thanks!

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.

3 participants