Comments (7)
How can I set up a reproduction to investigate this?
from shellingham.
I've opened a PR (#36) with a Github actions workflow testing this. Which is failing on macOS but passing on Linux.
Edit: https://github.com/ids1024/shellingham/actions/runs/280891996
from shellingham.
Or, or I guess on Linux, ps
not run in a terminal lists all processes that aren't in a terminal, so this is failing for me as well, since I don't have any shells that aren't connected to a tty:
import os
import fcntl
import termios
import subprocess
import shellingham
fd = os.open("/dev/tty", os.O_RDWR | os.O_NOCTTY)
fcntl.ioctl(fd, termios.TIOCNOTTY, '')
os.close(fd)
subprocess.call(["ps"])
print(shellingham.detect_shell())
Traceback (most recent call last):
File "test.py", line 12, in <module>
print(shellingham.detect_shell())
File "/home/ian/src/shellingham/shellingham/__init__.py", line 25, in detect_shell
raise ShellDetectionFailure()
shellingham._core.ShellDetectionFailure
from shellingham.
on Linux,
ps
not run in a terminal lists all processes that aren't in a terminal
Hmm. I wonder why that’d work on GitHub Actions though? Shellingham tests the shell is in the current process’s parent chain, so maybe it’s detecting the login shell in this case? If so, this arguably be attributed to a Linux quirk and unfixable in shellingham.
from shellingham.
Nope, there is legistimately a shell detected, persuambly the one used to run the commands you specify in run
. But why does not the macOS worker have the same thing? I guess GitHub Actions is just implemented differently for different platforms, and there’s no real solution here.
from shellingham.
It's a pain to debug with actually having a Mac to try things on locally, but it seemed when I just ran ps
on a macOS GitHub action runner, it produced no output. So it seems the behavior of ps
on macOS is different when there's not a connected tty.
Using something like ps -e
to list all processes would probably fix it. If that's portable. Glancing at the ps(1)
man page on Linux, it seems there's a fair bit of variation between different implementations and standards.
from shellingham.
For whatever reason this is fixed by #49
Edit: I just realised this is because #49 changes the GitHub actions to instead run the tests using pytest.
from shellingham.
Related Issues (20)
- setup.py is not added to tag 1.3.2 ¿? HOT 1
- Can we correctly detect the full path of the shell for windows? HOT 3
- Officially support Python 3.7+ HOT 3
- WinError using pipenv in Pypy HOT 1
- Shell detection failure inside docker image on ARM Macbook HOT 10
- New release HOT 6
- [1.5.0] Incorrectly List by Pypi as Available for Python < 3.7 HOT 1
- [1.5.0] Please Yank 1.5.0 and Release 1.5.1 for Limit package installation to Python >= 3.7 HOT 2
- Doesn't detect powershell on win32 HOT 5
- doesn't detect bash on win32 HOT 7
- [Question] Are you open to adding type annotations? HOT 3
- sdist is missing tests HOT 1
- Fails to detect shell in docker containers run with rosetta on Apple Silicon HOT 1
- error with shellingham HOT 1
- ShellDetectionFailure for zsh HOT 10
- unsupported proc format HOT 6
- tests/test_posix.py::test_get_shell[mapping0-result0] fails with 1.5.2+ HOT 1
- Always detects fish
- Configure Pypi trusted publishing pipeline HOT 1
- Dash prefix does not always imply login shell HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shellingham.