Re: [Zope] Error Type: ExpatError

2005-10-13 Thread Garito

Fred Drake escribió:


On 10/13/05, Garito <[EMAIL PROTECTED]> wrote:
 


self.Dame({'nombre': self.getId() + '.mm'})

Dame is a function that returns a ZCatalog query where nombre is an index
   


...
 


This File object returns the text of the last attachment I send you some
mails ago
   



The index_html() method returns the freemind XML?  Interesting.

What version of Python are you using?  Do you have PyXML installed? 
If so, what version are you using?



 -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
 

A File object returns the content of the file if you call index_html() I 
don't know if is the best way (if not please point me!)

My development systems is:

Windows XP Pro
Python 2.3.5
Zope 2.8.0

I'm not conscious about install PyXML then I reply No to your question 
about it


Thanks a lot, Fred, for your help

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-13 Thread Fred Drake
On 10/13/05, Garito <[EMAIL PROTECTED]> wrote:
> self.Dame({'nombre': self.getId() + '.mm'})
>
> Dame is a function that returns a ZCatalog query where nombre is an index
...
> This File object returns the text of the last attachment I send you some
> mails ago

The index_html() method returns the freemind XML?  Interesting.

What version of Python are you using?  Do you have PyXML installed? 
If so, what version are you using?


  -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-13 Thread Garito

Fred Drake escribió:


On 10/12/05, Garito <[EMAIL PROTECTED]> wrote:
 


What do you need?
   



In this bit of code:

Module Products.Yanged.SitioYanged, line 268, in ObtenerNodo
266 |
267 |   if 'NodoRaiz' not in args:
268>|   args['NodoRaiz'] =
parseString(self.Dame({'nombre': self.getId() +
'.mm'}).index_html(self.REQUEST, self.REQUEST.RESPONSE))
269 |   if 'Nodos' not in args: args['Nodos'] =
args['NodoRaiz'].childNodes
270 |   if 'Nivel' not in args: args['Nivel'] = 0

The expression

   self.Dame({'nombre': self.getId() + '.mm'})

is providing something that's being passed to the XML parser (the
parseString() function).  That string is the data that's in question;
if you can get that string and send it to me (as a file attachment,
preferably), I'll try to figure out what's happening.  The "Yanged"
product I've never heard of, and don't know anything about its code. 
But I know something about the XML parser being used.  :-)



 -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
 


Hi again!
self.Dame({'nombre': self.getId() + '.mm'})

Dame is a function that returns a ZCatalog query where nombre is an index

Then this function return a modified File object (the modification 
constist make File CatalogAware)


This File object returns the text of the last attachment I send you some 
mails ago


Yanged is the product I'm developing

Thanks!


--
Mis Cosas
http://blogs.sistes.net/Garito/


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Garito <[EMAIL PROTECTED]> wrote:
> What do you need?

In this bit of code:

Module Products.Yanged.SitioYanged, line 268, in ObtenerNodo
266 |
267 |   if 'NodoRaiz' not in args:
268>|   args['NodoRaiz'] =
parseString(self.Dame({'nombre': self.getId() +
'.mm'}).index_html(self.REQUEST, self.REQUEST.RESPONSE))
269 |   if 'Nodos' not in args: args['Nodos'] =
args['NodoRaiz'].childNodes
270 |   if 'Nivel' not in args: args['Nivel'] = 0

The expression

self.Dame({'nombre': self.getId() + '.mm'})

is providing something that's being passed to the XML parser (the
parseString() function).  That string is the data that's in question;
if you can get that string and send it to me (as a file attachment,
preferably), I'll try to figure out what's happening.  The "Yanged"
product I've never heard of, and don't know anything about its code. 
But I know something about the XML parser being used.  :-)


  -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Garito

Fred Drake escribió:


On 10/12/05, Garito <[EMAIL PROTECTED]> wrote:
 


I run your test but no error was raised
   



Right.

 


