Pydev problem with popen() family (lost \n ?)

georg
2007-03-29
2013-03-15
  • georg

    georg - 2007-03-29

    Hi!
    tried to execute this simple python code within eclipse-pydev:

    import os

    if __name__ == "__main__":
        print "Just a test"
        stream=os.popen('ls')
        list = stream.readlines()
        print list
    -----------------------------------------------------------
    output @stderr received:

    sh: mc: line 1: syntax error: unexpected end of file
    sh: error importing function definition for `mc'

    -----------------------------------------------------------
    and stdout:

    Just a test
    ['fileSystemChecks.py\n', 'fileSystemChecks.pyc\n', '__init__.py\n', '__init__.pyc\n', 'processChecks.py\n', 'python.log\n', 'regexpChecks.py\n', 'spikeTests.py\n']

    (OK!)
    -----------------------------------------------------------
    Works fine from the shell with "python test.py"!

    any idea how to solve this?

    thanks in advance,
    georg

     
    • Fabio Zadrozny

      Fabio Zadrozny - 2007-03-30

      Works here... It seems something related to the shell in which eclipse is running -- and not actually with pydev... have you started eclipse from the same shell you're using in the 'python test.py'?

       
      • georg

        georg - 2007-03-30

        hmmm... yes i started eclipse from the bash (with startUp.sh) and also the script run directly in the bash.
        Any other idea?

         
        • Fabio Zadrozny

          Fabio Zadrozny - 2007-04-04

          Not really (unfortunately -- you may want to open a bug report about that, as this may need more investigation).

          Cheers,

          Fabio

           

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks