Jérôme Laheurte

Results 30 comments of Jérôme Laheurte

I've come across this already. This is very old: 1. The case of the service methods is wrong (Run instead of run, etc), so it won't even work as is...

Looking at the source (Win32Service.c), the Python interpreter is indeed initialized in wmain(), the import and instantiation done from Service_Main, which is called (I think) from a service manager thread....

I also see that there's a fallback to CamelCase methods in there, for backward compatibility I guess, but the gist still won't work with Python >= 3.7 :)

Okay! I'll work on this and send a PR monday (early week-end now)

Done in PR #1572. I added a sample of service using asyncio. It works well for my own code.

As a submodule, using the "git clone --recursive" command-line in the README.

No rush anyway. I went on and used it for an HID-based project and I didn't have any problem there. I'll dig a bit if said project leaves me enough...

FYI I've been testing this branch as well for a few days at work and it seems pretty stable.

The simplest way to make this work would be to use directly SERVICE_TABLE_ENTRYW and StartServiceCtrlDispatcherW (Unicode versions) so that Service_Main actually gets a wchar_t** argv. Is that OK with you?