This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 0c1905951f8c [SPARK-49820][PYTHON] Change `raise IOError` to `raise
OSError`
0c1905951f8c is described below
commit 0c1905951f8c31482b0f5ea334c29c13a83cc3c5
Author: Bjørn Jørgensen <[email protected]>
AuthorDate: Sat Sep 28 08:52:13 2024 +0900
[SPARK-49820][PYTHON] Change `raise IOError` to `raise OSError`
### What changes were proposed in this pull request?
Change `raise IOError` to `raise OSError`
### Why are the changes needed?
> 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.
>
[RUFF rule](https://docs.astral.sh/ruff/rules/os-error-alias/)
[Python OSError](https://docs.python.org/3/library/exceptions.html#OSError)
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass GA
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #48287 from bjornjorgensen/IOError-to--OSError.
Authored-by: Bjørn Jørgensen <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
---
python/pyspark/install.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/pyspark/install.py b/python/pyspark/install.py
index 90b0150b0a8c..ba67a157e964 100644
--- a/python/pyspark/install.py
+++ b/python/pyspark/install.py
@@ -163,7 +163,7 @@ def install_spark(dest, spark_version, hadoop_version,
hive_version):
tar.close()
if os.path.exists(package_local_path):
os.remove(package_local_path)
- raise IOError("Unable to download %s." % pretty_pkg_name)
+ raise OSError("Unable to download %s." % pretty_pkg_name)
def get_preferred_mirrors():
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]