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

Need to set locale env variable for python3 package recipes #703

Closed
emillynge opened this issue Apr 11, 2016 · 1 comment
Closed

Need to set locale env variable for python3 package recipes #703

emillynge opened this issue Apr 11, 2016 · 1 comment

Comments

@emillynge
Copy link

When calling python3.5 setup.py using sh.py, the setup can fail because the spawned process doesn't correctly set the locale to use UTF-8.

In the case of plyer, a changelog is read during setup that contains non-ascii symbols. Without correct locale, the python interpreter will try to decode the file upon open('changelog.md') using ascii codec and raise an exception.

Setting the LANG enviroment variable to system locale solves the issue.

class PlyerRecipe(PythonRecipe):
    version = '1.2.5dev'
    url = 'https://github.com/emillynge/plyer/archive/browser.tar.gz'
    depends = ['pyjnius', 'python3crystax']

    def get_recipe_env(self, *args, **kwargs):
        env = super().get_recipe_env(*args, **kwargs)
        env['LANG'] = "en_GB.UTF-8"
        return env

Maybe this environment variable should be set by default by PythonRecipe?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@inclement
Copy link
Member

I don't see a problem with doing this, but I'll leave it a little while in case anyone raises any issues as I've seen this kind of encoding setting have unexpected side effects before.

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

No branches or pull requests

2 participants