wuub/SublimeREPL — Issue #14: Python3 delays error output by one line
Author: wuub
Created: 2012-02-13 10:26:34+00:00
State: open
Labels: bug

by havri on Sat Feb 11, 2012 3:15 pm

Hello!
Great plugin, great jog wuub! But I have problem with SublimeREPL when I am using Python 3. Every time I write something wrong and Python should respond with an error message, I get nothing and the error message will apear in the next call. There is an output for Python3:

```python
>>> import foo
>>> foo.fact(6)
720
>>> foo.fact('asd')
>>> 1+1
Traceback (most recent call last):
File "", line 1, in
File "/Users/user/Utilities/foo.py", line 41, in fact
return 1 if n == 1 else n * fact(n - 1)
TypeError: unsupported operand type(s) for -: 'str' and 'int'
2
>>> sys.version
'3.2 (r32:88452, Feb 20 2011, 10:19:59) \n[GCC 4.0.1 (Apple Inc. build 5493)]'
>>>
```

When I wrote foo.fact(‚asd‘) I did not get the error message. I had to write e.g. 1+1 to get the error message. Everything is alright with Python2:

```python
>>> import foo
>>> foo.fact(10)
3628800
>>> foo.fact('asd')
Traceback (most recent call last):
File "", line 1, in
File "/Users/user/Utilities/foo.py", line 41, in fact
return 1 if n == 1 else n * fact(n - 1)
TypeError: unsupported operand type(s) for -: 'str' and 'int'
>>> sys.version
'2.7.1 (r271:86832, Jun 16 2011, 16:59:05) \n[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]'
>>>
```

I have changed the path to Python interpreter in SublimeREPL/config/Python/Main.sublime-menu. From "cmd": ["python", "-i”] to "cmd": ["/Library/Frameworks/Python.framework/Versions/3.2/bin/python3", "-i”]. Nothing else.

Does anyone know where is the problem, please?