abingham / traad

An JSON+HTTP server for the rope Python refactoring library
MIT License
107 stars 20 forks source link

"Error (error) while connecting" and "task-id is nil" #78

Closed PythonNut closed 6 years ago

PythonNut commented 8 years ago

With python3.5, and a newly installed traad-server.

Steps

Here are the steps I used to reproduce:

  1. emacs24.5 -Q test.py
  2. M-x traad-install-server RET
  3. M-x traad-open RET RET
  4. Enter the following code:

    def foo(this_is_a_test):
     return this_is_a_test
  5. Place the cursor on either instance of this_is_a_test
  6. M-x traad-rename RET replaced_name RET

Result

  1. The following is printed in the echo-area: REQUEST [error] Error (error) while connecting to http://127.0.0.1:38213/refactor/rename. and Rename started with task-id nil.
  2. No other changes to the buffer are apparent.
  3. In addition, here are the contents of the *traad-server* buffer:

Minor note: I fail. This issue is a duplicate of #76.

DEBUG:pykka:Registered Project (urn:uuid:72a0aca3-3f2f-4596-9600-6edb2c2fef77)
DEBUG:pykka:Starting Project("/home/pythonnut/Downloads/")
DEBUG:pykka:Registered State (urn:uuid:6ca5e904-7049-4204-8ddc-d7dc4d105ef9)
DEBUG:pykka:Starting State (urn:uuid:6ca5e904-7049-4204-8ddc-d7dc4d105ef9)
INFO:traad.server:Python version: 3.5.1 (default, Dec  7 2015, 12:58:09) 
[GCC 5.2.0]
INFO:traad.server:Running traad server for app "<traad.app.ProjectApp object at 0x7fe5d11a03c8>" at localhost:0
Bottle v0.13-dev server starting up (using WSGIRefServer())...
Listening on http://localhost:38213/
Hit Ctrl-C to quit.

127.0.0.1 - - [02/Jan/2016 01:49:49] "GET /protocol_version HTTP/1.1" 200 23
Traceback (most recent call last):
  File "/home/pythonnut/.emacs.d/.python-environments/traad/lib/python3.5/site-packages/traad/bottle.py", line 846, in _handle
    return route.call(**args)
  File "/home/pythonnut/.emacs.d/.python-environments/traad/lib/python3.5/site-packages/traad/bottle.py", line 1717, in wrapper
    rv = callback(*a, **ka)
  File "/home/pythonnut/.emacs.d/.python-environments/traad/lib/python3.5/site-packages/traad/app.py", line 140, in rename_view
    args['name'],
TypeError: 'NoneType' object is not subscriptable
127.0.0.1 - - [02/Jan/2016 01:49:56] "POST /refactor/rename HTTP/1.1" 500 757
abingham commented 8 years ago

This looks very much like it's the result of a known problem with request.el. The only real fix right now is to manually patch request.el; the details are in the PR linked in the issue report.