celery / billiard

Multiprocessing Pool Extensions
Other
419 stars 252 forks source link

AttributeError: 'module' object has no attribute '__spec__' on windows #314

Closed xiva-wgt closed 4 years ago

xiva-wgt commented 4 years ago

`' File "c:\python27\lib\site-packages\billiard\spawn.py", line 338, in _fixup_main_from_name ' File "c:\python27\lib\site-packages\billiard\spawn.py", line 165, in spawn_main module' object has no attribute 'spec' module' object has no attribute 'spec' if getattr(current_main.spec, "name", None) == mod_name:

exitcode = _main(fd) AttributeError File "c:\python27\lib\site-packages\billiard\spawn.py", line 205, in _main : 'prepare(preparation_data) module' object has no attribute 'spec' File "c:\python27\lib\site-packages\billiard\spawn.py", line 320, in prepare

_fixup_main_from_name(data['init_main_from_name'])

File "c:\python27\lib\site-packages\billiard\spawn.py", line 338, in _fixup_main_from_name if getattr(current_main.spec, "name", None) == mod_name: AttributeError: 'module' object has no attribute 'spec'`

at this point there is a check for a nonexistent attribute https://github.com/celery/billiard/blob/ca3220ba4596ac7bb03f64b80e91878353fc5be1/billiard/spawn.py#L264

in another place there is no check and an error occurs https://github.com/celery/billiard/blob/ca3220ba4596ac7bb03f64b80e91878353fc5be1/billiard/spawn.py#L338