-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Bug fix/fix error handling #1925
Conversation
… write() argument must be str, not bytes`. It seems to me that its unneccesary, and it should simply throw the exception instead.
…hrow: `Exception: 'NoneType' object is not subscriptable`.
fixed by the 3rd commit. |
I am +1 if we are sure these changes are compatible with both Py2 and Py3. |
doesn't error out with python 2 on debian testing. |
@dothebart what's the situation that's causing this error to be experienced? how could we go about reproducing it? |
@rvagg I was putting in the complete directory as But if its not supported to have absolute paths on filenames, gyp should rather error out; If I get it correctly it needs them relative to the location of the gyp-file - so 'stat' ing files, and ruling out absolute paths could keep people from running into misery. [edit - wrong issue, will create an issue for this one] |
one of these issues was caused by a sub process erroring out - here due to non-python3-ness:
so probably invoking the other one was caused by this section in
in this context: |
sounds reasonable, @cclauss over to you I think |
gyp/pylib/gyp/input.py
Outdated
@@ -911,9 +911,7 @@ def ExpandVariables(input, phase, variables, build_file): | |||
p_stdout, p_stderr = p.communicate('') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, my preference would be the solution we use elsewhere:
if bytes != str: # Python 3
p_stdout = p_stdout.decode('utf-8')
p_stderr = p_stderr.decode('utf-8')
And then revert the change to line 914.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cclauss if you think this is important enough please take over the PR, submit a new one or whatever needs to be done so we can progress and get 6.0.1 out. If it's not that important then we'll just hold off on it. |
Sorry bit under stress @cclauss sent you an invite to my fork so you can make yourselves home ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made two reverts to this PR and now I fully support the remaining modifications. Thanks @dothebart for your patience and persistence.
thanks for finishing where I left it ;) |
@rvagg Can you please rerun the one Travis CI job that timed out? |
I've restarted it. |
PR-URL: #1925 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
landed in 1b11be6. I hope the commit msg is reasonable: |
thank you! |
PR-URL: #1925 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
these 3 changes seem to be related to the python 3 migration, the parameter types aren't compatible.
sys.stderr.write(p_stderr)
will throw with:TypeError: write() argument must be str, not bytes
; the followup comment references python 2.5, raising the error gives the correct behaviour.I ran into this error by a gyp line spawning a process exiting errnously.
The
None
as a parameter to eval__builtins__
leads to the exceptionException: 'NoneType' object is not subscriptable
.