I've been using the win32print module for Python to delete print jobs older than 14 days. That worked quite well, but now I also wanted to get the status(online/offline/out of paper/...) of the printer and I'm facing the problem, that i always get the status code '0', no matter what status of the printer. I also read through this and this. But i only learned, that the module should return a bitmask of all status that apply to the printer.
I have no clue what is causing the problem, that i always get "Unknown" as status.
Happens even in this simple code:
for printer in win32print.EnumPrinters(3):
printer_handler = win32print.OpenPrinter(printer[2])
printer_info = win32print.GetPrinter(printer_handler, 2)
print(printer_info["Status"])
win32print.ClosePrinter(printer_handler)
Hope someone of you knows, what could possible cause this problem. Thanks :)