How do you sudo with xonsh?

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I get the error xonsh: subprocess mode: permission denied: sudo.










share|improve this question























  • Can you run sudo successfully when you're not using xonsh?
    – larsks
    Aug 12 '15 at 18:47










  • Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
    – Emre
    Aug 12 '15 at 18:52















up vote
1
down vote

favorite












I get the error xonsh: subprocess mode: permission denied: sudo.










share|improve this question























  • Can you run sudo successfully when you're not using xonsh?
    – larsks
    Aug 12 '15 at 18:47










  • Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
    – Emre
    Aug 12 '15 at 18:52













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I get the error xonsh: subprocess mode: permission denied: sudo.










share|improve this question















I get the error xonsh: subprocess mode: permission denied: sudo.







shell sudo xonsh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 19 at 14:03









Anthony Geoghegan

7,32633852




7,32633852










asked Aug 12 '15 at 18:19









Emre

18518




18518











  • Can you run sudo successfully when you're not using xonsh?
    – larsks
    Aug 12 '15 at 18:47










  • Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
    – Emre
    Aug 12 '15 at 18:52

















  • Can you run sudo successfully when you're not using xonsh?
    – larsks
    Aug 12 '15 at 18:47










  • Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
    – Emre
    Aug 12 '15 at 18:52
















Can you run sudo successfully when you're not using xonsh?
– larsks
Aug 12 '15 at 18:47




Can you run sudo successfully when you're not using xonsh?
– larsks
Aug 12 '15 at 18:47












Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
– Emre
Aug 12 '15 at 18:52





Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
– Emre
Aug 12 '15 at 18:52











1 Answer
1






active

oldest

votes

















up vote
5
down vote



accepted










It's a bug in xonsh. In the build_ins.py module, xonsh attempts to determine if a file is "binary" or not by opening it and reading a few bytes:



 def _is_binary(fname, limit=80):
with open(fname, 'rb') as f:
for i in range(limit):
char = f.read(1)
if char == b'':
return True
if char == b'n':
return False
if char == b'':
return False
return False


Security sensitive programs like sudo are often executable but not readable, so this blows up.






share|improve this answer




















  • Here is a possible patch for this behavior.
    – larsks
    Aug 12 '15 at 19:11










  • Thanks. I don't understand how nobody realized sudo doesn't work.
    – Emre
    Aug 12 '15 at 20:48










  • My guess is that not many people are using xonsh. It's not something I had ever heard of until I saw your question.
    – larsks
    Aug 12 '15 at 20:49






  • 1




    To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
    – Anthony Scopatz
    Aug 18 '15 at 1:11






  • 1




    The bug has now been fixed in master. Sorry about the problem in the first place.
    – Anthony Scopatz
    Aug 18 '15 at 14:21










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f222845%2fhow-do-you-sudo-with-xonsh%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote



accepted










It's a bug in xonsh. In the build_ins.py module, xonsh attempts to determine if a file is "binary" or not by opening it and reading a few bytes:



 def _is_binary(fname, limit=80):
with open(fname, 'rb') as f:
for i in range(limit):
char = f.read(1)
if char == b'':
return True
if char == b'n':
return False
if char == b'':
return False
return False


Security sensitive programs like sudo are often executable but not readable, so this blows up.






share|improve this answer




















  • Here is a possible patch for this behavior.
    – larsks
    Aug 12 '15 at 19:11










  • Thanks. I don't understand how nobody realized sudo doesn't work.
    – Emre
    Aug 12 '15 at 20:48










  • My guess is that not many people are using xonsh. It's not something I had ever heard of until I saw your question.
    – larsks
    Aug 12 '15 at 20:49






  • 1




    To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
    – Anthony Scopatz
    Aug 18 '15 at 1:11






  • 1




    The bug has now been fixed in master. Sorry about the problem in the first place.
    – Anthony Scopatz
    Aug 18 '15 at 14:21














up vote
5
down vote



accepted










It's a bug in xonsh. In the build_ins.py module, xonsh attempts to determine if a file is "binary" or not by opening it and reading a few bytes:



 def _is_binary(fname, limit=80):
with open(fname, 'rb') as f:
for i in range(limit):
char = f.read(1)
if char == b'':
return True
if char == b'n':
return False
if char == b'':
return False
return False


Security sensitive programs like sudo are often executable but not readable, so this blows up.






