Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] AttributeError: module 'os' has no attribute 'fork' #7

Open
CaedenPH opened this issue Nov 6, 2022 · 1 comment
Open

[Bug] AttributeError: module 'os' has no attribute 'fork' #7

CaedenPH opened this issue Nov 6, 2022 · 1 comment

Comments

@CaedenPH
Copy link

CaedenPH commented Nov 6, 2022

When running

hap run py .\while_test.py

Python version: 3.10.8
Hap version: 0.1.6

Traceback (most recent call last):
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\Scripts\hap.exe\__main__.py", line 7, in <module>
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\hapless\cli.py", line 101, in run
    hapless.run(cmd_escaped, name=name, check=check)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\hapless\main.py", line 253, in run
    pid = os.fork()
AttributeError: module 'os' has no attribute 'fork'
PS C:\Users\caeden\Github\hap-test> hap run py .\while_test.py
Traceback (most recent call last):
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\Scripts\hap.exe\__main__.py", line 7, in <module>
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\hapless\cli.py", line 101, in run
    hapless.run(cmd_escaped, name=name, check=check)
  File "C:\Users\caeden\AppData\Local\Programs\Python\Python310\lib\site-packages\hapless\main.py", line 253, in run
    pid = os.fork()
AttributeError: module 'os' has no attribute 'fork'

Seems like an issue because I'm using it on windows

@CaedenPH CaedenPH changed the title Bug AttributeError: module 'os' has no attribute 'fork' [Bug] AttributeError: module 'os' has no attribute 'fork' Nov 6, 2022
@bmwant
Copy link
Owner

bmwant commented Nov 6, 2022

Right, Windows is not supported yet. The issue basically that this OS does not support fork-ing for the process. We might need to add spawn support instead to make it work on Windows too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants