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

#1526-fix sed issues on MAC OS X #1527

Closed
wants to merge 1 commit into from

Conversation

doflink
Copy link

@doflink doflink commented Nov 9, 2016

fixes #1526 1526
I have tested with python 2.7.10

@ploxiln
Copy link

ploxiln commented Feb 4, 2017

    platform = run("uname")
    print("platform=%r" % platform)

shows exactly platform='Darwin' for me, on OS X 10.11.6, what does it show for you?

@bitprophet
Copy link
Member

bitprophet commented Feb 19, 2017

Same here on Sierra (10.12.3) re: it still just being "Darwin". Not sure what else would be causing this PR to make the functionality work, though. Extra whitespace? We'll definitely need to see what @doflink's uname looks like :)

@doflink
Copy link
Author

doflink commented Feb 20, 2017

Hi,
when I convert platform to string and print out, it shows also "Darwin". However, when I write it to a file, it shows "^[(B^[[mDarwin". There is a special character in front of "Darwin" in my case.
Thanks.

@bitprophet
Copy link
Member

Likely some shell related artifact, since the value comes out of a run('uname'). Wonder if trying harder to avoid that in the run() (e.g. use_shell=False or similar; or stripping nonprinting characters; etc) is more appropriate than the in test; honestly not sure. It's not like a system with Darwin in its uname that is not OS X is likely at all...

@ploxiln
Copy link

ploxiln commented Feb 21, 2017

It does look like something is adding some terminal escape codes - running without shell and/or pty is a good idea to try. (I'm pretty sure "uname" itself never does that, unless "uname" on your system is something besides the stock /usr/bin/uname).

run("uname", shell=False, pty=False)

Maybe also make sure the output of which uname is /usr/bin/uname.

@doflink
Copy link
Author

doflink commented Mar 1, 2017

I agree. Your solution is much better.

@bitprophet bitprophet closed this Mar 2, 2017
bitprophet added a commit that referenced this pull request Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants