rticau / ScreenCapLibrary

Robot Framework test library for capturing screenshots and video recording.
Apache License 2.0
40 stars 15 forks source link

ValueError: I/O operation on closed file. #40

Closed TencolHu closed 4 years ago

TencolHu commented 5 years ago

Hi, I encounter one issue when log a message with Level : WARN While test start and sleep 1s then log message with WARN, it will show "ValueError: I/O operation on closed file."

python : 3.6.5 robotframework==3.0.4 robotframework-screencaplibrary==1.3.1

Here is my code: Settings Library ScreenCapLibrary Test Setup start video recording Test Teardown stop video recording

Test Cases test for log warn sleep 1s log this is test level=WARN

if remove sleep , it will success

Please help me check, thank you

mihaiparvu commented 5 years ago

There is indeed a bug in the ScreenCapLibrary 3.4.0, good find. It has to do with the stderr being suppressed while recording.

This doesn't look like a quick fix at the moment, so as a workaround I propose changing the loglevel to INFO or moving the Log keyword outside of recording.