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

os.environ.setdefault does not work #583

Closed
Real-Gecko opened this issue Aug 27, 2024 · 3 comments · May be fixed by #585
Closed

os.environ.setdefault does not work #583

Real-Gecko opened this issue Aug 27, 2024 · 3 comments · May be fixed by #585

Comments

@Real-Gecko
Copy link

Creating test file

# test.py
import os

os.environ.setdefault("lala", "tralala")

Running with codon

$ codon run test.py
test.py:3:1-41: error: 'EnvMap' object has no attribute 'setdefault'
$ codon build -release -exe test.py
test.py:3:1-41: error: 'EnvMap' object has no attribute 'setdefault'
@avitkauskas
Copy link

Codon has very limited native os module implementation yet.
I sent a PR to implement this particular functionality.

Meanwhile, you can use python module:

from python import os

os.environ.setdefault("lala", "tralala")

@inumanag
Copy link
Contributor

Hi @Real-Gecko ,

Yes, @avitkauskas is right---our os.environ implementation is pretty bare-bones at the moment. I'd also second using from python import for now.

@inumanag
Copy link
Contributor

Merging into #608 .

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 a pull request may close this issue.

3 participants