[ZCM] [ZC] 2051/ 9 Resolve "xml import export fail"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Sun Mar 26 14:08:39 EST 2006


Issue #2051 Update (Resolve) "xml import export fail"
 Status Resolved, Zope/bug low
To followup, visit:
  http://www.zope.org/Collectors/Zope/2051

==============================================================
= Resolve - Entry #9 by tseaver on Mar 26, 2006 2:08 pm

 Status: Accepted => Resolved

Andreas applied Okinori's patch to the 2.8 branch:

 http://svn.zope.org/Zope/branches/Zope-2_8-branch/?rev=66165&view=rev

the 2.9 branch:

 http://svn.zope.org/Zope/branches/2.9/?rev=66164&view=rev

and the head:

 http://svn.zope.org/Zope/trunk/?rev=66166&view=rev

I added tests for XML export import to the 2.8 branch:

 http://svn.zope.org/Zope/branches/Zope-2_8-branch/?rev=66178&view=rev

the 2.9 branch:

 http://svn.zope.org/Zope/branches/2.9/?rev=66179&view=rev

and the head:

 http://svn.zope.org/Zope/trunk/?rev=66180&view=rev


________________________________________
= Accept - Entry #8 by tseaver on Mar 26, 2006 1:47 pm

 Status: Pending => Accepted

 Supporters added: tseaver


Uploaded:  "collector_2051.patch"
 - http://www.zope.org/Collectors/Zope/2051/collector_2051.patch/view
Yoshinori Okuji has supplied a patch which corrects the problem:

 http://mail.zope.org/pipermail/zope-dev/2006-March/027152.html

I have a unit test in hand which exercises it.  To test properly,
we need to be exporting CDATA whose length is longer than 127
characters.  My test, along with Okuji's patch, are attached.
________________________________________
= Comment - Entry #7 by ajung on Mar 24, 2006 11:36 am

Follow the related discussion on the zope-dev mailinglist
________________________________________
= Comment - Entry #6 by allison on Mar 24, 2006 11:22 am

ajung is wrong.  The importance of this bug should be reset to medium or higher.

I agree that the XML format is mostly useless, but it does provide a workaround when the .zexp format is not 
maintained backwards and forward compatible, as is the current situation.  The use case that triggered this bug was the need to move material from newer Zope to an older version.

If the XML export feature is not to be supported, the formal process should be followed: it should be announded and discussed, warning messages put in place, and then (after an appropriate period of time) the support removed.   BUT, that means that the zexp format needs to be maintained both forward and backwards compatible since one of the uses for the XML format is to provide a workaround when zexp is not available.


________________________________________
= Comment - Entry #5 by ajung on Mar 24, 2006 10:37 am

XML export is (in my opinion) one of the useless features of Zope. .zexp export/import is the most common used and support format. The generated XML is pretty much unusable and too low-leve for doing anything useful with it. I consider XML export/import as a feature to be deprecated officially.

Use .zexp instead
________________________________________
= Edit - Entry #4 by ajung on Mar 24, 2006 10:35 am

 Changes: submitter email, edited transcript, importance (medium => low)
________________________________________
= Comment - Entry #3 by allison on Mar 20, 2006 8:07 pm


Export-Import-Failure

<dtml-var standard_html_header>
A trivial dtml-method as an example<br>
<dtml-var standard_html_footer>

Export as XML to Server

<?xml version="1.0"?>
<ZopeData>
  <record id="88531" aka="AAAAAAABWdM=">
    <pickle>
      <tuple>
          <global name="DTMLMethod" module="OFS.DTMLMethod"/>
          <tuple/>
      </tuple>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string encoding="repr">_vars</string> </key>
            <value>
              <dictionary/>
            </value>
        </item>
        <item>
            <key> <string encoding="repr">title</string> </key>
            <value> <string encoding="repr"></string> </value>
        </item>
        <item>
            <key> <string encoding="repr">raw</string> </key>
            <value> <string encoding="cdata"><![CDATA[

<dtml-var standard_html_header>\n
A trivial dtml-method as an example<br>\n
<dtml-var standard_html_footer>

]]></string> </value>
        </item>
        <item>
            <key> <string encoding="repr">globals</string> </key>
            <value>
              <dictionary/>
            </value>
        </item>
        <item>
            <key> <string encoding="repr">__name__</string> </key>
            <value> <string encoding="repr">Export-Import-Failure</string>
</value>
        </item>
        <item>
            <key> <string encoding="repr">__ac_local_roles__</string>
</key>
            <value>
              <dictionary>
                <item>
                    <key> <string encoding="repr">allison</string> </key>
                    <value>
                      <list>
                          <string encoding="repr">Owner</string>
                      </list>
                    </value>
                </item>
              </dictionary>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>

and move to the input directory of the Zope instance.

Delete the original.
Import the XML

And, voila, the error appears --

Site Error

An error was encountered while publishing this resource.

Error Type: UnicodeDecodeError
Error Value: 'ascii' codec can't decode byte 0xd3 in position 7: ordinal
not in range(128)

Troubleshooting Suggestions

    * The URL may be incorrect.
    * The parameters passed to this resource may be incorrect.
    * A resource that this resource relies on may be encountering an
error.

For more detailed information about the error, please refer to the HTML
source for this page.

If the error persists please contact the site maintainer. Thank you for
your patience.


________________________________________
= Comment - Entry #2 by camil7 on Mar 20, 2006 5:31 pm

Any chance to get the XML file in question, or some
small sample whcih reproduces the issue?

Can the problem be reproduced by importing the file to the same
zope instance (e.g. after renaming the original object)?
________________________________________
= Request - Entry #1 by allison on Mar 19, 2006 7:31 pm

Two Zope instances.  Export one file from the first Zope instance (a DTML method) to Desktop, then ftp the file to the import folder of second Zope instance and attempted to import.  The result was the folling error:

Time  	2006/03/19 16:21:35.335 US/Pacific
User Name (User Id) 	allison (allison)
Request URL 	http://devtoo.agilemind.com/draPlay/manage_importObject
Exception Type 	UnicodeDecodeError
Exception Value 	'ascii' codec can't decode byte 0xa4 in position 25: ordinal not in range(128)

Traceback (innermost last):

    * Module ZPublisher.Publish, line 113, in publish
    * Module ZPublisher.mapply, line 88, in mapply
    * Module ZPublisher.Publish, line 40, in call_object
    * Module OFS.ObjectManager, line 585, in manage_importObject
    * Module OFS.ObjectManager, line 602, in _importObjectFromFile
    * Module ZODB.ExportImport, line 65, in importFile
    * Module OFS.XMLExportImport, line 114, in importXML
    * Module Shared.DC.xml.xyap, line 58, in unknown_endtag
    * Module OFS.XMLExportImport, line 93, in save_record

UnicodeDecodeError: 'ascii' codec can't decode byte 0xa4 in position 25: ordinal not in range(128)


==============================================================



More information about the Zope-Collector-Monitor mailing list