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
eb432144
Kaydet (Commit)
eb432144
authored
Tem 10, 2014
tarafından
Zachary Ware
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #21942: Fixed source file viewing in pydoc's server mode on Windows.
üst
7cca28ff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
10 deletions
+7
-10
pydoc.py
Lib/pydoc.py
+3
-5
test_pydoc.py
Lib/test/test_pydoc.py
+2
-5
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/pydoc.py
Dosyayı görüntüle @
eb432144
...
@@ -64,6 +64,7 @@ import re
...
@@ -64,6 +64,7 @@ import re
import
sys
import
sys
import
time
import
time
import
tokenize
import
tokenize
import
urllib.parse
import
warnings
import
warnings
from
collections
import
deque
from
collections
import
deque
from
reprlib
import
Repr
from
reprlib
import
Repr
...
@@ -648,10 +649,7 @@ class HTMLDoc(Doc):
...
@@ -648,10 +649,7 @@ class HTMLDoc(Doc):
head
=
'<big><big><strong>
%
s</strong></big></big>'
%
linkedname
head
=
'<big><big><strong>
%
s</strong></big></big>'
%
linkedname
try
:
try
:
path
=
inspect
.
getabsfile
(
object
)
path
=
inspect
.
getabsfile
(
object
)
url
=
path
url
=
urllib
.
parse
.
quote
(
path
)
if
sys
.
platform
==
'win32'
:
import
nturl2path
url
=
nturl2path
.
pathname2url
(
path
)
filelink
=
self
.
filelink
(
url
,
path
)
filelink
=
self
.
filelink
(
url
,
path
)
except
TypeError
:
except
TypeError
:
filelink
=
'(built-in)'
filelink
=
'(built-in)'
...
@@ -2353,7 +2351,7 @@ def _url_handler(url, content_type="text/html"):
...
@@ -2353,7 +2351,7 @@ def _url_handler(url, content_type="text/html"):
def
html_getfile
(
path
):
def
html_getfile
(
path
):
"""Get and display a source file listing safely."""
"""Get and display a source file listing safely."""
path
=
path
.
replace
(
'
%20
'
,
' '
)
path
=
urllib
.
parse
.
unquote
(
path
)
with
tokenize
.
open
(
path
)
as
fp
:
with
tokenize
.
open
(
path
)
as
fp
:
lines
=
html
.
escape
(
fp
.
read
())
lines
=
html
.
escape
(
fp
.
read
())
body
=
'<pre>
%
s</pre>'
%
lines
body
=
'<pre>
%
s</pre>'
%
lines
...
...
Lib/test/test_pydoc.py
Dosyayı görüntüle @
eb432144
...
@@ -14,6 +14,7 @@ import test.support
...
@@ -14,6 +14,7 @@ import test.support
import
time
import
time
import
types
import
types
import
unittest
import
unittest
import
urllib.parse
import
xml.etree
import
xml.etree
import
textwrap
import
textwrap
from
io
import
StringIO
from
io
import
StringIO
...
@@ -406,11 +407,7 @@ class PydocDocTest(unittest.TestCase):
...
@@ -406,11 +407,7 @@ class PydocDocTest(unittest.TestCase):
def
test_html_doc
(
self
):
def
test_html_doc
(
self
):
result
,
doc_loc
=
get_pydoc_html
(
pydoc_mod
)
result
,
doc_loc
=
get_pydoc_html
(
pydoc_mod
)
mod_file
=
inspect
.
getabsfile
(
pydoc_mod
)
mod_file
=
inspect
.
getabsfile
(
pydoc_mod
)
if
sys
.
platform
==
'win32'
:
mod_url
=
urllib
.
parse
.
quote
(
mod_file
)
import
nturl2path
mod_url
=
nturl2path
.
pathname2url
(
mod_file
)
else
:
mod_url
=
mod_file
expected_html
=
expected_html_pattern
%
(
expected_html
=
expected_html_pattern
%
(
(
mod_url
,
mod_file
,
doc_loc
)
+
(
mod_url
,
mod_file
,
doc_loc
)
+
expected_html_data_docstrings
)
expected_html_data_docstrings
)
...
...
Misc/NEWS
Dosyayı görüntüle @
eb432144
...
@@ -27,6 +27,8 @@ Core and Builtins
...
@@ -27,6 +27,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #21942: Fixed source file viewing in pydoc'
s
server
mode
on
Windows
.
-
Issue
#
11259
:
asynchat
.
async_chat
().
set_terminator
()
now
raises
a
ValueError
-
Issue
#
11259
:
asynchat
.
async_chat
().
set_terminator
()
now
raises
a
ValueError
if
the
number
of
received
bytes
is
negative
.
if
the
number
of
received
bytes
is
negative
.
...
...
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