From 77bbf7203baad5ba85d481f539e56d91e56d1933 Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Fri, 28 Jun 2024 08:55:36 -0400 Subject: [PATCH 1/2] don't place `config.py` dir on PYTHONPATH closes #1628 --- inst/config/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inst/config/config.py b/inst/config/config.py index b7a362211..55e8a3131 100644 --- a/inst/config/config.py +++ b/inst/config/config.py @@ -33,6 +33,7 @@ def module_path(name): # Get appropriate path-entry separator for platform pathsep = ";" if os.name == "nt" else ":" +this_script_dir = os.path.dirname(__file__) # Read default configuration values # fmt: off @@ -43,7 +44,8 @@ def module_path(name): "Prefix" : getattr(sys, "prefix", ""), "ExecPrefix" : getattr(sys, "exec_prefix", ""), "BaseExecPrefix" : getattr(sys, "base_exec_prefix", ""), - "PythonPath" : pathsep.join((x or "." for x in sys.path)), + "PythonPath" : pathsep.join((x or "." for x in sys.path + if x != this_script_dir)), "LIBPL" : sysconfig.get_config_var("LIBPL"), "LIBDIR" : sysconfig.get_config_var("LIBDIR"), "SharedLibrary" : sysconfig.get_config_var("Py_ENABLE_SHARED"), From 4dd53196db53e23c90f57aec4c9fd2762ef70bb2 Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Fri, 28 Jun 2024 08:56:32 -0400 Subject: [PATCH 2/2] add NEWS --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 4af8554bf..1b30c2d6d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # reticulate (development version) +- Fixed error when importing a module named `config` (#1628) + # reticulate 1.38.0 - Python Exceptions converted to R conditions are now R lists instead