share|improve this answer




















  • Here is a possible patch for this behavior.
    – larsks
    Aug 12 '15 at 19:11










  • Thanks. I don't understand how nobody realized sudo doesn't work.
    – Emre
    Aug 12 '15 at 20:48










  • My guess is that not many people are using xonsh. It's not something I had ever heard of until I saw your question.
    – larsks
    Aug 12 '15 at 20:49






  • 1




    To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
    – Anthony Scopatz
    Aug 18 '15 at 1:11






  • 1




    The bug has now been fixed in master. Sorry about the problem in the first place.
    – Anthony Scopatz
    Aug 18 '15 at 14:21












up vote
5
down vote



accepted







up vote
5
down vote



accepted






It's a bug in xonsh. In the build_ins.py module, xonsh attempts to determine if a file is "binary" or not by opening it and reading a few bytes:



 def _is_binary(fname, limit=80):
with open(fname, 'rb') as f:
for i in range(limit):
char = f.read(1)
if char == b'':
return True
if char == b'n':
return False
if char == b'':
return False
return False


Security sensitive programs like sudo are often executable but not readable, so this blows up.






share|improve this answer












It's a bug in xonsh. In the build_ins.py module, xonsh attempts to determine if a file is "binary" or not by opening it and reading a few bytes:



 def _is_binary(fname, limit=80):
with open(fname, 'rb') as f:
for i in range(limit):
char = f.read(1)
if char == b'':
return True
if char == b'n':
return False
if char == b'':
return False
return False


Security sensitive programs like sudo are often executable but not readable, so this blows up.







share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 12 '15 at 19:03









larsks

10k32738




10k32738











  • Here is a possible patch for this behavior.
    – larsks
    Aug 12 '15 at 19:11










  • Thanks. I don't understand how nobody realized sudo doesn't work.
    – Emre
    Aug 12 '15 at 20:48










  • My guess is that not many people are using xonsh. It's not something I had ever heard of until I saw your question.
    – larsks
    Aug 12 '15 at 20:49






  • 1




    To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
    – Anthony Scopatz
    Aug 18 '15 at 1:11






  • 1




    The bug has now been fixed in master. Sorry about the problem in the first place.
    – Anthony Scopatz
    Aug 18 '15 at 14:21
















  • Here is a possible patch for this behavior.
    – larsks
    Aug 12 '15 at 19:11










  • Thanks. I don't understand how nobody realized sudo doesn't work.
    – Emre
    Aug 12 '15 at 20:48










  • My guess is that not many people are using xonsh. It's not something I had ever heard of until I saw your question.
    – larsks
    Aug 12 '15 at 20:49






  • 1




    To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
    – Anthony Scopatz
    Aug 18 '15 at 1:11






  • 1




    The bug has now been fixed in master. Sorry about the problem in the first place.
    – Anthony Scopatz
    Aug 18 '15 at 14:21















Here is a possible patch for this behavior.
– larsks
Aug 12 '15 at 19:11




Here is a possible patch for this behavior.
– larsks
Aug 12 '15 at 19:11












Thanks. I don't understand how nobody realized sudo doesn't work.
– Emre
Aug 12 '15 at 20:48




Thanks. I don't understand how nobody realized sudo doesn't work.
– Emre
Aug 12 '15 at 20:48












My guess is that not many people are using xonsh. It's not something I had ever heard of until I saw your question.
– larsks
Aug 12 '15 at 20:49




My guess is that not many people are using xonsh. It's not something I had ever heard of until I saw your question.
– larsks
Aug 12 '15 at 20:49




1




1




To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
– Anthony Scopatz
Aug 18 '15 at 1:11




To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
– Anthony Scopatz
Aug 18 '15 at 1:11




1




1




The bug has now been fixed in master. Sorry about the problem in the first place.
– Anthony Scopatz
Aug 18 '15 at 14:21




The bug has now been fixed in master. Sorry about the problem in the first place.
– Anthony Scopatz
Aug 18 '15 at 14:21

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f222845%2fhow-do-you-sudo-with-xonsh%23new-answer', 'question_page');

);

Post as a guest













































































9E u PWYRsdqC2,hAnWkIXg98,r0ye JtSCe2w,9mnA67 dI4AgjJ Zys7nME,J,xN55MVVcQR,pY0U,B9fDbfYJ48CzKcrb4 SnXxwBnQwy,1Q,Ae
j,f9HNH 9d 6X3cAJ8NZKIH2d,0SOa7emv1lKK

Popular posts from this blog

How to check contact read email or not when send email to Individual?

How many registers does an x86_64 CPU actually have?

Displaying single band from multi-band raster using QGIS