{"action":"created","issue":{"url":"https://api.github.com/repos/getnikola/nikola/issues/2340","repository_url":"https://api.github.com/repos/getnikola/nikola","labels_url":"https://api.github.com/repos/getnikola/nikola/issues/2340/labels{/name}","comments_url":"https://api.github.com/repos/getnikola/nikola/issues/2340/comments","events_url":"https://api.github.com/repos/getnikola/nikola/issues/2340/events","html_url":"https://github.com/getnikola/nikola/issues/2340","id":153867397,"number":2340,"title":"Importing a Wordpress.com site from xml file","user":{"login":"darkomen","id":869739,"avatar_url":"https://avatars.githubusercontent.com/u/869739?v=3","gravatar_id":"","url":"https://api.github.com/users/darkomen","html_url":"https://github.com/darkomen","followers_url":"https://api.github.com/users/darkomen/followers","following_url":"https://api.github.com/users/darkomen/following{/other_user}","gists_url":"https://api.github.com/users/darkomen/gists{/gist_id}","starred_url":"https://api.github.com/users/darkomen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkomen/subscriptions","organizations_url":"https://api.github.com/users/darkomen/orgs","repos_url":"https://api.github.com/users/darkomen/repos","events_url":"https://api.github.com/users/darkomen/events{/privacy}","received_events_url":"https://api.github.com/users/darkomen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ralsina","id":1579,"avatar_url":"https://avatars.githubusercontent.com/u/1579?v=3","gravatar_id":"","url":"https://api.github.com/users/ralsina","html_url":"https://github.com/ralsina","followers_url":"https://api.github.com/users/ralsina/followers","following_url":"https://api.github.com/users/ralsina/following{/other_user}","gists_url":"https://api.github.com/users/ralsina/gists{/gist_id}","starred_url":"https://api.github.com/users/ralsina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralsina/subscriptions","organizations_url":"https://api.github.com/users/ralsina/orgs","repos_url":"https://api.github.com/users/ralsina/repos","events_url":"https://api.github.com/users/ralsina/events{/privacy}","received_events_url":"https://api.github.com/users/ralsina/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2016-05-09T20:53:41Z","updated_at":"2016-05-31T21:24:49Z","closed_at":null,"body":"Hi, I downloaded a xml file from my wordpress.com site.\r\nI executed the following command:\r\n$ nikola import_wordpress homedarkomen.wordpress.2016-05-09.001.xml \r\nIt's start to import the site, but I get the following error:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/Users/darkomen/anaconda/lib/python3.5/site-packages/doit/doit_cmd.py\", line 168, in run\r\n    return command.parse_execute(args)\r\n  File \"/Users/darkomen/anaconda/lib/python3.5/site-packages/doit/cmd_base.py\", line 122, in parse_execute\r\n    return self.execute(params, args)\r\n  File \"/Users/darkomen/anaconda/lib/python3.5/site-packages/nikola/plugin_categories.py\", line 124, in execute\r\n    return self._execute(options, args)\r\n  File \"/Users/darkomen/anaconda/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py\", line 355, in _execute\r\n    self.import_posts(channel)\r\n  File \"/Users/darkomen/anaconda/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py\", line 1057, in import_posts\r\n    self.process_item_if_attachment(item)\r\n  File \"/Users/darkomen/anaconda/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py\", line 1020, in process_item_if_attachment\r\n    data = self.import_attachment(item, wordpress_namespace)\r\n  File \"/Users/darkomen/anaconda/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py\", line 563, in import_attachment\r\n    add('aperture', b'aperture', is_float=True, ignore_zero=True)\r\n  File \"/Users/darkomen/anaconda/lib/python3.5/site-packages/nikola/plugins/command/import_wordpress.py\", line 547, in add\r\n    if wp_key in image_meta:\r\nTypeError: argument of type 'bool' is not utterable\r\n```\r\nAnd it stopped the importation.\r\nHow can I solve this problem?"},"comment":{"url":"https://api.github.com/repos/getnikola/nikola/issues/comments/222825732","html_url":"https://github.com/getnikola/nikola/issues/2340#issuecomment-222825732","issue_url":"https://api.github.com/repos/getnikola/nikola/issues/2340","id":222825732,"user":{"login":"felixfontein","id":5781356,"avatar_url":"https://avatars.githubusercontent.com/u/5781356?v=3","gravatar_id":"","url":"https://api.github.com/users/felixfontein","html_url":"https://github.com/felixfontein","followers_url":"https://api.github.com/users/felixfontein/followers","following_url":"https://api.github.com/users/felixfontein/following{/other_user}","gists_url":"https://api.github.com/users/felixfontein/gists{/gist_id}","starred_url":"https://api.github.com/users/felixfontein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixfontein/subscriptions","organizations_url":"https://api.github.com/users/felixfontein/orgs","repos_url":"https://api.github.com/users/felixfontein/repos","events_url":"https://api.github.com/users/felixfontein/events{/privacy}","received_events_url":"https://api.github.com/users/felixfontein/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T21:24:49Z","updated_at":"2016-05-31T21:24:49Z","body":"With Python 3.5, I get the same stack trace. Changing lines 542 to 544 in `import_wordpress.py` from\r\n```\r\n                    if meta_key in metadata:\r\n                        image_meta = metadata[meta_key]\r\n                        dst_meta = {}\r\n```\r\nto\r\n```\r\n                    if meta_key in metadata:\r\n                        image_meta = metadata[meta_key]\r\n                        if not image_meta:\r\n                            continue\r\n                        dst_meta = {}\r\n```\r\nfixes the problem. (`metadata` is `{b'hwstring_small': b\"height='96' width='128'\", b'width': 800, b'thumb': b'p1000749.miniatura.jpg', b'height': 600, b'image_meta': False, b'file': b'/home/wpcom/public_html/wp-content/blogs.dir/359/12536/files/2007/02/p1000749.jpg'}` for one image.)\r\n\r\nAbout the collisions: part of the problem seems to be that in some cases, tags and categories are very similar (up to case, or special characters such as '/'). Since the import plugin converts categories to tags by default, this leads to the above errors. Specifying `--export-categories-as-categories` partially helps, as multiple categories per post are used. It's probably best to export it with conflicting tags and then to massage the output by hand. (Since these are text files, this isn't too hard with a bit of scripting / text editor magic.)"}}
{"actor":{"display_login":"felixfontein"}}