Komodo / KomodoEdit

Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
http://www.komodoide.com/komodo-edit
Other
2.15k stars 302 forks source link

float('∞') produces an error message that breaks the error message printer #1759

Open DavidHowlett opened 8 years ago

DavidHowlett commented 8 years ago

Short Summary

I am using python 3.5 in Komodo 10 on Windows. The issue is also present in Komodo 9. In python the expression float('∞') should produce a value error.

Steps to Reproduce

Run the following in a python file in Komodo:

float('∞')

Expected results

Traceback (most recent call last): File "", line 1, in ValueError: could not convert string to float: '∞'

Actual results

Traceback (most recent call last): File "G:\reusable\junk.py", line 1, in Error in sys.excepthook: Traceback (most recent call last): File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\support\dbgp\python3lib\dbgp\client.py", line 3961, in excepthook _print_exception(type, value, tb) File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\support\dbgp\python3lib\dbgp\client.py", line 389, in _print_exception _print_tb(tb, limit, file) File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\support\dbgp\python3lib\dbgp\client.py", line 366, in _print_tb if line: file.write(' %s\n' % line.strip()) File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\support\dbgp\bin\py3_dbgp.py", line 129, in write self._origStream.write(s) File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\support\dbgp\bin\py3_dbgp.py", line 129, in write self._origStream.write(s) File "c:\anaconda3\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u221e' in position 11: character maps to

Original exception was: Traceback (most recent call last): File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\support\dbgp\bin\py3_dbgp.py", line 307, in sys.exit( main(sys.argv) ) File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\support\dbgp\bin\py3_dbgp.py", line 281, in main dbgp.client.runWithoutDebug(args, interactive, host, port, idekey, logLevel) File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\support\dbgp\python3lib\dbgp\client.py", line 4023, in runWithoutDebug h_execfile(debug_args[0], debug_args, module=main) File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\support\dbgp\python3lib\dbgp\client.py", line 682, in init exec(contents, globals, locals) File "", line 1, in ValueError:

Platform Information

I have seen the problem on: Windows 10 Python 3.5 Komodo IDE Version 9.3.2 Version 10.0.1

Additional Information

I discovered this while working on: http://bugs.python.org/issue27412

DavidHowlett commented 8 years ago

Screenshot of bug:

screenshot 2016-06-29 15 04 50

mitchell-as commented 8 years ago

Thanks for the report. It appears one of our components is assuming a latin1 encoding instead of UTF-8, despite UTF-8 being the encoding you are using in the file.

mitchell-as commented 8 years ago

Note to self: possibly related to #1541

mitchell-as commented 8 years ago

Fixed via https://github.com/Komodo/KomodoIDE/commit/baad8492dd1ffa8c9ecad99b180fe992953231dd

DavidHowlett commented 7 years ago

This bug was marked as part of the 10.1 milestone but I am using Komodo IDE 10.1.2 and the bug is still present.
screenshot 2016-11-30 16 24 05

mitchell-as commented 7 years ago

Hi, I cannot reproduce this. I copied your source file text and get the following expected error in the "Debug output" pane:

  File "/path/to/support/dbgp/python3lib/dbgp/client.py", line 2445, in runMain
    self.dbg.runfile(debug_args[0], debug_args)
  File "/path/to/support/dbgp/python3lib/dbgp/client.py", line 2032, in runfile
    h_execfile(file, args, module=main, tracer=self)
  File "/path/to/support/dbgp/python3lib/dbgp/client.py", line 682, in __init__
    exec(contents, globals, locals)
  File "<string>", line 1
     ∞ = 'my string'
     ^
 SyntaxError: invalid character in identifier
DavidHowlett commented 7 years ago

That is unexpected. Can you replicate the fault on windows? Possibly that is the cause of the difference. I have simplified the error further, hoping to get something that will replicate. Try: "1/0#∞" image

mitchell-as commented 7 years ago

Good point. When I have some time I will look into this on a Windows machine.