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
9f1ffb2a
Kaydet (Commit)
9f1ffb2a
authored
Nis 05, 2011
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#7311: fix HTMLParser to accept non-ASCII attribute values.
üst
104c3f10
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
HTMLParser.py
Lib/HTMLParser.py
+1
-1
test_htmlparser.py
Lib/test/test_htmlparser.py
+17
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/HTMLParser.py
Dosyayı görüntüle @
9f1ffb2a
...
@@ -26,7 +26,7 @@ commentclose = re.compile(r'--\s*>')
...
@@ -26,7 +26,7 @@ commentclose = re.compile(r'--\s*>')
tagfind
=
re
.
compile
(
'[a-zA-Z][-.a-zA-Z0-9:_]*'
)
tagfind
=
re
.
compile
(
'[a-zA-Z][-.a-zA-Z0-9:_]*'
)
attrfind
=
re
.
compile
(
attrfind
=
re
.
compile
(
r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*'
r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*'
r'(\'[^\']*\'|"[^"]*"|[
-a-zA-Z0-9./,:;+*
%
?!&$\(\)_#=~@
]*))?'
)
r'(\'[^\']*\'|"[^"]*"|[
^\s"\'=<>`
]*))?'
)
locatestarttagend
=
re
.
compile
(
r"""
locatestarttagend
=
re
.
compile
(
r"""
<[a-zA-Z][-.a-zA-Z0-9:_]* # tag name
<[a-zA-Z][-.a-zA-Z0-9:_]* # tag name
...
...
Lib/test/test_htmlparser.py
Dosyayı görüntüle @
9f1ffb2a
...
@@ -208,6 +208,23 @@ DOCTYPE html [
...
@@ -208,6 +208,23 @@ DOCTYPE html [
(
"starttag"
,
"a"
,
[(
"href"
,
"mailto:xyz@example.com"
)]),
(
"starttag"
,
"a"
,
[(
"href"
,
"mailto:xyz@example.com"
)]),
])
])
def
test_attr_nonascii
(
self
):
# see issue 7311
self
.
_run_check
(
u"<img src=/foo/bar.png alt=
\u4e2d\u6587
>"
,
[
(
"starttag"
,
"img"
,
[(
"src"
,
"/foo/bar.png"
),
(
"alt"
,
u"
\u4e2d\u6587
"
)]),
])
self
.
_run_check
(
u"<a title='
\u30c6\u30b9\u30c8
' "
u"href='
\u30c6\u30b9\u30c8
.html'>"
,
[
(
"starttag"
,
"a"
,
[(
"title"
,
u"
\u30c6\u30b9\u30c8
"
),
(
"href"
,
u"
\u30c6\u30b9\u30c8
.html"
)]),
])
self
.
_run_check
(
u'<a title="
\u30c6\u30b9\u30c8
" '
u'href="
\u30c6\u30b9\u30c8
.html">'
,
[
(
"starttag"
,
"a"
,
[(
"title"
,
u"
\u30c6\u30b9\u30c8
"
),
(
"href"
,
u"
\u30c6\u30b9\u30c8
.html"
)]),
])
def
test_attr_entity_replacement
(
self
):
def
test_attr_entity_replacement
(
self
):
self
.
_run_check
(
"""<a b='&><"''>"""
,
[
self
.
_run_check
(
"""<a b='&><"''>"""
,
[
(
"starttag"
,
"a"
,
[(
"b"
,
"&><
\"
'"
)]),
(
"starttag"
,
"a"
,
[(
"b"
,
"&><
\"
'"
)]),
...
...
Misc/NEWS
Dosyayı görüntüle @
9f1ffb2a
...
@@ -47,6 +47,8 @@ Core and Builtins
...
@@ -47,6 +47,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #7311: fix HTMLParser to accept non-ASCII attribute values.
- Issue #10963: Ensure that subprocess.communicate() never raises EPIPE.
- Issue #10963: Ensure that subprocess.communicate() never raises EPIPE.
- Issue #11662: Make urllib and urllib2 ignore redirections if the
- Issue #11662: Make urllib and urllib2 ignore redirections if the
...
...
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