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
ad89dc87
Commit
ad89dc87
authored
Apr 03, 2006
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1451503: allow unicode filenames in os.startfile().
parent
59c3acc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
Modules/posixmodule.c
Modules/posixmodule.c
+35
-0
No files found.
Modules/posixmodule.c
View file @
ad89dc87
...
...
@@ -7467,6 +7467,41 @@ win32_startfile(PyObject *self, PyObject *args)
char
*
filepath
;
char
*
operation
=
NULL
;
HINSTANCE
rc
;
#ifdef Py_WIN_WIDE_FILENAMES
if
(
unicode_file_names
())
{
PyObject
*
unipath
,
*
woperation
;
if
(
!
PyArg_ParseTuple
(
args
,
"U|s:startfile"
,
&
unipath
,
&
operation
))
{
PyErr_Clear
();
goto
normal
;
}
woperation
=
PyUnicode_DecodeASCII
(
operation
,
strlen
(
operation
),
NULL
);
if
(
!
woperation
)
{
PyErr_Clear
();
goto
normal
;
}
Py_BEGIN_ALLOW_THREADS
rc
=
ShellExecuteW
((
HWND
)
0
,
operation
,
PyUnicode_AS_UNICODE
(
unipath
),
PyUnicode_AS_UNICODE
(
woperation
),
NULL
,
NULL
,
SW_SHOWNORMAL
);
Py_END_ALLOW_THREADS
Py_DECREF
(
woperation
);
if
(
rc
<=
(
HINSTANCE
)
32
)
{
PyObject
*
errval
=
win32_error_unicode
(
"startfile"
,
PyUnicode_AS_UNICODE
(
unipath
));
return
errval
;
}
Py_INCREF
(
Py_None
);
return
Py_None
;
}
#endif
normal:
if
(
!
PyArg_ParseTuple
(
args
,
"et|s:startfile"
,
Py_FileSystemDefaultEncoding
,
&
filepath
,
&
operation
))
...
...
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