-
Notifications
You must be signed in to change notification settings - Fork 633
Remove redundant writer.stop call that throws error #1317
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
Conversation
The issue is that the writer has already previously been told to stop.
Codecov Report
@@ Coverage Diff @@
## develop #1317 +/- ##
===========================================
- Coverage 65.98% 65.97% -0.01%
===========================================
Files 86 86
Lines 8948 8946 -2
===========================================
- Hits 5904 5902 -2
Misses 3044 3044 |
The _get_new_writer function was previously calling `self._writer.close()`. The `self.writer` function is already being closed in the call stack. Due to `self.writer` and `self._writer` being linked, there was an error that the IO file was closed. The `self._writer.close()` was commented out in a prior commit as a proposal for the change. That comment is now removed. The docstring is updated.
@felixdivo could you take a look? Can we remove it? |
@zariiii9003 Please note that @felixdivo has posted several comments documenting that he is currently unavailable to contribute to the project. (#965 (comment), #1220 (comment)). I have verified that txt, log, asc, csv and blf all work with the line I removed. However, I have not yet post parsed the output logs to ensure the signal being sent is captured. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this looks good to me. 👍 😄
Thank you! I thought maybe i missed some edge case where it is necessary. |
The issue is that the writer has already previously been told to stop.
The function
on_message_received
is called:python-can/can/io/logger.py
Lines 198 to 206 in 796b525
Which calls the
self.do_rollover()
functionpython-can/can/io/logger.py
Lines 333 to 335 in 796b525
writer
is told to stop:The
_get_new_writer
function then tells the_writer
to closepython-can/can/io/logger.py
Lines 219 to 221 in 796b525
I believe
writer
and_writer
are linked. So the call to close the_writer
is_get_new_writer
is redundant and is throwing an error because thewriter
is no longer open.closes #1316