We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It looks like pfp does not like being given bytes-like objects on Python3.
pfp
bytes
>>> template='uchar mybyte;' >>> pfp.parse('a', template) <pfp.fields.Dom object at 0x10fbdab50>
However...
>>> pfp.parse(b'a', template)
Throws the following error:
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ~/github.com/pfp/pfp/interp.py in _run(self, keep_successfull) 1043 # may change (e.g. compressed data) -> 1044 res = self._handle_node(self._ast, None, None, self._stream) 1045 except errors.InterpReturn as e: ~/github.com/pfp/pfp/interp.py in _handle_node(self, node, scope, ctxt, stream) 1152 -> 1153 res = self._node_switch[node.__class__](node, scope, ctxt, stream) 1154 ~/github.com/pfp/pfp/interp.py in _handle_file_ast(self, node, scope, ctxt, stream) 1168 """ -> 1169 self._root = ctxt = fields.Dom(stream) 1170 ctxt._pfp__scope = scope ~/github.com/pfp/pfp/fields.py in __init__(self, *args, **kwargs) 1217 def __init__(self, *args, **kwargs): -> 1218 super(self.__class__, self).__init__(*args, **kwargs) 1219 ~/github.com/pfp/pfp/fields.py in __init__(self, stream, metadata_processor) 772 if stream is not None: --> 773 self._pfp__offset = stream.tell() 774 ~/github.com/pfp/pfp/bitwrap.py in tell(self) 191 """ --> 192 res = self._stream.tell() 193 if len(self._bits) > 0: AttributeError: 'bytes' object has no attribute 'tell'
The text was updated successfully, but these errors were encountered:
Oh interesting, thank you for the bug report! I thought I had addressed all Python 3 compatability issues already.
Sorry, something went wrong.
A workaround - pass io.BytesIO(bytes) as data
io.BytesIO(bytes)
d0c-s4vage
No branches or pull requests
It looks like
pfp
does not like being givenbytes
-like objects on Python3.However...
Throws the following error:
The text was updated successfully, but these errors were encountered: