syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.7k stars 4.9k forks source link

Python REPL freezes within a couple of minutes, every time (reproducible) #12092

Closed tsoernes closed 4 years ago

tsoernes commented 5 years ago

Description :octocat:

Python REPL freezes

Reproduction guide :beetle:

Happens with both IPython and regular Python.

Observed behaviour: :eyes: :broken_heart: The REPL freezes within a couple of minutes. Emacs becomes unresponsive. Is reproducible. Happens every time.

I activated 'toggle-debug-on-quit'. Then, when the REPL froze, I hit C-g and got this:

Debugger entered--entering a function:
* python-util-strip-string(nil)
  python-shell-completion-get-completions(#<process Python> nil "OA")
  apply(python-shell-completion-get-completions (#<process Python> nil "OA"))
  #f(compiled-function (&rest args2) #<bytecode 0x1d290f1>)("OA")
  #f(compiled-function (string pred action) #<bytecode 0x1d29119>)("OA" nil t)
  all-completions("OA" #f(compiled-function (string pred action) #<bytecode 0x1d29119>) nil)
  completion-pcm--all-completions("" ("OA" point) #f(compiled-function (string pred action) #<bytecode 0x1d29119>) nil)
  completion-basic-all-completions("OA" #f(compiled-function (string pred action) #<bytecode 0x1d29119>) nil 2)
  #f(compiled-function (style) #<bytecode 0x1d29141>)(basic)
  completion--some(#f(compiled-function (style) #<bytecode 0x1d29141>) (basic partial-completion emacs22))
  completion--nth-completion(2 "OA" #f(compiled-function (string pred action) #<bytecode 0x1d29119>) nil 2 nil)
  completion-all-completions("OA" #f(compiled-function (string pred action) #<bytecode 0x1d29119>) nil 2)
  company-capf(candidates "OA")
  company--multi-backend-adapter-candidates((company-files company-capf) "OA" nil)
  company--multi-backend-adapter((company-files company-capf) candidates "OA")
  apply(company--multi-backend-adapter (company-files company-capf) (candidates "OA"))
  company-call-backend-raw(candidates "OA")
  company--fetch-candidates("OA")
  company-calculate-candidates("OA" nil)
  company--begin-new()
  company--perform()
  company-auto-begin()
  company-idle-begin(#<buffer *Python*> #<window 14 on *Python*> 520 1710)
  apply(company-idle-begin (#<buffer *Python*> #<window 14 on *Python*> 520 1710))
  timer-event-handler([t 23701 11465 771002 nil company-idle-begin (#<buffer *Python*> #<window 14 on *Python*> 520 1710) nil 875000])

Expected behaviour: :heart: :smile: Should not freeze.

System Info :computer:

Backtrace :paw_prints:

Debugger entered--entering a function:
* python-util-strip-string(nil)
  python-shell-completion-get-completions(#<process Python> nil "OA")
  apply(python-shell-completion-get-completions (#<process Python> nil "OA"))
  #f(compiled-function (&rest args2) #<bytecode 0x1d290f1>)("OA")
  #f(compiled-function (string pred action) #<bytecode 0x1d29119>)("OA" nil t)
  all-completions("OA" #f(compiled-function (string pred action) #<bytecode 0x1d29119>) nil)
  completion-pcm--all-completions("" ("OA" point) #f(compiled-function (string pred action) #<bytecode 0x1d29119>) nil)
  completion-basic-all-completions("OA" #f(compiled-function (string pred action) #<bytecode 0x1d29119>) nil 2)
  #f(compiled-function (style) #<bytecode 0x1d29141>)(basic)
  completion--some(#f(compiled-function (style) #<bytecode 0x1d29141>) (basic partial-completion emacs22))
  completion--nth-completion(2 "OA" #f(compiled-function (string pred action) #<bytecode 0x1d29119>) nil 2 nil)
  completion-all-completions("
tsoernes commented 5 years ago

Disabling company-mode in the buffer seems to 'resolve' this issue. Here's an assortment of the errors I get in messages when it is enabled:

Shell native completion is disabled, using fallback
Company: An error occurred in auto-begin
Wrong type argument: integer-or-marker-p, nil
Company: An error occurred in auto-begin
Wrong type argument: integer-or-marker-p, nil
Shell native completion is disabled, using fallback
Company: An error occurred in post-command
Company: backend (company-files company-capf) error "Wrong type argument: arrayp, nil" with args (candidates df)
github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!