Skip to content

Commit

Permalink
jobserver.py: fix very rare python3 failure reported by a user.
Browse files Browse the repository at this point in the history
Traceback (most recent call last):
  File "/nix/store/i0835myyhrfr13lh4y26r58406kk90xj-redo-apenwarr-0.42a/bin/../lib/redo/cmd_ifchange.py", line 54, in main
    jobserver.force_return_tokens()
  File "/nix/store/i0835myyhrfr13lh4y26r58406kk90xj-redo-apenwarr-0.42a/bin/../lib/redo/jobserver.py", line 482, in force_return_tokens
    os.write(_cheatfds[1], 't' * _cheats)
TypeError: a bytes-like object is required, not 'str'

Unfortunately I wasn't able to replicate it, but this is obviously the right fix.
  • Loading branch information
apenwarr committed Jun 15, 2020
1 parent c1054a5 commit aa920f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redo/jobserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def force_return_tokens():
_debug('%d,%d -> force_return_tokens: recovering final token\n'
% (_mytokens, _cheats))
_destroy_tokens(_cheats)
os.write(_cheatfds[1], 't' * _cheats)
os.write(_cheatfds[1], b't' * _cheats)
assert state.is_flushed()


Expand Down

0 comments on commit aa920f1

Please sign in to comment.