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
090eb1fd
Kaydet (Commit)
090eb1fd
authored
Mar 27, 2014
tarafından
Ned Deily
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #6676: merge from 3.4
üst
dccfa13c
e7d532fb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
2 deletions
+26
-2
pyexpat.rst
Doc/library/pyexpat.rst
+8
-1
test_pyexpat.py
Lib/test/test_pyexpat.py
+12
-0
NEWS
Misc/NEWS
+5
-0
pyexpat.c
Modules/pyexpat.c
+1
-1
No files found.
Doc/library/pyexpat.rst
Dosyayı görüntüle @
090eb1fd
...
...
@@ -100,6 +100,11 @@ The :mod:`xml.parsers.expat` module contains two functions:
http://www.python.org/ns/ elem1
elem2
Due to limitations in the ``Expat`` library used by :mod:`pyexpat`,
the :class:`xmlparser` instance returned can only be used to parse a single
XML document. Call ``ParserCreate`` for each document to provide unique
parser instances.
.. seealso::
...
...
@@ -119,7 +124,9 @@ XMLParser Objects
Parses the contents of the string *data*, calling the appropriate handler
functions to process the parsed data. *isfinal* must be true on the final call
to this method. *data* can be the empty string at any time.
to this method; it allows the parsing of a single file in fragments,
not the submission of multiple files.
*data* can be the empty string at any time.
.. method:: xmlparser.ParseFile(file)
...
...
Lib/test/test_pyexpat.py
Dosyayı görüntüle @
090eb1fd
...
...
@@ -236,6 +236,18 @@ class ParseTest(unittest.TestCase):
operations
=
out
.
out
self
.
_verify_parse_output
(
operations
)
def
test_parse_again
(
self
):
parser
=
expat
.
ParserCreate
()
file
=
BytesIO
(
data
)
parser
.
ParseFile
(
file
)
# Issue 6676: ensure a meaningful exception is raised when attempting
# to parse more than one XML document per xmlparser instance,
# a limitation of the Expat library.
with
self
.
assertRaises
(
expat
.
error
)
as
cm
:
parser
.
ParseFile
(
file
)
self
.
assertEqual
(
expat
.
ErrorString
(
cm
.
exception
.
code
),
expat
.
errors
.
XML_ERROR_FINISHED
)
class
NamespaceSeparatorTest
(
unittest
.
TestCase
):
def
test_legal
(
self
):
# Tests that make sure we get errors when the namespace_separator value
...
...
Misc/NEWS
Dosyayı görüntüle @
090eb1fd
...
...
@@ -119,6 +119,11 @@ Library
-
Issue
#
20817
:
Fix
inspect
.
getcallargs
()
to
fail
correctly
if
more
than
3
arguments
are
missing
.
Patch
by
Jeremiah
Lowin
.
-
Issue
#
6676
:
Ensure
a
meaningful
exception
is
raised
when
attempting
to
parse
more
than
one
XML
document
per
pyexpat
xmlparser
instance
.
(
Original
patches
by
Hirokazu
Yamamoto
and
Amaury
Forgeot
d
'Arc, with
suggested wording by David Gutteridge)
Documentation
-------------
...
...
Modules/pyexpat.c
Dosyayı görüntüle @
090eb1fd
...
...
@@ -908,7 +908,7 @@ xmlparse_ParseFile(xmlparseobject *self, PyObject *f)
void
*
buf
=
XML_GetBuffer
(
self
->
itself
,
BUF_SIZE
);
if
(
buf
==
NULL
)
{
Py_XDECREF
(
readmethod
);
return
PyErr_NoMemory
(
);
return
get_parse_result
(
self
,
0
);
}
bytes_read
=
readinst
(
buf
,
BUF_SIZE
,
readmethod
);
...
...
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