Menu

pydev extensions - spurious syntax errors

2009-03-31
2013-03-15
  • James Garrison

    James Garrison - 2009-03-31

    After installing the trial version of pydev extensions I get a syntax error on
    pickle.load and pickle.dump.  The parser is confused - here's the content of the
    hover help:

    Undefined variable from import: load
    function: <function load at 0x00B94108>

    It can't be both defined and undefined at the same time unless I've stepped into a
    Schroedinger cat box :-) 

    The code executes without complaint.

     
    • Fabio Zadrozny

      Fabio Zadrozny - 2009-04-01

      That seems like a problem in the code-analysis (not really a syntax error). Can you give details on the python version you're using and the actual sample code that's failing? (It seems to work for me)

      Cheers,

      Fabio

       
    • James Garrison

      James Garrison - 2009-04-01

      Python 3.1a1
      pydev 1.4.5.2720
      pydev-extensions 1.4.5.2720

      This was working perfectly on the "free" version of pydev and started exhibiting problems immediately after installing the pydev-extensions.  When I installed pydev-extensions, Eclipse treated it as a separate package from the base pydev, so both show up as installed in the package list.  Is that how it should be?

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2009-04-01

        > both show up as installed in the package list. Is that how it should be?

        Yes, that's how it should be.

        That error is issued from the code-analysis... If you create an empty file and do:

        import pickle
        pickle.|<-- request code-completion here

        Do you have the load() method there?

        Cheers,

        Fabio

         
    • James Garrison

      James Garrison - 2009-04-01

      The only thing showing up in code-completion is

      __file__
      __name__

      I'll send you a screenshot if you wish.

      I've also just discovered another problem. Given the following SSCCE:

      import os
      import os.path
      os.chdir(".")
      if not os.path.exists("x.txt"): print("ok")

      The first instance of "os" is flagged with:

          Unused import: os
           (os)
          compiled extension

      The second instance is flagged with:

          Import redefinition: os
           (os)
          compiled extension

      This is also new since installing pydev-extensions

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2009-04-02

        Actually, if you do:

        import os.path

        You can already use the 'os' token (no need to reimport it -- which is what you're actually doing, and that's why it complains).

        Cheers,

        Fabio

         
    • James Garrison

      James Garrison - 2009-04-02

      I installed build 2721 and the problem persists.

      Then I removed pydev-extensions and the error flags went away.

      Curiously however, code-completion on "pickle.___" still lists only

      __file__
      __name__

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2009-04-02

        Those errors are from the pydev extensions code-analysis (which uses the same type-inference engine from the open source version, so, it'll give an error on pickle.load if it's not available in the completions for pickle).

        Please report that as a bug, specifying the python version you're using (you can also try adding 'pickle' to your forced builtins... that should not be needed in 2.6 and 3.0 -- which are the versions I tested here, but it could be that some other version has 'special needs').

        Cheers,

        Fabio