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
25871dac
Kaydet (Commit)
25871dac
authored
Mar 20, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge
üst
cb342182
e0daff1c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
3 deletions
+35
-3
urllib.request.rst
Doc/library/urllib.request.rst
+1
-1
test_os.py
Lib/test/test_os.py
+19
-0
NEWS
Misc/NEWS
+6
-0
fileio.c
Modules/_io/fileio.c
+8
-1
pythonrun.c
Python/pythonrun.c
+1
-1
No files found.
Doc/library/urllib.request.rst
Dosyayı görüntüle @
25871dac
...
...
@@ -1282,7 +1282,7 @@ some point in the future.
you try to fetch a file whose read permissions make it inaccessible; the FTP
code will try to read it, fail with a 550 error, and then perform a directory
listing for the unreadable file. If fine-grained control is needed, consider
using the :mod:`ftplib` module, subclassing :class:`FancyURL
O
pener`, or changing
using the :mod:`ftplib` module, subclassing :class:`FancyURL
o
pener`, or changing
*_urlopener* to meet your needs.
...
...
Lib/test/test_os.py
Dosyayı görüntüle @
25871dac
...
...
@@ -90,6 +90,25 @@ class FileTests(unittest.TestCase):
self
.
assertEqual
(
fobj
.
read
()
.
splitlines
(),
[
b
"bacon"
,
b
"eggs"
,
b
"spam"
])
def
write_windows_console
(
self
,
*
args
):
retcode
=
subprocess
.
call
(
args
,
# use a new console to not flood the test output
creationflags
=
subprocess
.
CREATE_NEW_CONSOLE
,
# use a shell to hide the console window (SW_HIDE)
shell
=
True
)
self
.
assertEqual
(
retcode
,
0
)
@unittest.skipUnless
(
sys
.
platform
==
'win32'
,
'test specific to the Windows console'
)
def
test_write_windows_console
(
self
):
# Issue #11395: the Windows console returns an error (12: not enough
# space error) on writing into stdout if stdout mode is binary and the
# length is greater than 66,000 bytes (or less, depending on heap
# usage).
code
=
"print('x' * 100000)"
self
.
write_windows_console
(
sys
.
executable
,
"-c"
,
code
)
self
.
write_windows_console
(
sys
.
executable
,
"-u"
,
"-c"
,
code
)
class
TemporaryFileTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
25871dac
...
...
@@ -10,6 +10,12 @@ What's New in Python 3.2.1?
Core and Builtins
-----------------
- Issue #11395: io.FileIO().write() clamps the data length to 32,767 bytes on
Windows if the file is a TTY to workaround a Windows bug. The Windows console
returns an error (12: not enough space error) on writing into stdout if
stdout mode is binary and the length is greater than 66,000 bytes (or less,
depending on heap usage).
- Issue #11320: fix bogus memory management in Modules/getpath.c, leading to
a possible crash when calling Py_SetPath().
...
...
Modules/_io/fileio.c
Dosyayı görüntüle @
25871dac
...
...
@@ -712,7 +712,14 @@ fileio_write(fileio *self, PyObject *args)
errno
=
0
;
len
=
pbuf
.
len
;
#if defined(MS_WIN64) || defined(MS_WINDOWS)
if
(
len
>
INT_MAX
)
if
(
len
>
32767
&&
isatty
(
self
->
fd
))
{
/* Issue #11395: the Windows console returns an error (12: not
enough space error) on writing into stdout if stdout mode is
binary and the length is greater than 66,000 bytes (or less,
depending on heap usage). */
len
=
32767
;
}
else
if
(
len
>
INT_MAX
)
len
=
INT_MAX
;
n
=
write
(
self
->
fd
,
pbuf
.
buf
,
(
int
)
len
);
#else
...
...
Python/pythonrun.c
Dosyayı görüntüle @
25871dac
...
...
@@ -147,7 +147,7 @@ get_codec_name(const char *encoding)
goto
error
;
name_utf8
=
_PyUnicode_AsString
(
name
);
if
(
name
==
NULL
)
if
(
name
_utf8
==
NULL
)
goto
error
;
name_str
=
strdup
(
name_utf8
);
Py_DECREF
(
name
);
...
...
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