Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
93c56828
Kaydet (Commit)
93c56828
authored
Agu 26, 2007
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use unicode (and bytes as appropriate)
üst
80e7f27e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
test_subprocess.py
Lib/test/test_subprocess.py
+1
-1
posixmodule.c
Modules/posixmodule.c
+16
-16
No files found.
Lib/test/test_subprocess.py
Dosyayı görüntüle @
93c56828
...
@@ -254,7 +254,7 @@ class ProcessTestCase(unittest.TestCase):
...
@@ -254,7 +254,7 @@ class ProcessTestCase(unittest.TestCase):
stdout
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
cwd
=
tmpdir
)
cwd
=
tmpdir
)
normcase
=
os
.
path
.
normcase
normcase
=
os
.
path
.
normcase
self
.
assertEqual
(
normcase
(
p
.
stdout
.
read
()),
normcase
(
tmpdir
))
self
.
assertEqual
(
normcase
(
p
.
stdout
.
read
()),
bytes
(
normcase
(
tmpdir
)
))
def
test_env
(
self
):
def
test_env
(
self
):
newenv
=
os
.
environ
.
copy
()
newenv
=
os
.
environ
.
copy
()
...
...
Modules/posixmodule.c
Dosyayı görüntüle @
93c56828
...
@@ -387,13 +387,13 @@ convertenviron(void)
...
@@ -387,13 +387,13 @@ convertenviron(void)
rc
=
DosQueryExtLIBPATH
(
buffer
,
BEGIN_LIBPATH
);
rc
=
DosQueryExtLIBPATH
(
buffer
,
BEGIN_LIBPATH
);
if
(
rc
==
NO_ERROR
)
{
/* (not a type, envname is NOT 'BEGIN_LIBPATH') */
if
(
rc
==
NO_ERROR
)
{
/* (not a type, envname is NOT 'BEGIN_LIBPATH') */
PyObject
*
v
=
PyString_FromString
(
buffer
);
PyObject
*
v
=
PyString_FromString
(
buffer
);
PyDict_SetItemString
(
d
,
"BEGINLIBPATH"
,
v
);
PyDict_SetItemString
(
d
,
"BEGINLIBPATH"
,
v
);
Py_DECREF
(
v
);
Py_DECREF
(
v
);
}
}
rc
=
DosQueryExtLIBPATH
(
buffer
,
END_LIBPATH
);
rc
=
DosQueryExtLIBPATH
(
buffer
,
END_LIBPATH
);
if
(
rc
==
NO_ERROR
)
{
/* (not a typo, envname is NOT 'END_LIBPATH') */
if
(
rc
==
NO_ERROR
)
{
/* (not a typo, envname is NOT 'END_LIBPATH') */
PyObject
*
v
=
PyString_FromString
(
buffer
);
PyObject
*
v
=
PyString_FromString
(
buffer
);
PyDict_SetItemString
(
d
,
"ENDLIBPATH"
,
v
);
PyDict_SetItemString
(
d
,
"ENDLIBPATH"
,
v
);
Py_DECREF
(
v
);
Py_DECREF
(
v
);
}
}
}
}
...
@@ -1581,7 +1581,7 @@ posix_ttyname(PyObject *self, PyObject *args)
...
@@ -1581,7 +1581,7 @@ posix_ttyname(PyObject *self, PyObject *args)
#endif
#endif
if
(
ret
==
NULL
)
if
(
ret
==
NULL
)
return
posix_error
();
return
posix_error
();
return
Py
String
_FromString
(
ret
);
return
Py
Unicode
_FromString
(
ret
);
}
}
#endif
#endif
...
@@ -1603,7 +1603,7 @@ posix_ctermid(PyObject *self, PyObject *noargs)
...
@@ -1603,7 +1603,7 @@ posix_ctermid(PyObject *self, PyObject *noargs)
#endif
#endif
if
(
ret
==
NULL
)
if
(
ret
==
NULL
)
return
posix_error
();
return
posix_error
();
return
Py
String
_FromString
(
buffer
);
return
Py
Unicode
_FromString
(
buffer
);
}
}
#endif
#endif
...
@@ -1883,7 +1883,7 @@ posix_getcwd(PyObject *self, PyObject *noargs)
...
@@ -1883,7 +1883,7 @@ posix_getcwd(PyObject *self, PyObject *noargs)
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
if
(
res
==
NULL
)
if
(
res
==
NULL
)
return
posix_error
();
return
posix_error
();
return
Py
String
_FromString
(
buf
);
return
Py
Unicode
_FromString
(
buf
);
}
}
PyDoc_STRVAR
(
posix_getcwdu__doc__
,
PyDoc_STRVAR
(
posix_getcwdu__doc__
,
...
@@ -3805,7 +3805,7 @@ posix_getlogin(PyObject *self, PyObject *noargs)
...
@@ -3805,7 +3805,7 @@ posix_getlogin(PyObject *self, PyObject *noargs)
"unable to determine login name"
);
"unable to determine login name"
);
}
}
else
else
result
=
Py
String
_FromString
(
name
);
result
=
Py
Unicode
_FromString
(
name
);
errno
=
old_errno
;
errno
=
old_errno
;
return
result
;
return
result
;
...
@@ -5076,7 +5076,7 @@ posix_strerror(PyObject *self, PyObject *args)
...
@@ -5076,7 +5076,7 @@ posix_strerror(PyObject *self, PyObject *args)
"strerror() argument out of range"
);
"strerror() argument out of range"
);
return
NULL
;
return
NULL
;
}
}
return
Py
String
_FromString
(
message
);
return
Py
Unicode
_FromString
(
message
);
}
}
#endif
/* strerror */
#endif
/* strerror */
...
@@ -5786,12 +5786,12 @@ posix_confstr(PyObject *self, PyObject *args)
...
@@ -5786,12 +5786,12 @@ posix_confstr(PyObject *self, PyObject *args)
}
}
else
{
else
{
if
((
unsigned
int
)
len
>=
sizeof
(
buffer
))
{
if
((
unsigned
int
)
len
>=
sizeof
(
buffer
))
{
result
=
Py
String
_FromStringAndSize
(
NULL
,
len
-
1
);
result
=
Py
Unicode
_FromStringAndSize
(
NULL
,
len
-
1
);
if
(
result
!=
NULL
)
if
(
result
!=
NULL
)
confstr
(
name
,
Py
String_AS_STRING
(
result
),
len
);
confstr
(
name
,
Py
Unicode_AsString
(
result
),
len
);
}
}
else
else
result
=
Py
String
_FromStringAndSize
(
buffer
,
len
-
1
);
result
=
Py
Unicode
_FromStringAndSize
(
buffer
,
len
-
1
);
}
}
}
}
return
result
;
return
result
;
...
@@ -6522,7 +6522,7 @@ posix_getloadavg(PyObject *self, PyObject *noargs)
...
@@ -6522,7 +6522,7 @@ posix_getloadavg(PyObject *self, PyObject *noargs)
PyDoc_STRVAR
(
win32_urandom__doc__
,
PyDoc_STRVAR
(
win32_urandom__doc__
,
"urandom(n) -> str
\n\n
\
"urandom(n) -> str
\n\n
\
Return
a string of
n random bytes suitable for cryptographic use."
);
Return n random bytes suitable for cryptographic use."
);
typedef
BOOL
(
WINAPI
*
CRYPTACQUIRECONTEXTA
)(
HCRYPTPROV
*
phProv
,
\
typedef
BOOL
(
WINAPI
*
CRYPTACQUIRECONTEXTA
)(
HCRYPTPROV
*
phProv
,
\
LPCSTR
pszContainer
,
LPCSTR
pszProvider
,
DWORD
dwProvType
,
\
LPCSTR
pszContainer
,
LPCSTR
pszProvider
,
DWORD
dwProvType
,
\
...
@@ -6578,11 +6578,11 @@ win32_urandom(PyObject *self, PyObject *args)
...
@@ -6578,11 +6578,11 @@ win32_urandom(PyObject *self, PyObject *args)
}
}
/* Allocate bytes */
/* Allocate bytes */
result
=
Py
String
_FromStringAndSize
(
NULL
,
howMany
);
result
=
Py
Bytes
_FromStringAndSize
(
NULL
,
howMany
);
if
(
result
!=
NULL
)
{
if
(
result
!=
NULL
)
{
/* Get random data */
/* Get random data */
if
(
!
pCryptGenRandom
(
hCryptProv
,
howMany
,
(
unsigned
char
*
)
if
(
!
pCryptGenRandom
(
hCryptProv
,
howMany
,
(
unsigned
char
*
)
Py
String
_AS_STRING
(
result
)))
{
Py
Bytes
_AS_STRING
(
result
)))
{
Py_DECREF
(
result
);
Py_DECREF
(
result
);
return
win32_error
(
"CryptGenRandom"
,
NULL
);
return
win32_error
(
"CryptGenRandom"
,
NULL
);
}
}
...
@@ -6633,7 +6633,7 @@ device_encoding(PyObject *self, PyObject *args)
...
@@ -6633,7 +6633,7 @@ device_encoding(PyObject *self, PyObject *args)
#include <openssl/rand.h>
#include <openssl/rand.h>
PyDoc_STRVAR
(
vms_urandom__doc__
,
PyDoc_STRVAR
(
vms_urandom__doc__
,
"urandom(n) -> str
\n\n
\
"urandom(n) -> str
\n\n
\
Return
a string of
n random bytes suitable for cryptographic use."
);
Return n random bytes suitable for cryptographic use."
);
static
PyObject
*
static
PyObject
*
vms_urandom
(
PyObject
*
self
,
PyObject
*
args
)
vms_urandom
(
PyObject
*
self
,
PyObject
*
args
)
...
@@ -6649,11 +6649,11 @@ vms_urandom(PyObject *self, PyObject *args)
...
@@ -6649,11 +6649,11 @@ vms_urandom(PyObject *self, PyObject *args)
"negative argument not allowed"
);
"negative argument not allowed"
);
/* Allocate bytes */
/* Allocate bytes */
result
=
Py
String
_FromStringAndSize
(
NULL
,
howMany
);
result
=
Py
Bytes
_FromStringAndSize
(
NULL
,
howMany
);
if
(
result
!=
NULL
)
{
if
(
result
!=
NULL
)
{
/* Get random data */
/* Get random data */
if
(
RAND_pseudo_bytes
((
unsigned
char
*
)
if
(
RAND_pseudo_bytes
((
unsigned
char
*
)
Py
String
_AS_STRING
(
result
),
Py
Bytes
_AS_STRING
(
result
),
howMany
)
<
0
)
{
howMany
)
<
0
)
{
Py_DECREF
(
result
);
Py_DECREF
(
result
);
return
PyErr_Format
(
PyExc_ValueError
,
return
PyErr_Format
(
PyExc_ValueError
,
...
...
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