Skip to content

Python 2 & 3 compatible code - #14

Open
CrimsonGlory wants to merge 10 commits into
pturmel:masterfrom
CrimsonGlory:master
Open

Python 2 & 3 compatible code#14
CrimsonGlory wants to merge 10 commits into
pturmel:masterfrom
CrimsonGlory:master

Conversation

@CrimsonGlory

@CrimsonGlory CrimsonGlory commented May 9, 2024

Copy link
Copy Markdown

I have adapted the code so that it is compatible both with python 2.7 and python 3.
The code was tested with python versions 2.7.12, 2.7.17, 3.5.2 and 3.6.9 (just because those were the versions installed on the machines that I have with raid).

@genterminl

Copy link
Copy Markdown

I just tried this and get an error:

Traceback (most recent call last):
  File "/usr/local/src/lsdrv/lsdrv/./lsdrv-pr14", line 432, in <module>
    devstat = os.stat(mdev)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/root'

The relevant line from /proc/mounts is "/dev/root / ext4 rw,noatime 0 0" and /dev/root does not expolicitly exist. I'm on Gentoo with kernel 6.14.5. I'm not really sure which utility or python call should be able to figure out the real device here (/dev/nvme0n1p2 in my case.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants