◐ Shell
reader mode source ↗
Skip to content
Merged
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
17 changes: 14 additions & 3 deletions Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1322,14 +1322,14 @@ There are several ways to load shared libraries into the Python process. One
way is to instantiate one of the following classes:


.. class:: CDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False)

Instances of this class represent loaded shared libraries. Functions in these
libraries use the standard C calling convention, and are assumed to return
:c:type:`int`.


.. class:: OleDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False)

Windows only: Instances of this class represent loaded shared libraries,
functions in these libraries use the ``stdcall`` calling convention, and are
@@ -1342,7 +1342,7 @@ way is to instantiate one of the following classes:
:exc:`WindowsError` used to be raised.


.. class:: WinDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False)

Windows only: Instances of this class represent loaded shared libraries,
functions in these libraries use the ``stdcall`` calling convention, and are
Expand Down Expand Up @@ -1394,6 +1394,17 @@ the Windows error code which is managed by the :func:`GetLastError` and
:func:`ctypes.set_last_error` are used to request and change the ctypes private
copy of the windows error code.

.. data:: RTLD_GLOBAL
:noindex:

Expand Down
30 changes: 30 additions & 0 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3079,6 +3079,36 @@ to be ignored.
:func:`signal.signal`.


.. function:: execl(path, arg0, arg1, ...)
execle(path, arg0, arg1, ..., env)
execlp(file, arg0, arg1, ...)
Expand Down
30 changes: 30 additions & 0 deletions Doc/whatsnew/3.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ asyncio
On Windows, the default event loop is now :class:`~asyncio.ProactorEventLoop`.


gettext
-------

Expand Down Expand Up @@ -238,6 +248,13 @@ Added new function, :func:`math.prod`, as analogous function to :func:`sum`
that returns the product of a 'start' value (default: 1) times an iterable of
numbers. (Contributed by Pablo Galindo in :issue:`35606`)


os.path
-------
Expand Down Expand Up @@ -727,6 +744,19 @@ Changes in the Python API
environment variable and does not use :envvar:`HOME`, which is not normally
set for regular user accounts.


Changes in the C API
--------------------
Expand Down
12 changes: 11 additions & 1 deletion Lib/ctypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ class CDLL(object):

def __init__(self, name, mode=DEFAULT_MODE, handle=None,
use_errno=False,
use_last_error=False):
self._name = name
flags = self._func_flags_
if use_errno:
Expand All @@ -341,6 +342,15 @@ def __init__(self, name, mode=DEFAULT_MODE, handle=None,
"""
if name and name.endswith(")") and ".a(" in name:
mode |= ( _os.RTLD_MEMBER | _os.RTLD_NOW )

class _FuncPtr(_CFuncPtr):
_flags_ = flags
Expand Down
63 changes: 63 additions & 0 deletions Lib/ctypes/test/test_loading.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from ctypes import *
import os
import sys
import unittest
import test.support
from ctypes.util import find_library
Expand Down Expand Up @@ -112,5 +115,65 @@ def test_1703286_B(self):
# This is the real test: call the function via 'call_function'
self.assertEqual(0, call_function(proc, (None,)))

if __name__ == "__main__":
unittest.main()
48 changes: 48 additions & 0 deletions Lib/test/test_import/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import platform
import py_compile
import random
import stat
import sys
import threading
Expand All @@ -17,6 +19,7 @@
import textwrap
import errno
import contextlib

import test.support
from test.support import (
Expand Down Expand Up @@ -460,6 +463,51 @@ def run():
finally:
del sys.path[0]


@skip_if_dont_write_bytecode
class FilePermissionTests(unittest.TestCase):
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Loading
Toggle all file notes Toggle all file annotations