Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6859717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:19:06+00:00 2026-05-27T02:19:06+00:00

The code I’m trying to run: from fabric.api import * from fabric.contrib.files import *

  • 0

The code I’m trying to run:

from fabric.api import *
from fabric.contrib.files import *

def git():
    with cd('/home/something'):
        output = sudo('git log --pretty=oneline --no-color --abbrev-commit -n 1 HEAD')
        print repr(output)

Executed with fabric 0.9.something:

$ fab git
[localhost] Executing task 'git'
[localhost] sudo: git log --pretty=oneline --no-color --abbrev-commit -n 1 HEAD
Password for deploy@localhost: 
[localhost] out: 67bec96 Merge branch 'master' of /home/something
"67bec96 Merge branch 'master' of /home/something"

Executed with fabric 1.2.2:

$ fab git
[localhost] Executing task 'git'
[localhost] sudo: git log --pretty=oneline --no-color --abbrev-commit -n 1 HEAD
[localhost] Login password: 
[localhost] out: sudo password:
[localhost] out: 67bec96 Merge branch 'master' of /home/something
[localhost] out: 
"\x1b[?1h\x1b=\r67bec96 Merge branch 'master' of /home/something\x1b[m\r\n\r\x1b[K\x1b[?1l\x1b>"

You can see that output from fabric 1.2.2 has some unwanted escape characters around the actual output.

I tried using sudo(‘… ‘).stdout, but the result is the same.

Ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:19:07+00:00Added an answer on May 27, 2026 at 2:19 am

    As per Fabric’s changelog:

    As part of the changes made in #7, run and sudo have had the default value of their pty kwargs changed from False to True. This, plus the addition of the combine_stderr kwarg/env var, may result in significant behavioral changes in remote programs which operate differently when attached to a tty.

    Basically from 0.9 to 1.x default value has been swapped, hence your output difference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Code below does not run correctly and throws InvalidOperationExcepiton . public void Foo() {
code snippet: //byte[] myByteArray = byte array from database (database BLOB) myByteArray = (byte[])
Code: for i in {0..3}; do ping http://www.pythonchallenge.com/pc/def/$i.html; done A host should be found
Code sample: for file in files: do_something(root+file) I want to replace file with f
Code: # it's an ajax request, so parameters are passed via GET method def
code is here I am trying to make the Parent element visible when the
Code would explain this much better :) def a(): x=0 def b(z=x): print(X: %d,
I have a bunch of posts stored in text files formatted in yaml/textile (from
Code: //create the animation. $('img#header').hover(function(){ $(this).animate({top: -10px }, slow); I am trying to have
code: http://jsfiddle.net/WRppV/4/ I should get something like content=> [141, [203, 206, 204, 205], 142,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.