Giter VIP home page Giter VIP logo

Comments (7)

berndca avatar berndca commented on May 24, 2024

Changed first line in ~/.gauge/plugins/python/0.1.1/start.py from

#! /usr/bin/env python -u

to

#! /usr/bin/env python

and running gauge in a virtualenv (pyvenv) fixed the issue in Elementary OS (Ubuntu LTS 14.04).

from gauge-python.

kashishm avatar kashishm commented on May 24, 2024

-u flag is just for unbuffered binary stdout and stderr, this should not fail/stop the runner.
This is a bug in runner. It happens when python executable is not present in /usr/bin
Could you please share the location of the python executable?
you can try creating a symlink of python in /usr/bin and refer it to python executable, this should fix the issue for now.

from gauge-python.

berndca avatar berndca commented on May 24, 2024

Interesting! I'm using pyenv (https://github.com/yyuu/pyenv) which changes the python path to

/home/bernd/.pyenv/shims/python

However I understand that since I'm using the latest version of getgauge I need python 3. That would mean to either call /usr/bin/python3 or work with a virtualenv. Changing /usr/bin/python to python3 is not an option. I ended up using a virtualenv and the path to the python executable in this context is

/home/bernd/Downloads/gauge/s5/gauge_venv/bin/python

You should be able to reproduce the by using a virtualenv.

from gauge-python.

berndca avatar berndca commented on May 24, 2024

It appears that you can not pass arguments to python when using /usr/bin/env:

https://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my/29620#29620

from gauge-python.

kashishm avatar kashishm commented on May 24, 2024

Thanks for the info @berndca. I have released a new version with the fix. Run the following commands to update the plugin and package.

gauge --update python
pip install getgauge --upgrade

Follow the docs, If print statements are getting printed at the end of execution.

from gauge-python.

berndca avatar berndca commented on May 24, 2024

Thanks! Did you consider to replace start.py with a start.sh in which PYTHONUNBUFFERED is set and the new/renamed start.py is called?

from gauge-python.

kashishm avatar kashishm commented on May 24, 2024

There were two solutions to this issue:

  • Add start.sh which will call start.py with PYTHONUNBUFFERED set as env var(as you suggested) or pass -u flag to python executable.
  • Add a python.properties file with PYTHONUNBUFFERED = 1 and let Gauge handle this while execution.

I implemented it using the second approach, but I think it would work with both the approcahes.

from gauge-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.