79461604

Date: 2025-02-23 17:07:59
Score: 2.5
Natty:
Report link

Since I do not have the reputation to comment yet, I would like to add that (at least) in my case the python code line in the (otherwise excellent) first answer

print("Hard Disk Model: %s" % model)

outputs a bytes object rather than a regular Unicode string; you might want to re-write this (and the following) line as

print(f"Hard Disk Model: {model.decode('utf-8')}")

Second, if called by a non-existant drive, an OSError 22 ("Invalid argument") is thrown when calling fcntl.ioctl. You might want to embed that part of the code in try/except.

Reasons:
  • Blacklisted phrase (1): to comment
  • RegEx Blacklisted phrase (1.5): I do not have the reputation to comment
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: THN