#877 .py files not treated as Python source

1.4.4
closed-works-for-me
Editor (491)
5
2009-03-17
2009-03-16
James Garrison
No

The editor seems to randomly switch between treating .py files as Python source and plain text. When it's behaving correctly the file icon in the tab contains a small green "P", and otherwise it's just the default text document icon.

The problem is that you have to explicitly right-click and select "Open with pydev" instead of the default open if you want to guarantee that it will open with the Python editor. This should be the default.

Discussion

  • James Garrison
    James Garrison
    2009-03-16

    screenshot

     
    Attachments
  • James Garrison
    James Garrison
    2009-03-16

    I think this may be related to the fact that the .py files in the package explorer do not indicate, via icon decoration, that Eclipse thinks they're python source. I've attached a screenshot.
    File Added: python01.png

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2009-03-17

    • status: open --> pending
     
  • Fabio Zadrozny
    Fabio Zadrozny
    2009-03-17

    You probably have the wrong file association. Check: general > editors > file associations and check if *.py is associated to 'Python Editor' as the default editor (that should happen regularly, when you install Pydev, but maybe you had another plugin that changed it?)

     
  • James Garrison
    James Garrison
    2009-03-17

    • status: pending --> open
     
  • James Garrison
    James Garrison
    2009-03-17

    I just installed pydev last week.

    Under File Associations, for *.py, the associated editors are:

    Python Editor
    Text Editor (locked by "Python File" content type)

     
  • James Garrison
    James Garrison
    2009-03-17

    I just clicked the "Default" button while "Python Editor" was hilighted, and now things are working as expected. Maybe the install failed to set the correct default?

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2009-03-17

    • status: open --> closed-works-for-me
     
  • Fabio Zadrozny
    Fabio Zadrozny
    2009-03-17

    Which Eclipse version are you using? This seems like an Eclipse bug (Pydev just says that the association should be done in the plugin... and Eclipse must make the actual association)