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
af2be262
Commit
af2be262
authored
Jul 12, 2007
by
Thomas Heller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First part of sf# 1752225: Support for wide filenames on Windows.
Patch by Amaury Forgeot d'Arc.
parent
5fa3f051
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
Modules/_fileio.c
Modules/_fileio.c
+12
-9
No files found.
Modules/_fileio.c
View file @
af2be262
...
...
@@ -118,7 +118,9 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
char
*
name
=
NULL
;
char
*
mode
=
"r"
;
char
*
s
;
int
wideargument
=
0
;
#ifdef MS_WINDOWS
Py_UNICODE
*
widename
=
NULL
;
#endif
int
ret
=
0
;
int
rwa
=
0
,
plus
=
0
,
append
=
0
;
int
flags
=
0
;
...
...
@@ -151,20 +153,16 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
PyObject
*
po
;
if
(
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"U|s:fileio"
,
kwlist
,
&
po
,
&
mode
))
{
wide
argument
=
1
;
wide
name
=
PyUnicode_AS_UNICODE
(
po
)
;
}
else
{
/* Drop the argument parsing error as narrow
strings are also valid. */
PyErr_Clear
();
}
PyErr_SetString
(
PyExc_NotImplementedError
,
"Windows wide filenames are not yet supported"
);
goto
error
;
}
if
(
widename
==
NULL
)
#endif
if
(
!
wideargument
)
{
{
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"et|s:fileio"
,
kwlist
,
Py_FileSystemDefaultEncoding
,
...
...
@@ -174,7 +172,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
}
self
->
readable
=
self
->
writable
=
0
;
self
->
seekable
=
-
1
;
self
->
seekable
=
-
1
;
s
=
mode
;
while
(
*
s
)
{
switch
(
*
s
++
)
{
...
...
@@ -241,6 +239,11 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
else
{
Py_BEGIN_ALLOW_THREADS
errno
=
0
;
#ifdef MS_WINDOWS
if
(
widename
!=
NULL
)
self
->
fd
=
_wopen
(
widename
,
flags
,
0666
);
else
#endif
self
->
fd
=
open
(
name
,
flags
,
0666
);
Py_END_ALLOW_THREADS
if
(
self
->
fd
<
0
||
dircheck
(
self
)
<
0
)
{
...
...
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