Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

In EtasBus _apply_filters, self._oci_filters is not defined when EtasBus init called with version 4.3.0 #1693

Closed
Labels
@kjw8118

Description

Describe the bug

When I generate Bus object with 'etas', it gave me error messages
dev = can.interface.Bus(interface='etas', channel='ETAS://USB/ES582.1:XXXXXX/CAN:1', bitrate=500000)

Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "'Python Path'\lib\site-packages\can\util.py", line 378, in wrapper
 return f(*args, **kwargs)
 File "'Python Path'\lib\site-packages\can\interface.py", line 135, in Bus
 bus = cls(channel, **kwargs)
 File "'Python Path'\lib\site-packages\can\interfaces\etas\__init__.py", line 21, in __init__
 super().__init__(channel=channel, **kwargs)
 File "'Python Path'\lib\site-packages\can\bus.py", line 99, in __init__
 self.set_filters(can_filters)
 File "'Python Path'\lib\site-packages\can\bus.py", line 404, in set_filters
 self._apply_filters(self._filters)
 File "'Python Path'\lib\site-packages\can\interfaces\etas\__init__.py", line 222, in _apply_filters
 if self._oci_filters:
AttributeError: 'EtasBus' object has no attribute '_oci_filters'. Did you mean: 'set_filters'?

I used etas interface python-can with last version(~4.2.2), and it worked in same code.

To Reproduce

Below line added in EtasBus(can.BusABC) init at 4.3.0. It call EtasBus._apply_filters()
super().__init__(channel=channel, **kwargs)

 if self._oci_filters:
 OCI_RemoveCANFrameFilterEx(self.rxQueue, self._oci_filters, 1)

_apply_filters got 'filters' as parameter but self._oci_filters is checked.
self._oci_filters is defined after calling _apply_filters in EtasBus init.

Expected behavior

Im not sure how self._oci_filters will be working in EtasBus. I think self._oci_filters could be defined before EtasBus.init

Additional context

OS and version: Windows 10 x64
Python version: 3.10.8
python-can version: 4.3.0
python-can interface/s (if applicable): etas

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /