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.16k stars 303 forks source link

Error is thrown while switching to python interactive shell #2619

Open mjainQA opened 7 years ago

mjainQA commented 7 years ago

Short Summary

An error is thrown while trying to switch to python interactive shell

Steps to Reproduce

  1. Go to Tools -> Interactive Shell -> Start new Ruby Shell
  2. Go to Tools -> Interactive Shell -> Start new Python Shell

Expected results

Python shell is available

Actual results

An error is thrown

Platform Information

Komodo Edit or IDE? IDE Komodo Version? 10.2.2 Operating System (and version)? macOS 10.12.5

Additional Information

image image

mitchell-as commented 7 years ago

This is odd. I cannot reproduce this. Does the Python shell work if you try opening it first? Is the Ruby shell initialized before you try opening the Python shell?

Defman21 commented 7 years ago

Are you using this setting by any chance?

default

mjainQA commented 7 years ago

@mitchell-as Python shell does not work at all. I just upgraded my OS from 10.9 to 10.12.5 and Python shell has been throwing error since then. Other shells work as expected.

@Defman21 Here are my settings:

image.png

Naatan commented 7 years ago

Please share your error log after reproducing the issue.

You can find your error log at Help > Troubleshooting > View Log File.

mjainQA commented 7 years ago

@Naatan Here is the logfile

pystderr1.txt

Naatan commented 7 years ago

Can you reproduce this using Help > Troubleshooting > Restart in Safe-mode ?

mjainQA commented 7 years ago

@Naatan I am unable to reproduce this issue in safe-mode.

Naatan commented 7 years ago

@cgchoffman can you stop by @mjainQA's desk and see what about her setup is causing this? I suspect Python prefs or her environment settings.

th3coop commented 7 years ago

Isn't this #2496?

Naatan commented 7 years ago

Looks like it is. Can you still stop by her desk?

th3coop commented 7 years ago

I did for #2496 and I couldn't find anything. I'm pretty sure it's just the debugger system failing for some reason. I'm also pretty sure a regular restart resolves this issue, starting in Safe Mode is not needed.

mjainQA commented 7 years ago

It's not the same issue as reported in #2496.

Carey and I tried disabling the port debugging -> connection -> port -> system provided free port and custom port. This did not resolve the issue. Also, note that debugger is listening and has an assigned port. This implies that the error thrown is wrong and needs more investigation.

Naatan commented 7 years ago

How do you figure it's different from #2496?

The port has nothing to do with interactive shells, the port is only used for remote debugging.

th3coop commented 7 years ago

@naatan, I don't know in what way exactly but if ports are screwed up on your system the debugger won't work even for local debugging. Ask mitchell for more details.

The point is that the error reported by Komodo that @mjainQA posted in the first message is wrong and also different from the issue I thought was the same. There is no error in #2496.

We've done more digging and found that there are a couple issues going on here. For one, komodo allowed @mjainQA to set a Python interpreter that isn't a python interpreter (the file didn't even exist). When you select a Python interpreter in prefs Komodo checks that it's Python 2 then complains if it's not. It still sets the path as the preferences and worse it allows you to OK out of the window and saves the pref.

The other issue is that when Komodo tried to run the interpreter with a broken config it gave a useless error message.

I personally thing the only action item is fixing the prefs window so it doesn't accept a broken config.

mjainQA commented 7 years ago

@cgchoffman @Naatan If you do end up investigating this further as per @cgchoffman suggestions, please update the reproduction steps for QA to add a test case for regression testing. Thanks!

th3coop commented 7 years ago

please update the reproduction steps for QA to add a test case for regression testing. Thanks!

Hrm, good point. This ticket took a bit of a turn. Maybe we should refile this issue as a Preference window bug.

Naatan commented 7 years ago

komodo allowed @mjainQA to set a Python interpreter that isn't a python interpreter (the file didn't even exist)

@mjainQA you are a true QAer :p

Alright so we basically need to validate interpreter configurations, which should theoretically be as simple as parsing the output of ruby --version.

Naatan commented 7 years ago

Closing this ticket in favor of #2624, as this issue is basically fallout of a bad UX. It makes no sense to fix the symptom rather than the cause.

th3coop commented 7 years ago

When you select a Python interpreter in prefs Komodo checks that it's Python 2 then complains if it's not.

It already does this as I said before. It's the fact that the UI still sets the pref.

mitchell-as commented 7 years ago

Note: interactive shells use the debugger. (Weird, I know.)

Naatan commented 7 years ago

@cgchoffman please explain why you reopened this bug.

th3coop commented 7 years ago

I did, twice. It already performs validation. The bug is that even after warning the user that it won't work it will allow you to set the field and save it.