sayak-m / shcov

Automatically exported from code.google.com/p/shcov
GNU General Public License v2.0
0 stars 0 forks source link

IOError: [Errno 9] Bad file descriptor when running shcov on Mac OSX #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. echo -e '#!/bin/bash\necho "Some test message"\n' > test.sh
2. chmod +x test.sh
3. ./shcov test.sh

What is the expected output? What do you see instead?
I expected to get 'Some test message'. What I got was that and a traceback.

What version of the product are you using? On what operating system?
commit 3c3e16a0b49eb4b695107f842b5d7b387b70e5ab
Mac OSX 10.6.8
Python 2.7.6

Please provide any additional information below.

The error doesn't seem to be file related, because if I give it a non-existent 
file is throws the same traceback. This works on a RHEL6 system I have 
elsewhere.

$ cat test.sh
#!/bin/bash
echo "Some test message"

$ ./shcov test.sh
Traceback (most recent call last):
  File "./shcov", line 176, in <module>
    out = sc.parse_output()
  File "./shcov", line 109, in parse_output
    self.process.stderr.flush()
IOError: [Errno 9] Bad file descriptor
Some test message

$ ./shcov jfdkls
Traceback (most recent call last):
  File "./shcov", line 176, in <module>
    out = sc.parse_output()
  File "./shcov", line 109, in parse_output
    self.process.stderr.flush()
IOError: [Errno 9] Bad file descriptor

$ ./shcov --help;
Usage: shcov [-h] [--output=where] [--shell=what] script...

Produce coverage data for 'script'. Options are

  --output=where  write data to 'where' instead of /tmp/shcov
  --shell=what    ues 'what' (including arguments) as shell instead of 'bash -x'

Original issue reported on code.google.com by hami...@comcast.net on 14 Feb 2014 at 5:28

GoogleCodeExporter commented 8 years ago
I believe that particular error has been fixed by Nils in this fork:

  https://github.com/pyssling/shcov

I've pushed the commit to the main repo.

I don't have Mac OS (I have a mac, but run Fedora on it), so perhaps you could 
test the change?

Original comment by simon.ka...@gmail.com on 14 Feb 2014 at 6:05

GoogleCodeExporter commented 8 years ago
I would be happy to, but this is my first foray into GitHub and I can't 
figure out how get it. I've used git for a few years at work, but the 
GitHub model is different than what we use. I created a fork with the 
web interface, and cloned (and pushed to) that fork from my machine.

$ git remote -v
origin    https://github.com/Mark-E-Hamilton/shcov.git (fetch)
origin    https://github.com/Mark-E-Hamilton/shcov.git (push)

I don't know what to do next, however, and doing a pull doesn't get 
anything new, so it's clearly not in my fork. Do I need to add a remote 
for the pyssling repository, or for some other repository?

Mark E. Hamilton

Original comment by hami...@comcast.net on 14 Feb 2014 at 6:08

GoogleCodeExporter commented 8 years ago
I've pushed it to my repo, so you should be able to bring in that, basically

  git remote add upstream https://github[...]/SimonKagstrom/shcov.git
  git fetch upstream
  git merge upstream

Original comment by simon.ka...@gmail.com on 14 Feb 2014 at 6:19

GoogleCodeExporter commented 8 years ago
I figured it out, with the help of this page. Google is your friend!

https://help.github.com/articles/syncing-a-fork

However, it still fails with the same 'Bad file descriptor' error. Sorry.

Mark.

Original comment by hami...@comcast.net on 14 Feb 2014 at 6:22

GoogleCodeExporter commented 8 years ago
OK, then it's some other issue. Thanks for testing!

Original comment by simon.ka...@gmail.com on 14 Feb 2014 at 6:31