mirror of
https://github.com/cascadium/wsl-windows-toolbar-launcher.git
synced 2026-04-26 13:05:53 +03:00
[GH-ISSUE #12] Some windows executables missing makes failures not graceful #11
Labels
No labels
duplicate
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/wsl-windows-toolbar-launcher#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ringtailedfox on GitHub (Jun 9, 2020).
Original GitHub issue: https://github.com/cascadium/wsl-windows-toolbar-launcher/issues/12
The script installs just fine, but if i try to run it with Python 3.8.3 x64 for Windows, I get this odd error:
C:>wsl-windows-toolbar
Traceback (most recent call last):
File "C:\Python38-x64\lib\runpy.py", line 194, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Python38-x64\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Python38-x64\Scripts\wsl-windows-toolbar.exe_main.py", line 4, in
File "C:\Python38-x64\lib\site-packages\wsl_windows_toolbar\wsl_windows_toolbar.py", line 8, in
import magic
File "C:\Python38-x64\lib\site-packages\magic.py", line 179, in
libmagic = ctypes.CDLL(dll)
File "C:\Python38-x64\lib\ctypes_init.py", line 373, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
@fquinner commented on GitHub (Jun 10, 2020):
Hi there! The script needs to run within the wsl environment itself rather than on windows. I'll try and and add something to script to avoid what you did and make it a little more intuitive.
@ringtailedfox commented on GitHub (Jun 11, 2020):
ahhh, okay that makes a lot more sense! I figured either I did something wrong, or was misunderstanding something... okay. thanks for the rapid response! :D
@fcjbispo commented on GitHub (Oct 29, 2020):
This is what happens if it is called insid wsl:
fcjbispo@RAGNAROK:/mnt/c/Users/fcjbispo$ wsl-windows-toolbar Traceback (most recent call last): File "/home/fcjbispo/.local/bin/wsl-windows-toolbar", line 5, in <module> from wsl_windows_toolbar.wsl_windows_toolbar import cli File "/home/fcjbispo/.local/lib/python3.8/site-packages/wsl_windows_toolbar/wsl_windows_toolbar.py", line 26, in <module> WINDOWS_USERPROFILE = subprocess.check_output( File "/usr/lib/python3.8/subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.8/subprocess.py", line 489, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.8/subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'cmd.exe'What do you mean with: "The script needs to run within the wsl environment itself rather than on windows." ?
@fquinner commented on GitHub (Oct 29, 2020):
You'll need cmd.exe to be in your PATH too even when executing from within WSL :)
I mean it needs to be run within WSL bash. The originally reported issue was run from a windows shell.
@matthieudesprez commented on GitHub (Oct 31, 2020):
In my case that did the trick, because the script also needs powershell.exe
@fquinner commented on GitHub (Nov 29, 2020):
These are now checked on startup and will fail gracefully of not present in 0.6.0