Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: python-distro/distro
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.9.0
Choose a base ref
...
head repository: python-distro/distro
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 2 commits
  • 5 files changed
  • 3 contributors

Commits on Apr 17, 2024

  1. Fix Armbian release info (#366)

    Co-authored-by: Samuel FORESTIER <samuel+dev@forestier.app>
    pedrolamas and HorlogeSkynet authored Apr 17, 2024
    Configuration menu
    Copy the full SHA
    7ce285c View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2024

  1. Handle CalledProcessError when calling uname

    Usually, when `distro` is used in Windows, it returns nothing. Any call to `lsb_release`, `uname', etc, raises a `[[WinError 2] The system cannot find the file specified` error, which is properly handled.
    However, in a particular environment where I've run it, I've found that the call to `uname` raises a `CalledProcessError`, because a Policy or a Security Control is injecting a non-zero return code:
    
    ```
    t=2024-10-04T15:13:39+0200  Command '('uname', '-rs')' returned non-zero exit status 3221225794.
    Traceback (most recent call last):
      File "C:\...\main.py", line 123, in __check_supported_platform
        distro_id = distro.id()
                    ^^^^^^^^^^^
      File "C:\...\site-packages\distro\distro.py", line 284, in id
        return _distro.id()
               ^^^^^^^^^^^^
      File "C:\...\site-packages\distro\distro.py", line 855, in id
        distro_id = self.uname_attr("id")
                    ^^^^^^^^^^^^^^^^^^^^^
      File "C:\...\site-packages\distro\distro.py", line 1088, in uname_attr
        return self._uname_info.get(attribute, "")
               ^^^^^^^^^^^^^^^^
      File "C:\...\lib\functools.py", line 995, in __get__
        val = self.func(instance)
              ^^^^^^^^^^^^^^^^^^^
      File "C:\...\site-packages\distro\distro.py", line 1202, in _uname_info
        stdout = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\...\lib\subprocess.py", line 466, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\...\lib\subprocess.py", line 571, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '('uname', '-rs')' returned non-zero exit status 3221225794.
    ```
    
    We do handle `CalledProcessError` in other calls, so I'm adding to
    `uname` too.
    Manuel Muradas authored and HorlogeSkynet committed Oct 26, 2024
    Configuration menu
    Copy the full SHA
    3bd19e6 View commit details
    Browse the repository at this point in the history
Loading