Skip to content

Issue with rewriting the environment variables #156

@guy-asaert

Description

@guy-asaert

Hi,

I encountered a problem with the logic that steps through the environment variables and rewrites them to the system. The issue is that there is an environment variable where the value contains an = character. The rewrite process truncates the value after the second =.

E.g. :

ENV1=A=3;B=5;C=6

becomes

ENV1=A

The code in question is located here:

keyval = p[start:end].decode(locale.getpreferredencoding()).split('=')

The fix should be really easy.

Instead of

keyval = p[start:end].decode(locale.getpreferredencoding()).split('=')

use

keyval = p[start:end].decode(locale.getpreferredencoding()).split('=', 1)

to ensure we only split on the first =.

Thanks and keep up the good work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions