Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wordpress import: could not convert string to float #3535

Closed
varna9000 opened this issue Mar 31, 2021 · 7 comments
Closed

Wordpress import: could not convert string to float #3535

varna9000 opened this issue Mar 31, 2021 · 7 comments

Comments

@varna9000
Copy link

Environment

Python Version: 3.8

Nikola Version: Nikola v8.1.3

Operating System: Mac OS Big Sur

Description:

I'm trying to import wordpress blog, but the following error occurs:

[2021-03-31 17:58:02] INFO: import_wordpress: Downloading https://xxxxxxxxxxxx/wp-content/uploads/2011/11/1.jpg => new_site/files/bg/wp-content/uploads/2011/11/1.jpg
Traceback (most recent call last):
  File "/Users/xxxxx/Library/Python/3.8/lib/python/site-packages/doit/doit_cmd.py", line 190, in run
    return command.parse_execute(args)
  File "/Users/xxxxx/Library/Python/3.8/lib/python/site-packages/doit/cmd_base.py", line 150, in parse_execute
    return self.execute(params, args)
  File "/Users/xxxxx/Library/Python/3.8/lib/python/site-packages/nikola/plugin_categories.py", line 148, in execute
    return self._execute(options, args)
  File "/Users/xxxxx/Library/Python/3.8/lib/python/site-packages/nikola/plugins/command/import_wordpress.py", line 387, in _execute
    self.import_posts(channel)
  File "/Users/xxxxx/Library/Python/3.8/lib/python/site-packages/nikola/plugins/command/import_wordpress.py", line 1138, in import_posts
    self.process_item_if_attachment(item)
  File "/Users/xxxxx/Library/Python/3.8/lib/python/site-packages/nikola/plugins/command/import_wordpress.py", line 1101, in process_item_if_attachment
    data = self.import_attachment(item, wordpress_namespace)
  File "/Users/xxxxx/Library/Python/3.8/lib/python/site-packages/nikola/plugins/command/import_wordpress.py", line 606, in import_attachment
    add('created_timestamp', b'created_timestamp', is_float=True, ignore_zero=True)
  File "/Users/xxxxx/Library/Python/3.8/lib/python/site-packages/nikola/plugins/command/import_wordpress.py", line 593, in add
    value = float(value)
ValueError: could not convert string to float: ''
@Kwpolska
Copy link
Member

We'll need the export file from your blog to debug this. You can limit it to a snippet (only things related to the file mentioned in the error, plus a few more lines of context just in case.

@varna9000
Copy link
Author

Here is the relevant snippet snippet.txt

@varna9000
Copy link
Author

varna9000 commented Apr 29, 2021

I tried commit ef974e7 but it still outputs the same error.

@Kwpolska
Copy link
Member

You’ll need to show us the full export file so we can debug this further.

@varna9000
Copy link
Author

@Kwpolska sure, here it is. It's zipped since apparently GitHub doesn't support xml attachment.
WordPress.2021-03-31.xml.zip

Kwpolska added a commit that referenced this issue Apr 29, 2021
Fix #3535 — correctly handle blank values in WordPress export meta fields
@Kwpolska
Copy link
Member

@varna9000 I tested your export and it works on the fix-3535-wordpress-blank-field branch (commit 11c47d1). Based on that, I merged the change into master. If you encounter issues after updating to master, please report them.

@varna9000
Copy link
Author

Yes, it works! My Nikola install was messed up. Thank you.

devilgate pushed a commit to devilgate/nikola that referenced this issue Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants