MarketSquare / MarketSquare/Rammbock
Error when using _Freelength pdu
- Dominant language
- Python
- Stars
- 64
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
When I use the pdu length as a free length while defining the protocol.
```
...
...
self.pdu('*')
self.end_protocol()
```
I get a python error saying
"""
pydev debugger: starting
Traceback (most recent call last):
File "...\eclipse\plugins\org.python.pydev_2.7.3.2013031601\pysrc\pydevd.py", line 1397, in
debugger.run(setup['file'], None, None)
File "...\eclipse\plugins\org.python.pydev_2.7.3.2013031601\pysrc\pydevd.py", line 1090, in run
pydev_imports.execfile(file, globals, locals) #execute the script
File "...py", line 55, in
msg = myObject.server_receives_without_validation()
File "C:\Python27\lib\site-packages\Rammbock\core.py", line 478, in server_receives_without_validation
with self._receive(self._servers, *parameters) as (msg, _):
File "C:\Python27\lib\contextlib.py", line 17, in __enter__
return self.gen.next()
File "C:\Python27\lib\site-packages\Rammbock\core.py", line 503, in _receive
msg = node.get_message(self._get_message_template(), **configs)
File "C:\Python27\lib\site-packages\Rammbock\networking.py", line 73, in get_message
return self._get_from_stream(message_template, self._message_stream, timeout=timeout, header_filter=header_filter)
File "C:\Python27\lib\site-packages\Rammbock\networking.py", line 76, in _get_from_stream
return stream.get(message_template, timeout=timeout, header_filter=header_filter)
File "C:\Python27\lib\site-packages\Rammbock\templates\message_stream.py", line 34, in get
header, pdu_bytes = self._protocol.read(self._stream, timeout=timeout)
File "C:\Python27\lib\site-packages\Rammbock\templates\containers.py", line 165, in read
length_param = header[self.pdu_length.field].int
AttributeError: '_FreeLength' object has no attribute 'field'
"""
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at Rammbock/templates/containers.py line 165, where reading a free-length PDU fails while accessing the length field; trace the call through templates/message_stream.py, networking.py, and core.py. Reproduce the protocol definition using self.pdu('*') and verify that receiving the message completes without the reported AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100