Skip to content

remote.pull prints Already up-to-date. #437

Description

@barry-scott

The command print "Already up-to-date" to the console.

It seems that problem is the use of with_stdout=False that then does not both to do anything to stdout.

git-python-with-stdout.txt

The attached patch seems to fix the problem by setting stdout to DEVNULL. Tested on python 3.4.

Activity

  1. self-assigned this
    on May 24, 2016
  2. Byron commented on May 24, 2016

    @Byron
    Member

    I believe it's the default and expected behaviour to use the parent-process file handles in subprocesses. Thus stdin and stdout will be cloned from the terminal in some cases.

    However, the way the parameter is documented indicates the intention was different: If True, default True, we open stdout on the created process, and I guess otherwise you don't show anything.

    Unfortunately DEVNULL is only available in python >=3.3, and the alternative, popen(stdout=open(os.devnull, 'wb'), ...) leaves me puzzled about who is going to close the opened file-handle.

    Do you have any information on this ? Opening a stderr permanently and reusing the file-handle would be easy enough, but at least I'd like to know what this means for resource handling.

    In the meanwhile, I will test it a little more.

  3. Byron commented on May 24, 2016

    @Byron
    Member

    Great, it looks like Popen takes care of the details automatically for you, and closes the freshly opened file-handle (or transfers it to the subprocess, who knows).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions