diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 105629bda19..939315379f2 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -3491,6 +3491,7 @@ def test_spawnl(self): self.assertEqual(exitcode, self.exitcode) @requires_os_func('spawnle') + @unittest.skipIf(sys.platform == 'win32', "TODO: RUSTPYTHON; fix spawnve on Windows") def test_spawnle(self): program, args = self.create_args(with_env=True) exitcode = os.spawnle(os.P_WAIT, program, *args, self.env) @@ -3519,6 +3520,7 @@ def test_spawnv(self): self.assertEqual(exitcode, self.exitcode) @requires_os_func('spawnve') + @unittest.skipIf(sys.platform == 'win32', "TODO: RUSTPYTHON; fix spawnve on Windows") def test_spawnve(self): program, args = self.create_args(with_env=True) exitcode = os.spawnve(os.P_WAIT, program, args, self.env) @@ -3627,6 +3629,7 @@ def _test_invalid_env(self, spawn): self.assertEqual(exitcode, 0) @requires_os_func('spawnve') + @unittest.skipIf(sys.platform == 'win32', "TODO: RUSTPYTHON; fix spawnve on Windows") def test_spawnve_invalid_env(self): self._test_invalid_env(os.spawnve) diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index 35e62d54635..965780668ca 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -447,7 +447,6 @@ def test_main(self): _main() self.assertTrue(len(output.getvalue().split('\n')) > 0) - @unittest.expectedFailure # TODO: RUSTPYTHON @unittest.skipIf(sys.platform == "win32", "Does not apply to Windows") def test_ldshared_value(self): ldflags = sysconfig.get_config_var('LDFLAGS') diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 94f21d1c38f..8f86792e820 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -229,6 +229,7 @@ def f(mutex): # PyThreadState_SetAsyncExc() is a CPython-only gimmick, not (currently) # exposed at the Python level. This test relies on ctypes to get at it. + @unittest.skip("TODO: RUSTPYTHON; expects @cpython_only") def test_PyThreadState_SetAsyncExc(self): ctypes = import_module("ctypes") @@ -332,6 +333,7 @@ def fail_new_thread(*args): finally: threading._start_new_thread = _start_new_thread + @unittest.skip("TODO: RUSTPYTHON; ctypes.pythonapi is not supported") def test_finalize_running_thread(self): # Issue 1402: the PyGILState_Ensure / _Release functions may be called # very late on python exit: on deallocation of a running thread for diff --git a/crates/stdlib/src/openssl.rs b/crates/stdlib/src/openssl.rs index 4d420e7d539..d352d15a614 100644 --- a/crates/stdlib/src/openssl.rs +++ b/crates/stdlib/src/openssl.rs @@ -1543,10 +1543,10 @@ mod _ssl { #[pymethod] fn get_ca_certs( &self, - binary_form: OptionalArg, + args: GetCertArgs, vm: &VirtualMachine, ) -> PyResult> { - let binary_form = binary_form.unwrap_or(false); + let binary_form = args.binary_form.unwrap_or(false); let ctx = self.ctx(); #[cfg(ossl300)] let certs = ctx.cert_store().all_certificates(); @@ -2259,6 +2259,12 @@ mod _ssl { password: Option, } + #[derive(FromArgs)] + struct GetCertArgs { + #[pyarg(any, optional)] + binary_form: OptionalArg, + } + // Err is true if the socket is blocking type SocketDeadline = Result; @@ -2516,10 +2522,10 @@ mod _ssl { #[pymethod] fn getpeercert( &self, - binary: OptionalArg, + args: GetCertArgs, vm: &VirtualMachine, ) -> PyResult> { - let binary = binary.unwrap_or(false); + let binary = args.binary_form.unwrap_or(false); let stream = self.connection.read(); if !stream.ssl().is_init_finished() { return Err(vm.new_value_error("handshake not done yet")); diff --git a/crates/stdlib/src/ssl.rs b/crates/stdlib/src/ssl.rs index bf25260ed3a..16449e2d019 100644 --- a/crates/stdlib/src/ssl.rs +++ b/crates/stdlib/src/ssl.rs @@ -841,6 +841,12 @@ mod _ssl { password: OptionalArg, } + #[derive(FromArgs)] + struct GetCertArgs { + #[pyarg(any, optional)] + binary_form: OptionalArg, + } + #[pyclass(with(Constructor), flags(BASETYPE))] impl PySSLContext { // Helper method to convert DER certificate bytes to Python dict @@ -1688,12 +1694,8 @@ mod _ssl { } #[pymethod] - fn get_ca_certs( - &self, - binary_form: OptionalArg, - vm: &VirtualMachine, - ) -> PyResult { - let binary_form = binary_form.unwrap_or(false); + fn get_ca_certs(&self, args: GetCertArgs, vm: &VirtualMachine) -> PyResult { + let binary_form = args.binary_form.unwrap_or(false); let ca_certs_der = self.ca_certs_der.read(); let mut certs = Vec::new(); @@ -3444,10 +3446,10 @@ mod _ssl { #[pymethod] fn getpeercert( &self, - binary_form: OptionalArg, + args: GetCertArgs, vm: &VirtualMachine, ) -> PyResult> { - let binary = binary_form.unwrap_or(false); + let binary = args.binary_form.unwrap_or(false); // Check if handshake is complete if !*self.handshake_done.lock() { diff --git a/crates/vm/src/stdlib/sysconfigdata.rs b/crates/vm/src/stdlib/sysconfigdata.rs index 90e46b83b97..ee40b693aa2 100644 --- a/crates/vm/src/stdlib/sysconfigdata.rs +++ b/crates/vm/src/stdlib/sysconfigdata.rs @@ -1,3 +1,5 @@ +// spell-checker: words LDSHARED ARFLAGS CPPFLAGS CCSHARED BASECFLAGS BLDSHARED + pub(crate) use _sysconfigdata::make_module; #[pymodule] @@ -18,6 +20,21 @@ pub(crate) mod _sysconfigdata { "MULTIARCH" => MULTIARCH, // enough for tests to stop expecting urandom() to fail after restricting file resources "HAVE_GETRANDOM" => 1, + // Compiler configuration for native extension builds + "CC" => "cc", + "CXX" => "c++", + "CFLAGS" => "", + "CPPFLAGS" => "", + "LDFLAGS" => "", + "LDSHARED" => "cc -shared", + "CCSHARED" => "", + "SHLIB_SUFFIX" => ".so", + "SO" => ".so", + "AR" => "ar", + "ARFLAGS" => "rcs", + "OPT" => "", + "BASECFLAGS" => "", + "BLDSHARED" => "cc -shared", } include!(concat!(env!("OUT_DIR"), "/env_vars.rs")); vars