Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-49820

change IOError to OSError

    XMLWordPrintableJSON

Details

    Description

      OSError is the builtin error type used for exceptions that relate to the operating system.

      In Python 3.3, a variety of other exceptions, like WindowsError were aliased to OSError. These aliases remain in place for compatibility with older versions of Python, but may be removed in future versions.

      Prefer using OSError directly, as it is more idiomatic and future-proof.

      Example

      raise IOError
      Use instead:

      raise OSError

      https://docs.astral.sh/ruff/rules/os-error-alias/
      https://docs.python.org/3/library/exceptions.html#OSError

      Attachments

        Issue Links

          Activity

            People

              bjornjorgensen Bjørn Jørgensen
              bjornjorgensen Bjørn Jørgensen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: