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
8e596a76
Kaydet (Commit)
8e596a76
authored
May 01, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#17802: Fix an UnboundLocalError in html.parser. Initial tests by Thomas Barlow.
üst
a771a1b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
parser.py
Lib/html/parser.py
+1
-0
test_htmlparser.py
Lib/test/test_htmlparser.py
+14
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/html/parser.py
Dosyayı görüntüle @
8e596a76
...
@@ -249,6 +249,7 @@ class HTMLParser(_markupbase.ParserBase):
...
@@ -249,6 +249,7 @@ class HTMLParser(_markupbase.ParserBase):
if
self
.
strict
:
if
self
.
strict
:
self
.
error
(
"EOF in middle of entity or char ref"
)
self
.
error
(
"EOF in middle of entity or char ref"
)
else
:
else
:
k
=
match
.
end
()
if
k
<=
i
:
if
k
<=
i
:
k
=
n
k
=
n
i
=
self
.
updatepos
(
i
,
i
+
1
)
i
=
self
.
updatepos
(
i
,
i
+
1
)
...
...
Lib/test/test_htmlparser.py
Dosyayı görüntüle @
8e596a76
...
@@ -535,6 +535,20 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
...
@@ -535,6 +535,20 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
]
]
self
.
_run_check
(
html
,
expected
)
self
.
_run_check
(
html
,
expected
)
def
test_EOF_in_charref
(
self
):
# see #17802
# This test checks that the UnboundLocalError reported in the issue
# is not raised, however I'm not sure the returned values are correct.
# Maybe HTMLParser should use self.unescape for these
data
=
[
(
'a&'
,
[(
'data'
,
'a&'
)]),
(
'a&b'
,
[(
'data'
,
'ab'
)]),
(
'a&b '
,
[(
'data'
,
'a'
),
(
'entityref'
,
'b'
),
(
'data'
,
' '
)]),
(
'a&b;'
,
[(
'data'
,
'a'
),
(
'entityref'
,
'b'
)]),
]
for
html
,
expected
in
data
:
self
.
_run_check
(
html
,
expected
)
def
test_unescape_function
(
self
):
def
test_unescape_function
(
self
):
p
=
self
.
get_collector
()
p
=
self
.
get_collector
()
self
.
assertEqual
(
p
.
unescape
(
'&#bad;'
),
'&#bad;'
)
self
.
assertEqual
(
p
.
unescape
(
'&#bad;'
),
'&#bad;'
)
...
...
Misc/NEWS
Dosyayı görüntüle @
8e596a76
...
@@ -44,6 +44,9 @@ Core and Builtins
...
@@ -44,6 +44,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #17802: Fix an UnboundLocalError in html.parser. Initial tests by
Thomas Barlow.
- Issue #17192: Restore the patch for Issue #11729 which was ommitted in
- Issue #17192: Restore the patch for Issue #11729 which was ommitted in
3.3.1 when updating the bundled version of libffi used by ctypes. Update
3.3.1 when updating the bundled version of libffi used by ctypes. Update
many libffi files that were missed in 3.3.1'
s
update
to
libffi
-
3.0.13
.
many libffi files that were missed in 3.3.1'
s
update
to
libffi
-
3.0.13
.
...
...
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