I attach an xml file like I use and who raise the error, perhaps these
could help to reproduce the error
   



If you replaced SAMPLE_TEXT in the test script with this data, an
error would indeed be raised, because it's testing that it got the
data from the sample text.  The test was intended to demonstrate that
pyexpat can handle more than 8192 characters of data between tags, and
does so.

I was able to verify well-formedness of your document, and load it
into minidom from a file without problems, using Python 2.3.5 and
2.4.2.  I need more information about what went wrong for you before I
can help with that; the error you received suggests that there was no
input at all.


 -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
 



Hi again Fred!

What do you need?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Garito <[EMAIL PROTECTED]> wrote:
> I run your test but no error was raised

Right.

> I attach an xml file like I use and who raise the error, perhaps these
> could help to reproduce the error

If you replaced SAMPLE_TEXT in the test script with this data, an
error would indeed be raised, because it's testing that it got the
data from the sample text.  The test was intended to demonstrate that
pyexpat can handle more than 8192 characters of data between tags, and
does so.

I was able to verify well-formedness of your document, and load it
into minidom from a file without problems, using Python 2.3.5 and
2.4.2.  I need more information about what went wrong for you before I
can help with that; the error you received suggests that there was no
input at all.


  -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Garito

Alan Milligan escribió:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Garito wrote:
 


Alan Milligan escribió:

Garito wrote:


   


Fred Drake escribió:

 

 


On 10/12/05, Alan Milligan <[EMAIL PROTECTED]> wrote:


   

   


And you are allowed to be.   It is a bit strange in an XML-RPC
dialog to
drop out to http occasionally ...

 
 


Actually, I'd expect large files over XML-RPC to be handled by sending
a URL, and have the client GET the file separately.  But then, I have
weird ideas sometimes.



   

   


This has absolutely nothing on them actually implementing a lot of
their
XML-RPC using HTTP GET, when the protocol clearly states it must be an
HTTP POST ...

(I imagine this is a performance enhancement in that you needn't
xml-parse the payload ...)

 
 


Unless you can make the server a simple front-end to a pile-o-files on
disk, I don't see any benefit.  There's no issue for the client, only
the server, since they want to limit the number of machines they stick
behind the load-balancer.

Ok, I think we've agreed this isn't an Expat issue, but a bug in
RedHat code that's unrelated to using XML in Zope.  The Expat-based
minidom-builder in recent versions of Python is pretty well tested in
practice.


-Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F.
Skinner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


   
   


Hi all!
I use an XML file because I like to use freemind like editor
I think perhaps could be better if I could transform it to a good Zope
object instead of XML but I don't know how to make zope ftp server serve
this file like a method

I know how to read the file (PUT_factory method) but I want freemind to
read a created file

Some idea?

Thanks!

 
 


I've no idea what freemind is, but have you installed ExternalEditor??
With this you should be able to connect any editor you require.  It
works by overriding the PUT method, popularised with both ftp and
web-dav.

Alan
   



 


Sorry for my english
   


Heh, I still don't quite understand what you want ...
 


I would like to create a method on my container that will be a file by FTP
With these I could transform XML to a Zope object better than XML
   



You are aware that you can save arbitrary XML as ZPT with a content-type
of 'text/xml' ...
If you install ExternalEditor, you can edit it with whatever tool you want.

 


I will use PUT_factory to read the XML file but I don't know the write
method
   


Don't you mean GET here - PUT is the write method.

Alan

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDTVTUCfroLk4EZpkRAnzkAJ4ofhPS1vCRwInPdMtMoNZbW55xeQCfYRqW
K0F3qROSptQ9EE8u9aws2/Q=
=dMcF
-END PGP SIGNATURE-
 

Can you put here an example about how to do what I need to do with the 
PUT method?


Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Garito

Alan Milligan escribió:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Garito wrote:
 


Fred Drake escribió:

   


On 10/12/05, Alan Milligan <[EMAIL PROTECTED]> wrote:


 


