Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
738446f0
Commit
738446f0
authored
Apr 18, 2010
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with
surrogates.
parent
a7ecfe70
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_ctypes/callproc.c
Modules/_ctypes/callproc.c
+16
-3
No files found.
Misc/NEWS
View file @
738446f0
...
@@ -315,6 +315,9 @@ C-API
...
@@ -315,6 +315,9 @@ C-API
Library
Library
-------
-------
- Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with
surrogates.
- Issue #850728: Add a *timeout* parameter to the `acquire()` method of
- Issue #850728: Add a *timeout* parameter to the `acquire()` method of
`threading.Semaphore` objects. Original patch by Torsten Landschoff.
`threading.Semaphore` objects. Original patch by Torsten Landschoff.
...
...
Modules/_ctypes/callproc.c
View file @
738446f0
...
@@ -1371,7 +1371,8 @@ copy_com_pointer(PyObject *self, PyObject *args)
...
@@ -1371,7 +1371,8 @@ copy_com_pointer(PyObject *self, PyObject *args)
static
PyObject
*
py_dl_open
(
PyObject
*
self
,
PyObject
*
args
)
static
PyObject
*
py_dl_open
(
PyObject
*
self
,
PyObject
*
args
)
{
{
char
*
name
;
PyObject
*
name
,
*
name2
;
char
*
name_str
;
void
*
handle
;
void
*
handle
;
#ifdef RTLD_LOCAL
#ifdef RTLD_LOCAL
int
mode
=
RTLD_NOW
|
RTLD_LOCAL
;
int
mode
=
RTLD_NOW
|
RTLD_LOCAL
;
...
@@ -1379,10 +1380,22 @@ static PyObject *py_dl_open(PyObject *self, PyObject *args)
...
@@ -1379,10 +1380,22 @@ static PyObject *py_dl_open(PyObject *self, PyObject *args)
/* cygwin doesn't define RTLD_LOCAL */
/* cygwin doesn't define RTLD_LOCAL */
int
mode
=
RTLD_NOW
;
int
mode
=
RTLD_NOW
;
#endif
#endif
if
(
!
PyArg_ParseTuple
(
args
,
"
z
|i:dlopen"
,
&
name
,
&
mode
))
if
(
!
PyArg_ParseTuple
(
args
,
"
O
|i:dlopen"
,
&
name
,
&
mode
))
return
NULL
;
return
NULL
;
mode
|=
RTLD_NOW
;
mode
|=
RTLD_NOW
;
handle
=
ctypes_dlopen
(
name
,
mode
);
if
(
name
!=
Py_None
)
{
if
(
PyUnicode_FSConverter
(
name
,
&
name2
)
==
0
)
return
NULL
;
if
(
PyBytes_Check
(
name2
))
name_str
=
PyBytes_AS_STRING
(
name2
);
else
name_str
=
PyByteArray_AS_STRING
(
name2
);
}
else
{
name_str
=
NULL
;
name2
=
NULL
;
}
handle
=
ctypes_dlopen
(
name_str
,
mode
);
Py_XDECREF
(
name2
);
if
(
!
handle
)
{
if
(
!
handle
)
{
char
*
errmsg
=
ctypes_dlerror
();
char
*
errmsg
=
ctypes_dlerror
();
if
(
!
errmsg
)
if
(
!
errmsg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment