Skip to content

Error when replaying ASC file #1256

Description

@felixdivo

I get the following error when I replay an ASC file:

09:07:47  self = <can.io.asc.ASCReader object at 0x0000020898E659D0>
09:07:47  
09:07:47      def __iter__(self) -> Generator[Message, None, None]:
09:07:47          self._extract_header()
09:07:47      
09:07:47          for line in self.file:
09:07:47              line = line.strip()
09:07:47      
09:07:47              if not re.match(
09:07:47                  r"\d+\.\d+\s+(\d+\s+(\w+\s+(Tx|Rx)|ErrorFrame)|CANFD)",
09:07:47                  line,
09:07:47                  re.ASCII | re.IGNORECASE,
09:07:47              ):
09:07:47                  # line might be a comment, chip status,
09:07:47                  # J1939 message or some other unsupported event
09:07:47                  continue
09:07:47      
09:07:47              msg_kwargs: Dict[str, Union[float, bool, int]] = {}
09:07:47              try:
09:07:47                  _timestamp, channel, rest_of_message = line.split(None, 2)
09:07:47  >               timestamp = float(_timestamp) + self.start_time
09:07:47  E               AttributeError: 'ASCReader' object has no attribute 'start_time'

the error occurs here

This is the input file
CAN.txt

Originally posted by @danielhrisca in #1250 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions