os.popen leaving a zombie #13239
-
I'm not very familiar with python so this might be just a simple problem. I am running micropython 1.18 on openwrt 22 on a wall switch (rt5350) and can't easily upgrade. I am using micropython to communicate with a mqtt broker. It is working for the most part, but one of the things it is doing is checking the status of the uhttpd server (and controlling it). The code for checkoing the status is:
So I run a command check the output and publish the result. The problem is that the command leaves a zombie process everytime it is run.
When I start I publish the current status and this is what I get. What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
I'm not sure what you're running here. MicroPython doesn't support pipes or subprocesses. Note the lack of MicroPython v1.20.0-450-g3637252b7 on 2023-09-06; linux [GCC 11.4.0] version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import os
>>> dir(os)
['__class__', '__name__', 'remove', 'sep', '__dict__', 'VfsFat', 'VfsLfs1', 'VfsLfs2', 'VfsPosix', 'chdir', 'errno', 'getcwd', 'getenv', 'ilistdir', 'listdir', 'mkdir', 'mount', 'putenv', 'rename', 'rmdir', 'stat', 'statvfs', 'system', 'umount', 'unlink', 'unsetenv', 'urandom'] or >>> 'popen' in dir(os)
False |
Beta Was this translation helpful? Give feedback.
-
It's supported in the micropython-lib. Maybe I posted this in the wrong forum. I didn't know there was one for discussing the libraries, I figured they were so closely connected that people here would know. Sorry about that. Any idea where I should ask my question? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Should I open an issue do you think? Is it fixable? The zombies make the function pretty useless, for me at least. I needed the output so I used:
|
Beta Was this translation helpful? Give feedback.
Should I open an issue do you think? Is it fixable? The zombies make the function pretty useless, for me at least.
I needed the output so I used: