Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle non-UTF-8 device models #108

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Sep 23, 2024

  1. Handle non-UTF-8 device models

    Took me a while to figure out why Fedora 40 installer was dying on me
    on a Wyse 3040 thin client and I finally narrowed it down to pyparted
    and found the associated issue (linked).
    
    The fix proposed in the issue comments worked for me so I figured I'd
    send a PR.
    
    Before:
    
        >>> import parted
        >>> parted.getDevice('/dev/mmcblk0').model
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          File "/root/pyparted/build/lib.linux-x86_64-cpython-312/parted/device.py", line 69, in model
            return self.__device.model
                   ^^^^^^^^^^^^^^^^^^^
        UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 9: invalid start byte
    
    After:
    
        >>> import parted
        >>> parted.getDevice('/dev/mmcblk0').model
        'MMC H8G4a�'
    
    Resolves: dcantrell#76
    jstasiak committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    17687ec View commit details
    Browse the repository at this point in the history