jobserver.py: fix very rare python3 failure reported by a user.

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.
This commit is contained in:
Avery Pennarun 2020-06-15 00:39:10 -04:00
commit aa920f12ed

View file

@ -479,7 +479,7 @@ def force_return_tokens():
_debug('%d,%d -> force_return_tokens: recovering final token\n' _debug('%d,%d -> force_return_tokens: recovering final token\n'
% (_mytokens, _cheats)) % (_mytokens, _cheats))
_destroy_tokens(_cheats) _destroy_tokens(_cheats)
os.write(_cheatfds[1], 't' * _cheats) os.write(_cheatfds[1], b't' * _cheats)
assert state.is_flushed() assert state.is_flushed()