mmiszczyk / deepmage

Hex editor for bit-level occultism
GNU General Public License v3.0
22 stars 1 forks source link

Creation error while drawing view #1

Open braton opened 6 years ago

braton commented 6 years ago

When I try to run the deepmage like below:

/tmp/deepmage$ python deepmage.py a.bin

the application crashes with the following trace:

Traceback (most recent call last):
  File "deepmage.py", line 225, in <module>
    Screen.wrapper(main_loop, catch_interrupt=True)
  File "/usr/local/lib/python2.7/dist-packages/asciimatics/screen.py", line 1169, in wrapper
    func(screen)
  File "deepmage.py", line 222, in main_loop
    UI(screen, f)
  File "deepmage.py", line 55, in __init__
    self.main_loop_internal()
  File "deepmage.py", line 150, in main_loop_internal
    self.redraw_if_needed()
  File "deepmage.py", line 116, in redraw_if_needed
    self.draw_view()
  File "deepmage.py", line 58, in draw_view
    self.view = self.reader.get_view(self.starting_word, self.words_in_view)
  File "/tmp/deepmage/bitstream_reader.hy", line 173, in get_view
    (+ first-word-idx number-of-words))])))
  File "/tmp/deepmage/bitstream_reader.hy", line 149, in __getitem__
    (for-bit-in-word word-number
  File "/tmp/deepmage/bitstream_reader.hy", line 29, in __getitem__
    (unless self.loaded (.load self))
  File "/tmp/deepmage/bitstream_reader.hy", line 18, in load
    (setv self.contents (bitstring.BitStream (.read self.file self.size)))
  File "/usr/local/lib/python2.7/dist-packages/bitstring.py", line 4133, in __new__
    x._initialise(auto, length, offset, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/bitstring.py", line 805, in _initialise
    self._initialise_from_auto(auto, length, offset)
  File "/usr/local/lib/python2.7/dist-packages/bitstring.py", line 836, in _initialise_from_auto
    self._setauto(auto, length, offset)
  File "/usr/local/lib/python2.7/dist-packages/bitstring.py", line 1274, in _setauto
    bs = self._converttobitstring(s)
  File "/usr/local/lib/python2.7/dist-packages/bitstring.py", line 1972, in _converttobitstring
    raise CreationError(*e.args)
bitstring.CreationError: Don't understand length '' of token.

Could you please take a look at this issue?

mmiszczyk commented 6 years ago

Please check if the issue is still present after the latest commit, and if it happens on Python 3. I've programmed deepmage on Python 3 and haven't yet tested compatibility with Python 2.

braton commented 6 years ago

Unfortunately the issue is still present with latest revision using Python 2. On Python 3 though it works well. Thank you.