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
7b2491a6
Kaydet (Commit)
7b2491a6
authored
Nis 13, 2017
tarafından
Marco Buttu
Kaydeden (comit)
Berker Peksag
Nis 13, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-27200: Fix pathlib, ssl, turtle and weakref doctests (GH-616)
üst
d1dc65dc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
9 deletions
+25
-9
pathlib.rst
Doc/library/pathlib.rst
+11
-1
ssl.rst
Doc/library/ssl.rst
+11
-4
turtle.rst
Doc/library/turtle.rst
+2
-3
weakref.rst
Doc/library/weakref.rst
+1
-1
No files found.
Doc/library/pathlib.rst
Dosyayı görüntüle @
7b2491a6
...
@@ -271,6 +271,10 @@ property:
...
@@ -271,6 +271,10 @@ property:
Methods and properties
Methods and properties
^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^
.. testsetup::
from pathlib import PurePosixPath, PureWindowsPath
Pure paths provide the following methods and properties:
Pure paths provide the following methods and properties:
.. data:: PurePath.drive
.. data:: PurePath.drive
...
@@ -657,6 +661,8 @@ call fails (for example because the path doesn't exist):
...
@@ -657,6 +661,8 @@ call fails (for example because the path doesn't exist):
Return information about this path (similarly to :func:`os.stat`).
Return information about this path (similarly to :func:`os.stat`).
The result is looked up at each call to this method.
The result is looked up at each call to this method.
::
>>> p = Path('setup.py')
>>> p = Path('setup.py')
>>> p.stat().st_size
>>> p.stat().st_size
956
956
...
@@ -948,7 +954,7 @@ call fails (for example because the path doesn't exist):
...
@@ -948,7 +954,7 @@ call fails (for example because the path doesn't exist):
.. method:: Path.rglob(pattern)
.. method:: Path.rglob(pattern)
This is like calling :meth:`Path.glob` with "``**``" added in front of the
This is like calling :meth:`Path.glob` with "``**``" added in front of the
given *pattern*:
given *pattern*:
:
>>> sorted(Path().rglob("*.py"))
>>> sorted(Path().rglob("*.py"))
[PosixPath('build/lib/pathlib.py'),
[PosixPath('build/lib/pathlib.py'),
...
@@ -972,6 +978,8 @@ call fails (for example because the path doesn't exist):
...
@@ -972,6 +978,8 @@ call fails (for example because the path doesn't exist):
An :exc:`OSError` can be raised if either file cannot be accessed for some
An :exc:`OSError` can be raised if either file cannot be accessed for some
reason.
reason.
::
>>> p = Path('spam')
>>> p = Path('spam')
>>> q = Path('eggs')
>>> q = Path('eggs')
>>> p.samefile(q)
>>> p.samefile(q)
...
@@ -988,6 +996,8 @@ call fails (for example because the path doesn't exist):
...
@@ -988,6 +996,8 @@ call fails (for example because the path doesn't exist):
*target_is_directory* must be true (default ``False``) if the link's target
*target_is_directory* must be true (default ``False``) if the link's target
is a directory. Under POSIX, *target_is_directory*'s value is ignored.
is a directory. Under POSIX, *target_is_directory*'s value is ignored.
::
>>> p = Path('mylink')
>>> p = Path('mylink')
>>> p.symlink_to('setup.py')
>>> p.symlink_to('setup.py')
>>> p.resolve()
>>> p.resolve()
...
...
Doc/library/ssl.rst
Dosyayı görüntüle @
7b2491a6
...
@@ -369,6 +369,10 @@ Random generation
...
@@ -369,6 +369,10 @@ Random generation
Certificate handling
Certificate handling
^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^
.. testsetup::
import ssl
.. function:: match_hostname(cert, hostname)
.. function:: match_hostname(cert, hostname)
Verify that *cert* (in decoded format as returned by
Verify that *cert* (in decoded format as returned by
...
@@ -415,10 +419,10 @@ Certificate handling
...
@@ -415,10 +419,10 @@ Certificate handling
>>> import ssl
>>> import ssl
>>> timestamp = ssl.cert_time_to_seconds("Jan 5 09:34:43 2018 GMT")
>>> timestamp = ssl.cert_time_to_seconds("Jan 5 09:34:43 2018 GMT")
>>> timestamp
>>> timestamp
# doctest: +SKIP
1515144883
1515144883
>>> from datetime import datetime
>>> from datetime import datetime
>>> print(datetime.utcfromtimestamp(timestamp))
>>> print(datetime.utcfromtimestamp(timestamp))
# doctest: +SKIP
2018-01-05 09:34:43
2018-01-05 09:34:43
"notBefore" or "notAfter" dates must use GMT (:rfc:`5280`).
"notBefore" or "notAfter" dates must use GMT (:rfc:`5280`).
...
@@ -1378,6 +1382,7 @@ to speed up repeated connections from the same clients.
...
@@ -1378,6 +1382,7 @@ to speed up repeated connections from the same clients.
'strength_bits': 128}]
'strength_bits': 128}]
On OpenSSL 1.1 and newer the cipher dict contains additional fields::
On OpenSSL 1.1 and newer the cipher dict contains additional fields::
>>> ctx.get_ciphers() # OpenSSL 1.1+
>>> ctx.get_ciphers() # OpenSSL 1.1+
[{'aead': True,
[{'aead': True,
'alg_bits': 256,
'alg_bits': 256,
...
@@ -1638,7 +1643,7 @@ to speed up repeated connections from the same clients.
...
@@ -1638,7 +1643,7 @@ to speed up repeated connections from the same clients.
.. versionchanged:: 3.6
.. versionchanged:: 3.6
:attr:`SSLContext.options` returns :class:`Options` flags:
:attr:`SSLContext.options` returns :class:`Options` flags:
>>> ssl.create_default_context().options
>>> ssl.create_default_context().options
# doctest: +SKIP
<Options.OP_ALL|OP_NO_SSLv3|OP_NO_SSLv2|OP_NO_COMPRESSION: 2197947391>
<Options.OP_ALL|OP_NO_SSLv3|OP_NO_SSLv2|OP_NO_COMPRESSION: 2197947391>
.. attribute:: SSLContext.protocol
.. attribute:: SSLContext.protocol
...
@@ -1658,7 +1663,7 @@ to speed up repeated connections from the same clients.
...
@@ -1658,7 +1663,7 @@ to speed up repeated connections from the same clients.
.. versionchanged:: 3.6
.. versionchanged:: 3.6
:attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags:
:attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags:
>>> ssl.create_default_context().verify_flags
>>> ssl.create_default_context().verify_flags
# doctest: +SKIP
<VerifyFlags.VERIFY_X509_TRUSTED_FIRST: 32768>
<VerifyFlags.VERIFY_X509_TRUSTED_FIRST: 32768>
.. attribute:: SSLContext.verify_mode
.. attribute:: SSLContext.verify_mode
...
@@ -2259,6 +2264,8 @@ recommended to use :const:`PROTOCOL_TLS_CLIENT` or
...
@@ -2259,6 +2264,8 @@ recommended to use :const:`PROTOCOL_TLS_CLIENT` or
:const:`PROTOCOL_TLS_SERVER` as the protocol version. SSLv2 and SSLv3 are
:const:`PROTOCOL_TLS_SERVER` as the protocol version. SSLv2 and SSLv3 are
disabled by default.
disabled by default.
::
>>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
>>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
>>> client_context.options |= ssl.OP_NO_TLSv1
>>> client_context.options |= ssl.OP_NO_TLSv1
>>> client_context.options |= ssl.OP_NO_TLSv1_1
>>> client_context.options |= ssl.OP_NO_TLSv1_1
...
...
Doc/library/turtle.rst
Dosyayı görüntüle @
7b2491a6
...
@@ -936,10 +936,9 @@ Color control
...
@@ -936,10 +936,9 @@ Color control
>>> turtle.fillcolor("violet")
>>> turtle.fillcolor("violet")
>>> turtle.fillcolor()
>>> turtle.fillcolor()
'violet'
'violet'
>>> col = turtle.pencolor()
>>> turtle.pencolor()
>>> col
(50.0, 193.0, 143.0)
(50.0, 193.0, 143.0)
>>> turtle.fillcolor(
col)
>>> turtle.fillcolor(
(50, 193, 143)) # Integers, not floats
>>> turtle.fillcolor()
>>> turtle.fillcolor()
(50.0, 193.0, 143.0)
(50.0, 193.0, 143.0)
>>> turtle.fillcolor('#ffffff')
>>> turtle.fillcolor('#ffffff')
...
...
Doc/library/weakref.rst
Dosyayı görüntüle @
7b2491a6
...
@@ -478,7 +478,7 @@ the constructor when it was created.
...
@@ -478,7 +478,7 @@ the constructor when it was created.
>>> obj = Object()
>>> obj = Object()
>>> f = weakref.finalize(obj, callback, 1, 2, z=3)
>>> f = weakref.finalize(obj, callback, 1, 2, z=3)
>>> f.detach() #doctest:+ELLIPSIS
>>> f.detach() #doctest:+ELLIPSIS
(<
__main__
.Object object ...>, <function callback ...>, (1, 2), {'z': 3})
(<
..
.Object object ...>, <function callback ...>, (1, 2), {'z': 3})
>>> newobj, func, args, kwargs = _
>>> newobj, func, args, kwargs = _
>>> assert not f.alive
>>> assert not f.alive
>>> assert newobj is obj
>>> assert newobj is obj
...
...
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