-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
IOError: [Errno 0] Error raised when executing tox with --result-json option on Windows. #727
Labels
Comments
Related, this function is broken pretty hard in python3:
|
@r2dan I wasn't able to reproduce this yet, but I have a suspicion what could cause this. Could you give some more details?
|
@r2dan can you try with this patch? diff --git a/tox/session.py b/tox/session.py
index 35cb4dc..0c8482d 100644
--- a/tox/session.py
+++ b/tox/session.py
@@ -127,7 +127,7 @@ class Action(object):
fout.write("actionid: %s\nmsg: %s\ncmdargs: %r\n\n" % (self.id, self.msg, args))
fout.flush()
self.popen_outpath = outpath = py.path.local(fout.name)
- fin = outpath.open()
+ fin = outpath.open('rb')
fin.read() # read the header, so it won't be written to stdout
stdout = fout
elif returnout:
@@ -155,7 +155,6 @@ class Action(object):
out = None
last_time = time.time()
while 1:
- fin_pos = fin.tell()
# we have to read one byte at a time, otherwise there
# might be no output for a long time with slow tests
data = fin.read(1)
@@ -173,7 +172,8 @@ class Action(object):
break
else:
time.sleep(0.1)
- fin.seek(fin_pos)
+ # the seek updates internal read buffers
+ fin.seek(0, 1)
fin.close()
else:
out, err = popen.communicate() It's against the tox 2.9.1 tag, so it should apply to the release you use. |
@fschulze
I've tested the patch and it seems to fix the issue. Thanks! |
fschulze
added a commit
to fschulze/tox
that referenced
this issue
Jan 8, 2018
… with ``IOError: [Errno 0] Error`` on Windows, this was fixed by using a simpler method to update the read buffers.
fschulze
added a commit
to fschulze/tox
that referenced
this issue
Jan 8, 2018
… with ``IOError: [Errno 0] Error`` on Windows, this was fixed by using a simpler method to update the read buffers.
fschulze
added a commit
to fschulze/tox
that referenced
this issue
Jan 8, 2018
… with ``IOError: [Errno 0] Error`` on Windows, this was fixed by using a simpler method to update the read buffers.
fschulze
added a commit
to fschulze/tox
that referenced
this issue
Jan 8, 2018
… with ``IOError: [Errno 0] Error`` on Windows, this was fixed by using a simpler method to update the read buffers.
gaborbernat
pushed a commit
that referenced
this issue
Jan 11, 2018
…`IOError: [Errno 0] Error`` on Windows, this was fixed by using a simpler method to update the read buffers. (#734)
via #734 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Tox crashes on Windows when invoked with --result-json option. To reproduce the issue tests need to output a lot of text to stdout. Exception is raised only on Windows platform. The attached package reproduces the error on my machine (~30% reproduction rate).
Minimal package to reproduce the issue: tox_issue_result_log.tar.gz
Stack traceback: tox_result.log
The most convenient way to reproduce the error is to run tox in a loop:
for /l %x in (1, 1, 100) do tox --result-json result.json
Please note that pytest is invoked with --verbose flag to increase the amount of text written to stdout.
Platform: Windows 10/Windows 7 (reproduced on 3 machines)
The text was updated successfully, but these errors were encountered: