scalene icon indicating copy to clipboard operation
scalene copied to clipboard

Inconsistent behaviour between win & linux, this also clashes with lo…

Open alphabetagamer opened this issue 11 months ago • 3 comments

…ky spawn.py, loky backend spawn.py uses sys.executable expecting a str type

if sys.platform != 'win32': WINEXE = False WINSERVICE = False else: import msvcrt from multiprocessing.reduction import duplicate WINEXE = (sys.platform == 'win32' and getattr(sys, 'frozen', False)) WINSERVICE = str(sys.executable).lower().endswith("pythonservice.exe")

alphabetagamer avatar Mar 05 '24 06:03 alphabetagamer

Can you discuss this here esp. in light of the discussion and commits? https://github.com/plasma-umass/scalene/issues/784

emeryberger avatar Mar 06 '24 21:03 emeryberger

sys.executable is changed to support multiple process tracking so the test is probably correct. I'd recommend you look at that logic (which involves forcing Python processes to use Scalene instead of just invoking python).

emeryberger avatar Mar 07 '24 17:03 emeryberger

sys.executable is initialised with python_alias_dir / all_python_names[0] , shouldn't changing the type from Path to string be safe once initialized? sys.executable is a system variable accessed in other modules too. We are not keeping the original sys.executable value simply modifying the new value from Path type to string.

Edit: I understand the test case change should not be there,I have reverted the same

alphabetagamer avatar Mar 07 '24 18:03 alphabetagamer

Looks like the required changes were previously implemented; closing.

emeryberger avatar Jul 08 '24 20:07 emeryberger