And you are allowed to be.   It is a bit strange in an XML-RPC dialog to
drop out to http occasionally ...
 
   


Actually, I'd expect large files over XML-RPC to be handled by sending
a URL, and have the client GET the file separately.  But then, I have
weird ideas sometimes.



 


This has absolutely nothing on them actually implementing a lot of their
XML-RPC using HTTP GET, when the protocol clearly states it must be an
HTTP POST ...

(I imagine this is a performance enhancement in that you needn't
xml-parse the payload ...)
 
   


Unless you can make the server a simple front-end to a pile-o-files on
disk, I don't see any benefit.  There's no issue for the client, only
the server, since they want to limit the number of machines they stick
behind the load-balancer.

Ok, I think we've agreed this isn't an Expat issue, but a bug in
RedHat code that's unrelated to using XML in Zope.  The Expat-based
minidom-builder in recent versions of Python is pretty well tested in
practice.


-Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


 


Hi all!
I use an XML file because I like to use freemind like editor
I think perhaps could be better if I could transform it to a good Zope
object instead of XML but I don't know how to make zope ftp server serve
this file like a method

I know how to read the file (PUT_factory method) but I want freemind to
read a created file

Some idea?

Thanks!

   


I've no idea what freemind is, but have you installed ExternalEditor??
With this you should be able to connect any editor you require.  It
works by overriding the PUT method, popularised with both ftp and web-dav.

Alan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDTUosCfroLk4EZpkRAnfkAKC0BFcz3QFO1T/Uc2kpurKjNnKenACgv6vd
Q2rEdQfogS5EA9CE0w8sAf8=
=N+ql
-END PGP SIGNATURE-
 


Sorry for my english
I would like to create a method on my container that will be a file by FTP
With these I could transform XML to a Zope object better than XML

I will use PUT_factory to read the XML file but I don't know the write 
method


Could any one put an example (if these is possible)?

If these FTP behaviour is not possible I think the better solution is 
maintain the XML file. isn't it?


Thanks

PD: freemind link: http://freemind.sourceforge.net/wiki/index.php/Main_Page

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Garito

Fred Drake escribió:


On 10/12/05, Garito <[EMAIL PROTECTED]> wrote:
 


Alan Milligan escribió:
   


You do realise that pyexpat has a limitation of 8192 bytes between xml
tags - if your parse string is longer than this, it will fail.  You can
recompile your expat parser to accept larger sizes, but this drastically
affects performance.
 



Ok, I don't know just where this assertion comes from; I can't
reproduce this at all with the pyexpat in Python 2.3.5 or 2.4.2.  I've
attached a short test program that verifies pyexpat's behavior.


 -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
 




"""Test asserted size limitation of text between tags for pyexpat.

"""
__docformat__ = "reStructuredText"

from xml.parsers import expat

COUNT = 8192 * 10
SAMPLE_TEXT = "abc" + ("-" * COUNT) + "xyz"


buffer = []

def characters(text):
   buffer.append(text)

p = expat.ParserCreate()
p.CharacterDataHandler = characters
p.Parse(SAMPLE_TEXT, True)

text = u"".join(buffer)

assert len(text) == (COUNT + 6)
assert text.startswith(u"abc---")
assert text.endswith(u"---xyz")

# This is expected to print "abc--- ---xyz"
print text[:6], text[-6:]
 


I run your test but no error was raised

I attach an xml file like I use and who raise the error, perhaps these 
could help to reproduce the error


This file is generated by freemind 
(http://freemind.sourceforge.net/wiki/index.php/Main_Page)


Thank you very much for your help

--
Mis Cosas
http://blogs.sistes.net/Garito/



































































































































































































___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Garito

Fred Drake escribió:


On 10/12/05, Alan Milligan <[EMAIL PROTECTED]> wrote:
 


And you are allowed to be.   It is a bit strange in an XML-RPC dialog to
drop out to http occasionally ...
   



Actually, I'd expect large files over XML-RPC to be handled by sending
a URL, and have the client GET the file separately.  But then, I have
weird ideas sometimes.

 


This has absolutely nothing on them actually implementing a lot of their
XML-RPC using HTTP GET, when the protocol clearly states it must be an
HTTP POST ...

(I imagine this is a performance enhancement in that you needn't
xml-parse the payload ...)
   



Unless you can make the server a simple front-end to a pile-o-files on
disk, I don't see any benefit.  There's no issue for the client, only
the server, since they want to limit the number of machines they stick
behind the load-balancer.

Ok, I think we've agreed this isn't an Expat issue, but a bug in
RedHat code that's unrelated to using XML in Zope.  The Expat-based
minidom-builder in recent versions of Python is pretty well tested in
practice.


 -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )
 


Hi all!
I use an XML file because I like to use freemind like editor
I think perhaps could be better if I could transform it to a good Zope 
object instead of XML but I don't know how to make zope ftp server serve 
this file like a method


I know how to read the file (PUT_factory method) but I want freemind to 
read a created file


Some idea?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Alan Milligan <[EMAIL PROTECTED]> wrote:
> And you are allowed to be.   It is a bit strange in an XML-RPC dialog to
> drop out to http occasionally ...

Actually, I'd expect large files over XML-RPC to be handled by sending
a URL, and have the client GET the file separately.  But then, I have
weird ideas sometimes.

> This has absolutely nothing on them actually implementing a lot of their
> XML-RPC using HTTP GET, when the protocol clearly states it must be an
> HTTP POST ...
>
> (I imagine this is a performance enhancement in that you needn't
> xml-parse the payload ...)

Unless you can make the server a simple front-end to a pile-o-files on
disk, I don't see any benefit.  There's no issue for the client, only
the server, since they want to limit the number of machines they stick
behind the load-balancer.

Ok, I think we've agreed this isn't an Expat issue, but a bug in
RedHat code that's unrelated to using XML in Zope.  The Expat-based
minidom-builder in recent versions of Python is pretty well tested in
practice.


  -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> Err. Whats wrong with HTTP to transfer files?
> (Provided its not XML-RPC ;)

Sorry; I was being facetious.


  -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Tino Wildenhain

Fred Drake schrieb:

On 10/12/05, Alan Milligan <[EMAIL PROTECTED]> wrote:


I discovered this a couple of years ago wondering why RedHat's up2date
XML-RPC client didn't wrap download files in base64 tags.  They've
actually done some strange stuff in this client to use normal http calls
to download RPM packages.



Silly RedHat.  Imagine using HTTP to transfer files...


Err. Whats wrong with HTTP to transfer files?
(Provided its not XML-RPC ;)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Alan Milligan <[EMAIL PROTECTED]> wrote:
> I discovered this a couple of years ago wondering why RedHat's up2date
> XML-RPC client didn't wrap download files in base64 tags.  They've
> actually done some strange stuff in this client to use normal http calls
> to download RPM packages.

Silly RedHat.  Imagine using HTTP to transfer files...

> - From memory, the c expat library news up an 8192 char buffer to unpack
> *every* tag contents.  If you extend this size, performance seems to
> degrade massively...

Expat does have a buffer that provides some "context" for the current
event being reported, and the size of that buffer is defined by a
compile-time definition.  It should not be made too large, certainly. 
But it's not the way to retrieve normal document data from the parser,
either.  It's really only intended to do things like allow an
application to retrieve character references when character data is
reported, or to see what a tag actually looks like (we use this for
page templates to help make minimal changes when we don't actually
need to process TAL/METAL/I18N attributes on an element).

Retrieving document text should always be done using the character
data handler and a buffer to ensure the entire data within an element
is collected, since multiple callbacks will be made quite often.


  -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Garito <[EMAIL PROTECTED]> wrote:
> Alan Milligan escribió:
> >You do realise that pyexpat has a limitation of 8192 bytes between xml
> >tags - if your parse string is longer than this, it will fail.  You can
> >recompile your expat parser to accept larger sizes, but this drastically
> >affects performance.

Ok, I don't know just where this assertion comes from; I can't
reproduce this at all with the pyexpat in Python 2.3.5 or 2.4.2.  I've
attached a short test program that verifies pyexpat's behavior.


  -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
"""Test asserted size limitation of text between tags for pyexpat.

"""
__docformat__ = "reStructuredText"

from xml.parsers import expat

COUNT = 8192 * 10
SAMPLE_TEXT = "abc" + ("-" * COUNT) + "xyz"


buffer = []

def characters(text):
buffer.append(text)

p = expat.ParserCreate()
p.CharacterDataHandler = characters
p.Parse(SAMPLE_TEXT, True)

text = u"".join(buffer)

assert len(text) == (COUNT + 6)
assert text.startswith(u"abc---")
assert text.endswith(u"---xyz")

# This is expected to print "abc--- ---xyz"
print text[:6], text[-6:]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Garito <[EMAIL PROTECTED]> wrote:
> Alan Milligan escribió:
...
> >You do realise that pyexpat has a limitation of 8192 bytes between xml
> >tags - if your parse string is longer than this, it will fail.  You can
> >recompile your expat parser to accept larger sizes, but this drastically
> >affects performance.

I certainly wasn't aware of any such limitation.  I'll construct a
test case to verify or refute this, and post the results.


  -Fred

--
Fred L. Drake, Jr.
"Society attacks early, when the individual is helpless." --B.F. Skinner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Garito

Alan Milligan escribió:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Garito wrote:
 


Chris Withers escribió:

   


Get a packet sniffer going, looks like something is missing from the
request when you hit reload!

cheers,

Chris

Garito wrote:

 


Hi all

I try to read an xml file using
from xml.dom.minidom import parseString

It works fine but when I push the reload button raise these error

Error Type: ExpatError
Error Value: no element found: line 1, column 0

These error is intermittence

These is the trace back any idea?

Traceback (innermost last):

Module ZPublisher.Publish, line 113, in publish
111 |  missing_name,
112 |  dont_publish_class,
113>|  request, bind=1)
114 |
115 |if result is not response:

Module ZPublisher.mapply, line 88, in mapply
086 |
087 |args=tuple(args)
088>|if debug is not None: return debug(object,args,context)
089 |else: return object(*args)

Module ZPublisher.Publish, line 40, in call_object
038 |
039 |def call_object(object, args, request):
040>|result=apply(object,args) # Type s to step into
published object.
041 |return result
042 |

Module Shared.DC.Scripts.Bindings, line 311, in __call__
309 |def __call__(self, *args, **kw):
310 |'''Calls the script.'''
311>|return self._bindAndExec(args, kw, None)
312 |
313 |def __render_with_namespace__(self, namespace):

Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
346 |exec bindcode
347 |bound_data = bound_data[0]
348>|return self._exec(bound_data, args, kw)
349 |finally:
350 |security.removeContext(self)

Module Products.PythonScripts.PythonScript, line 323, in _exec
321 |f = new.function(fcode, g, None, fadefs)
322 |
323>|result = f(*args, **kw)
324 |if keyset is not None:
325 |# Store the result in the cache.

Module None, line 9, in Lanzar
 -- Line 9
006 |if 'Camino' not in args: args['Camino'] = traverse_subpath
007 |if 'Usuario' not in args: args['Usuario'] =
str(context.Dame('usuario'))
008>|args = context.ObtenerNodo(args)
009 |
010 |if args is None: Module Products.Yanged.SitioYanged, line 268,
in ObtenerNodo
266 |   267 |if 'NodoRaiz' not in args:
268>|args['NodoRaiz'] = parseString(self.Dame({'nombre':
self.getId() + '.mm'}).index_html(self.REQUEST, self.REQUEST.RESPONSE))
269 |if 'Nodos' not in args: args['Nodos'] =
args['NodoRaiz'].childNodes
270 |if 'Nivel' not in args: args['Nivel'] = 0

Module xml.dom.minidom, line 1929, in parseString
1927 |if parser is None:
1928 |from xml.dom import expatbuilder
1929>|return expatbuilder.parseString(string)
1930 |else:
1931 |from xml.dom import pulldom

Module xml.dom.expatbuilder, line 940, in parseString
938 |else:
939 |builder = ExpatBuilder()
940>|return builder.parseString(string)
941 |
942 |

Module xml.dom.expatbuilder, line 223, in parseString
221 |parser = self.getParser()
222 |try:
223>|parser.Parse(string, True)
224 |self._setup_subset(string)
225 |except ParseEscape:
ExpatError: no element found: line 1, column 0



Thanks!

   


Hi Chris!
Could you be a little more concrete?

Thanks!

   


You do realise that pyexpat has a limitation of 8192 bytes between xml
tags - if your parse string is longer than this, it will fail.  You can
recompile your expat parser to accept larger sizes, but this drastically
affects performance.

ALan

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDTQhkCfroLk4EZpkRAjklAJ9VBl9jjzKvRBr9gN3mcGYePpxYSACgtZkZ
h/hu5V2gGxxKSp8JUk1WpIw=
=b7+S
-END PGP SIGNATURE-
 


Buff! Complicate

There are any out-of-the-box solution on Zope?

I mean: there are any other xml library on a standard Zope installation?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Garito

Chris Withers escribió:

Get a packet sniffer going, looks like something is missing from the 
request when you hit reload!


cheers,

Chris

Garito wrote:


Hi all

I try to read an xml file using
from xml.dom.minidom import parseString

It works fine but when I push the reload button raise these error

Error Type: ExpatError
Error Value: no element found: line 1, column 0

These error is intermittence

These is the trace back any idea?

Traceback (innermost last):

Module ZPublisher.Publish, line 113, in publish
111 |  missing_name,
112 |  dont_publish_class,
113>|  request, bind=1)
114 |
115 |if result is not response:

Module ZPublisher.mapply, line 88, in mapply
086 |
087 |args=tuple(args)
088>|if debug is not None: return debug(object,args,context)
089 |else: return object(*args)

Module ZPublisher.Publish, line 40, in call_object
038 |
039 |def call_object(object, args, request):
040>|result=apply(object,args) # Type s to step into 
published object.

041 |return result
042 |

Module Shared.DC.Scripts.Bindings, line 311, in __call__
309 |def __call__(self, *args, **kw):
310 |'''Calls the script.'''
311>|return self._bindAndExec(args, kw, None)
312 |
313 |def __render_with_namespace__(self, namespace):

Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
346 |exec bindcode
347 |bound_data = bound_data[0]
348>|return self._exec(bound_data, args, kw)
349 |finally:
350 |security.removeContext(self)

Module Products.PythonScripts.PythonScript, line 323, in _exec
321 |f = new.function(fcode, g, None, fadefs)
322 |
323>|result = f(*args, **kw)
324 |if keyset is not None:
325 |# Store the result in the cache.

Module None, line 9, in Lanzar
  -- Line 9
006 |if 'Camino' not in args: args['Camino'] = traverse_subpath
007 |if 'Usuario' not in args: args['Usuario'] = 
str(context.Dame('usuario'))

008>|args = context.ObtenerNodo(args)
009 |
010 |if args is None: Module Products.Yanged.SitioYanged, line 268, 
in ObtenerNodo

266 |   267 |if 'NodoRaiz' not in args:
268>|args['NodoRaiz'] = parseString(self.Dame({'nombre': 
self.getId() + '.mm'}).index_html(self.REQUEST, self.REQUEST.RESPONSE))
269 |if 'Nodos' not in args: args['Nodos'] = 
args['NodoRaiz'].childNodes

