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

[pantsd] Improve environment unicode handling. #6031

Merged
merged 2 commits into from Jun 26, 2018

Conversation

Projects
None yet
3 participants
@kwlzn
Copy link
Member

kwlzn commented Jun 26, 2018

Repairs #6030

@kwlzn kwlzn requested a review from stuhood Jun 26, 2018

@stuhood
Copy link
Member

stuhood left a comment

Thanks!

@@ -48,6 +48,16 @@ def get_joined_path(new_entries, env=None, env_var='PATH', delimiter=':', prepen
return delimiter.join(path_dirs)


def _os_encode(u, enc=sys.getfilesystemencoding()):

This comment has been minimized.

@stuhood

stuhood Jun 26, 2018

Member

Is using sys.getfilesystemencoding preferred to specifying UTF8 explicitly?

This comment has been minimized.

@kwlzn

kwlzn Jun 26, 2018

Member

its definitely more correct and portable - but for our target platforms (OSX/Linux) it's usually always utf-8.

This comment has been minimized.

@kwlzn

kwlzn Jun 26, 2018

Member

could make sense to make these two helpers public and drop them in pants.util.unicode for general use, too.

This comment has been minimized.

@stuhood

stuhood Jun 26, 2018

Member

I think that since this is ENV specific, this is probably reasonable for now...

@@ -76,6 +86,10 @@ def setenv(key, val):
setenv(key, val)


def _copy_env(env):

This comment has been minimized.

@stuhood

stuhood Jun 26, 2018

Member

I don't think decoding is idempotent, so this method will only work the first time you call it? In which case, maybe call it _decode_and_copy_env or something, so that somebody doesn't try to use it to just copy.

This comment has been minimized.

@kwlzn

kwlzn Jun 26, 2018

Member

fixed

@stuhood stuhood added this to the 1.8.x milestone Jun 26, 2018

@stuhood

This comment has been minimized.

Copy link
Member

stuhood commented Jun 26, 2018

Optimistically landing based on the first CI.

@stuhood stuhood merged commit c5e0102 into pantsbuild:master Jun 26, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details

stuhood added a commit that referenced this pull request Jun 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment