Skip to content

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

@emillynge

Description

@emillynge

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions