Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Error reading #5

Closed
ylansegal opened this Issue · 10 comments

7 participants

@ylansegal

Hey, thanks for making this available. I am getting the following error:

$ python exitwp.py
reading: wordpress-xml/wordpress.2011-08-25.xml
Traceback (most recent call last):
  File "exitwp.py", line 299, in <module>
    data=parse_wp_xml(wpe)
  File "exitwp.py", line 135, in parse_wp_xml
    'items': parse_items(),
  File "exitwp.py", line 119, in parse_items
    'date' : gi('wp:post_date'),
  File "exitwp.py", line 99, in gi
    result=i.find(ns[namespace]+tag).text
AttributeError: 'NoneType' object has no attribute 'text'

Thanks,

@thomasf
Owner

it's either some property or xml namespace that does not exist or a tag that is supposed to be required but does not exist..It is a good idea to add more exception handling around these parts of the application.
If you can send me the wordpress.xml file either in private or paste it here i could take a look at an stack trace and speed up finding out whats wrong since I don't have very much time available for this project right now.

@ylansegal

Thomas,

I sent you the wordpress file by email. Thanks a lot!

@thomasf
Owner

it seems like you have exported from wordpress 3.0,,, only wordpress 3.1 or later is supposed to be supported.
Do you have the possibility to upgrade your wordpress installation?

@ylansegal
@tommi

FYI, I'm having the same issue with wordpress.com export from today. The export is with export 1.0 XML namespace.

@lucapost

I have similar error from xml by wordpress.com blog. I get:

python exitwp.py
reading: wordpress-xml/blog.xml
Traceback (most recent call last):
File "exitwp.py", line 296, in
data=parse_wp_xml(wpe)
File "exitwp.py", line 61, in parse_wp_xml
root=tree.parse(file)
File "/usr/lib/python2.6/xml/etree/ElementTree.py", line 586, in parse
parser.feed(data)
File "/usr/lib/python2.6/xml/etree/ElementTree.py", line 1245, in feed
self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: unbound prefix: line 107, column 1

can you help me about?

@csegura

Same here, I'm doing it from wordpress 3.3.1 and SOLVED deleting more than 1200 spam comments ...

@amithgeorge amithgeorge referenced this issue from a commit in amithgeorge/exitwp
@amithgeorge amithgeorge fixed issue #5
wordpress exports the xml namespace wp with the url http://wordpress.org/export/1.1/ ...
the code was expecting http://wordpress.org/export/1.2/
086b379
@Spreadcat

Have the same issue with an export of 3.3.1.

@alexmuller

My <rss> tag from a 3.3.1 export looks like this:

<rss xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wp="http://wordpress.org/export/1.1/" version="2.0">

Can confirm that @amithgeorge's commit fixes this issue for me!

@Spreadcat

Confirmed. RSS is the same. Mentioned commit fixed the issue for me as well. thx

@amithgeorge amithgeorge referenced this issue from a commit in amithgeorge/exitwp
@amithgeorge amithgeorge better fix for issue #5
the code now parses and generates the required xml prefixes and namespaces.
no need to hard code any uris. works with the wp namespace version 1.2 and 1.1 ...
Tested against my Wordpress 3.3.1 exported xml
c69e8e9
@thomasf thomasf closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.