270 |if 'Nivel' not in args: args['Nivel'] = 0

Module xml.dom.minidom, line 1929, in parseString
1927 |if parser is None:
1928 |from xml.dom import expatbuilder
1929>|return expatbuilder.parseString(string)
1930 |else:
1931 |from xml.dom import pulldom

Module xml.dom.expatbuilder, line 940, in parseString
938 |else:
939 |builder = ExpatBuilder()
940>|return builder.parseString(string)
941 |
942 |

Module xml.dom.expatbuilder, line 223, in parseString
221 |parser = self.getParser()
222 |try:
223>|parser.Parse(string, True)
224 |self._setup_subset(string)
225 |except ParseEscape:
ExpatError: no element found: line 1, column 0



Thanks!




Hi Chris!
Could you be a little more concrete?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Chris Withers
Get a packet sniffer going, looks like something is missing from the 
request when you hit reload!


cheers,

Chris

Garito wrote:

Hi all

I try to read an xml file using
from xml.dom.minidom import parseString

It works fine but when I push the reload button raise these error

Error Type: ExpatError
Error Value: no element found: line 1, column 0

These error is intermittence

These is the trace back any idea?

Traceback (innermost last):

Module ZPublisher.Publish, line 113, in publish
111 |  missing_name,
112 |  dont_publish_class,
113>|  request, bind=1)
114 |
115 |if result is not response:

Module ZPublisher.mapply, line 88, in mapply
086 |
087 |args=tuple(args)
088>|if debug is not None: return debug(object,args,context)
089 |else: return object(*args)

Module ZPublisher.Publish, line 40, in call_object
038 |
039 |def call_object(object, args, request):
040>|result=apply(object,args) # Type s to step into published 
object.

041 |return result
042 |

Module Shared.DC.Scripts.Bindings, line 311, in __call__
309 |def __call__(self, *args, **kw):
310 |'''Calls the script.'''
311>|return self._bindAndExec(args, kw, None)
312 |
313 |def __render_with_namespace__(self, namespace):

Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
346 |exec bindcode
347 |bound_data = bound_data[0]
348>|return self._exec(bound_data, args, kw)
349 |finally:
350 |security.removeContext(self)

Module Products.PythonScripts.PythonScript, line 323, in _exec
321 |f = new.function(fcode, g, None, fadefs)
322 |
323>|result = f(*args, **kw)
324 |if keyset is not None:
325 |# Store the result in the cache.

Module None, line 9, in Lanzar
  -- Line 9
006 |if 'Camino' not in args: args['Camino'] = traverse_subpath
007 |if 'Usuario' not in args: args['Usuario'] = 
str(context.Dame('usuario'))

008>|args = context.ObtenerNodo(args)
009 |
010 |if args is None: Module Products.Yanged.SitioYanged, line 268, in 
ObtenerNodo
266 |   
267 |if 'NodoRaiz' not in args:
268>|args['NodoRaiz'] = parseString(self.Dame({'nombre': 
self.getId() + '.mm'}).index_html(self.REQUEST, self.REQUEST.RESPONSE))
269 |if 'Nodos' not in args: args['Nodos'] = 
args['NodoRaiz'].childNodes

270 |if 'Nivel' not in args: args['Nivel'] = 0

Module xml.dom.minidom, line 1929, in parseString
1927 |if parser is None:
1928 |from xml.dom import expatbuilder
1929>|return expatbuilder.parseString(string)
1930 |else:
1931 |from xml.dom import pulldom

Module xml.dom.expatbuilder, line 940, in parseString
938 |else:
939 |builder = ExpatBuilder()
940>|return builder.parseString(string)
941 |
942 |

Module xml.dom.expatbuilder, line 223, in parseString
221 |parser = self.getParser()
222 |try:
223>|parser.Parse(string, True)
224 |self._setup_subset(string)
225 |except ParseEscape:
ExpatError: no element found: line 1, column 0



Thanks!



--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )