Code Monkey home page Code Monkey logo

Comments (12)

youssefhabri avatar youssefhabri commented on May 18, 2024 1

As @matchai said, it's an issue with Python 2 (issue 28160), which was changed in Python 3.4.
This could mean that all Python 3 versions prior to 3.4 might have similar behaviour.

from starship.

jletey avatar jletey commented on May 18, 2024 1

@youssefhabri I'm going to try and fix this, as many people still use Python version <= 3.4.

from starship.

jletey avatar jletey commented on May 18, 2024

@youssefhabri I'm sorry, but I can't reproduce this error ... everything works fine in my terminal:

Shot 2019-05-15 at 07 08 55

Are you using the latest code from master? (although I wouldn't think that would affect anything)
@matchai Do you know what's going on?

from starship.

matchai avatar matchai commented on May 18, 2024

This is likely due to them using a release candidate version of Python. 🤔

from starship.

youssefhabri avatar youssefhabri commented on May 18, 2024

I've added a dbg! here:

match Command::new("python").arg("--version").output() {
    Ok(output) => {
        dbg!(&output);
        Some(String::from_utf8(output.stdout).unwrap())
    },
    Err(_) => None,
}

and this is what I get:

[src/modules/python.rs:50] &output = Output {
    status: ExitStatus(
        ExitStatus(
            0
        )
    ),
    stdout: "",
    stderr: "Python 2.7.15rc1\n"
}

from starship.

youssefhabri avatar youssefhabri commented on May 18, 2024

this seems to be only happen with python2, which python is linked to. When I change to python3 it works fine.

from starship.

jletey avatar jletey commented on May 18, 2024

@youssefhabri that's extremely weird ... not quite sure how to approach this as if the user has both python2 and python3, then if we check both we won't know which version to use.

from starship.

matchai avatar matchai commented on May 18, 2024

I think we should use whatever is linked to python instead of considering python2 or python3, as it works right now.

from starship.

jletey avatar jletey commented on May 18, 2024

so this is resolved?

from starship.

matchai avatar matchai commented on May 18, 2024

The problem seems to be that when python is linked to python2, the version no longer appears.

from starship.

jletey avatar jletey commented on May 18, 2024

so nothing to be changed at the moment?

from starship.

matchai avatar matchai commented on May 18, 2024

The issue appears to be that Python 2 logs it's version to stderr but we check stdout. We can retrofit the implementation to work with Python 2.

from starship.

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.