Fix SDO truncation of unknown datatypes#447
Fix SDO truncation of unknown datatypes#447sveinse wants to merge 1 commit intocanopen-python:masterfrom
Conversation
|
(It fails checks because it depends on |
af98492 to
49e4a73
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
| logger.warning(f"Decoding data {data!r} of type 0x%X at %s", | ||
| self.data_type, pretty_index(self.index, self.subindex)) | ||
| logger.warning(f"Size: {size} bytes, data length: {len(data)} bytes") |
There was a problem hiding this comment.
This is definitely too much logging, both by number of messages and at a too high severity level.
And please try to stick to the previously discussed rule: logging methods use % formats and parameters, and f-strings for everything else.
There was a problem hiding this comment.
Yes, I agree. These are left-overs from my own debugging. My bad. I'll remove them.
| pretty_index(self.index, self.subindex), self.data_type, | ||
| size, len(data)) | ||
| # Truncate the data to the expected size | ||
| data = data[:size] |
There was a problem hiding this comment.
It's way easier switching to the .unpack_from() method which simply discards trailing extra data. I don't think this severe warning is generally desired.
There was a problem hiding this comment.
I'm going to remove the warning altogether.
|
Superseded by #591. Closing |
This is a proposed fix for #436