claytron / ever2simple

Migrate from evernote to simplenote with markdown formatting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: initial_value must be unicode or None, not str

zhaocai opened this issue · comments

just installed using pip as instructed and tried with the following error.

ever2simple Notes.enex > simplenote.json
Traceback (most recent call last):
File "/usr/local/bin/ever2simple", line 8, in
load_entry_point('ever2simple==1.0a1', 'console_scripts', 'ever2simple')()
File "/Library/Python/2.7/site-packages/ever2simple/core.py", line 16, in main
converter.convert()
File "/Library/Python/2.7/site-packages/ever2simple/converter.py", line 73, in convert
notes = self.prepare_notes(xml_tree)
File "/Library/Python/2.7/site-packages/ever2simple/converter.py", line 43, in prepare_notes
created_string = parse(note.xpath('created')[0].text)
File "/Library/Python/2.7/site-packages/dateutil/parser.py", line 698, in parse
return DEFAULTPARSER.parse(timestr, *_kwargs)
File "/Library/Python/2.7/site-packages/dateutil/parser.py", line 302, in parse
res = self._parse(timestr, *_kwargs)
File "/Library/Python/2.7/site-packages/dateutil/parser.py", line 350, in _parse
l = _timelex.split(timestr)
File "/Library/Python/2.7/site-packages/dateutil/parser.py", line 144, in split
return list(cls(s))
File "/Library/Python/2.7/site-packages/dateutil/parser.py", line 44, in init
instream = StringIO(instream)
TypeError: initial_value must be unicode or None, not str

I have not tested on Python2.7. Looking at the traceback it isn't clear to me why it would fail.

Could you provide me with some examples of the dates in the enex file?

I go to the python-dateutil website and find the problem.

The following files are available.
python-dateutil-2.0.tar.gz (Python >= 3.0)
python-dateutil-1.5.tar.gz (Python < 3.0)

pip installs the 2.0 version by default even for python 2.7. I works now after I install 1.5 version
sudo pip install python-dateutil==1.5 Maybe you can put this in the readme

One more quick question: I am not familiar with json. Can ever2simple export markdown format directly?

I've not tested on Python 3 at all, so I'll need make sure the <2.0 version gets pulled down