Skip to content
New issue

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

Bug: AttributeError: 'Key' object has no attribute 'encode' #60

Open
jonathanslenders opened this issue Dec 17, 2016 · 3 comments
Open
Assignees
Labels

Comments

@jonathanslenders
Copy link
Member

Traceback (most recent call last):
  File "/home/jonathan/git/pymux/pymux/main.py", line 538, in run_server
    PipeInput(), DummyCallbacks())
  File "/home/jonathan/git/python-prompt-toolkit/prompt_toolkit/eventloop/posix.py", line 164, in run
    t()
  File "/home/jonathan/git/pymux/pymux/server.py", line 70, in _recv
    self._process(self._recv_buffer[:pos])
  File "/home/jonathan/git/pymux/pymux/server.py", line 91, in _process
    self._inputstream.feed(packet['data'])
  File "/home/jonathan/git/python-prompt-toolkit/prompt_toolkit/terminal/vt100_input.py", line 398, in feed
    self._input_parser.send(c)
  File "/home/jonathan/git/python-prompt-toolkit/prompt_toolkit/terminal/vt100_input.py", line 307, in _input_parser_generator
    self._call_handler(match, prefix)
  File "/home/jonathan/git/python-prompt-toolkit/prompt_toolkit/terminal/vt100_input.py", line 340, in _call_handler
    self.feed_key_callback(KeyPress(key, insert_text))
  File "/home/jonathan/git/pymux/pymux/server.py", line 36, in feed_key
    self.cli.input_processor.process_keys()
  File "/home/jonathan/git/python-prompt-toolkit/prompt_toolkit/key_binding/input_processor.py", line 219, in process_keys
    self._process_coroutine.send(key_press)
  File "/home/jonathan/git/python-prompt-toolkit/prompt_toolkit/key_binding/input_processor.py", line 176, in _process
    self._call_handler(matches[-1], key_sequence=buffer)
  File "/home/jonathan/git/python-prompt-toolkit/prompt_toolkit/key_binding/input_processor.py", line 247, in _call_handler
    handler.call(event)
  File "/home/jonathan/git/python-prompt-toolkit/prompt_toolkit/key_binding/registry.py", line 61, in call
    return self.handler(event)
  File "/home/jonathan/git/pymux/pymux/key_bindings.py", line 134, in _
    p.process.write_key(event.key_sequence[0].key)
  File "/home/jonathan/git/pymux/pymux/process.py", line 257, in write_key
    self.write_input(data)
  File "/home/jonathan/git/pymux/pymux/process.py", line 238, in write_input
    self.write_bytes(data.encode('utf-8'))
AttributeError: 'Key' object has no attribute 'encode'
@davidbrochart
Copy link

Hi Jonathan, any update on this?

@jonathanslenders
Copy link
Member Author

Hi @davidbrochart,

Could you remind me on how to reproduce it? I haven't looked at it for a while.
Right now, my focus is mainly on prompt_toolkit 2.0, then I'll rewrite pymux and pyvim on top of that.

@davidbrochart
Copy link

It looks like since I switched to Python 3.6, pymux always freezes after a while, with this error in the stack trace. But if you are going to rewrite prompt_toolkit, it may not be worth looking at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants