dfeneyrou / palanteer

Visual Python and C++ nanosecond profiler, logger, tests enabler
Other
2.08k stars 87 forks source link

Palanteer is stuck when following a python script that call platform.uname() #44

Open EmmanuelAllasia opened 1 week ago

EmmanuelAllasia commented 1 week ago

Hello !

Using Python3.11 with Windows 10 & 11 with the last version of palanteer release 0.7.1 (https://github.com/dfeneyrou/palanteer/releases/tag/v0.7.1)

If there is a call to platform.uname() in the python application, palanteer remain stuck and nothing happen.

https://docs.python.org/3/library/platform.html#platform.uname It's getting stuck at sys.platform_version() And in this part of the code:

for cmd in ('ver', 'command /c ver', 'cmd /c ver'):
    try:
        info = subprocess.check_output(cmd,
                                       stdin=subprocess.DEVNULL,
                                       stderr=subprocess.DEVNULL,
                                       text=True,
                                       encoding="locale",
                                       shell=True)

FYI when running using Pycharm Debugger, this issue is not present.

dfeneyrou commented 1 week ago

I can reproduce it indeed on Windows 11 with Python 3.11, only when profiled, with a simple call to subprocess.run("dir"). A probable hypothesis is that platform.uname() is also using subprocesses. I need some time to investigate, especially as Windows is not my usual platform. Can you confirm that you did not see this issue with Python 3.10?