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 |
| @@ -911,9 +911,7 @@ def ExpandVariables(input, phase, variables, build_file): | |||
| p_stdout, p_stderr = p.communicate('') | |||
There was a problem hiding this comment.
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.
|
@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 ;) |
cclauss
left a comment
There was a problem hiding this comment.
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
Noneas a parameter to eval__builtins__leads to the exceptionException: 'NoneType' object is not subscriptable.