I鈥檓 using DayOne Classic integration with iCloud synchronization.
Trying to edit an existing entry. No modifications made to the text itself. Tried with multiple editors (vim, sublime). Always ending up with error message AttributeError: can't set attribute.
fbreunig@nighttrain:~ $ jrnl --version
jrnl version v2.4.2
fbreunig@nighttrain:~ $ echo test | jrnl
[Entry added to default journal]
fbreunig@nighttrain:~ $ jrnl -n 1 --edit
Traceback (most recent call last):
File "/usr/local/bin/jrnl", line 8, in <module>
sys.exit(run())
File "/usr/local/lib/python3.7/site-packages/jrnl/cli.py", line 460, in run
journal.parse_editable_str(edited)
File "/usr/local/lib/python3.7/site-packages/jrnl/DayOneJournal.py", line 150, in parse_editable_str
current_entry.title = line[len(date_blob) - 1 :]
AttributeError: can't set attribute
Note: If I delete the _entire_ text during editing, the entry is being deleted as expected:
[Nothing saved to file]
[1 entry deleted]
Before editing, does the entry have a title? Or just a body?
@MinchinWeb The entry has a title, but no body:
fbreunig@nighttrain:~ $ echo test | jrnl
[Entry added to default journal]
fbreunig@nighttrain:~ $ jrnl -n 1
2020-05-25 21:47 test
fbreunig@nighttrain:~ $ jrnl -n 1 --edit
Traceback (most recent call last):
File "/usr/local/bin/jrnl", line 11, in <module>
load_entry_point('jrnl==2.4.2', 'console_scripts', 'jrnl')()
File "/usr/local/Cellar/jrnl/2.4.2/libexec/lib/python3.8/site-packages/jrnl/cli.py", line 460, in run
journal.parse_editable_str(edited)
File "/usr/local/Cellar/jrnl/2.4.2/libexec/lib/python3.8/site-packages/jrnl/DayOneJournal.py", line 150, in parse_editable_str
current_entry.title = line[len(date_blob) - 1 :]
AttributeError: can't set attribute
I can reproduce it.
Editing is still impossible in new version 2.4.3.
fbreunig@Cod:~ $ jrnl --version
jrnl version v2.4.3
fbreunig@Cod:~ $ echo test | jrnl
[Entry added to default journal]
fbreunig@Cod:~ $ jrnl -n 1
2020-06-28 21:50 test
fbreunig@Cod:~ $ jrnl -n 1 --edit
Traceback (most recent call last):
File "/usr/local/bin/jrnl", line 11, in <module>
load_entry_point('jrnl==2.4.3', 'console_scripts', 'jrnl')()
File "/usr/local/Cellar/jrnl/2.4.3/libexec/lib/python3.8/site-packages/jrnl/cli.py", line 467, in run
journal.parse_editable_str(edited)
File "/usr/local/Cellar/jrnl/2.4.3/libexec/lib/python3.8/site-packages/jrnl/DayOneJournal.py", line 150, in parse_editable_str
current_entry.title = line[len(date_blob) - 1 :]
AttributeError: can't set attribute
Normally, all of our Day One fixes come from @MinchinWeb, but he's been away for a bit, so I'm not sure when this will happen.
@my-flow: When there's a fix for this issue, you'll see an update in this thread. Pull requests are welcome, though, if you'd like to see the fix in jrnl sooner.
I've look at this, and it does this for me too. I'm surprised it never came up for me (it doesn't appear to be a new thing), but I guess I would typically edit my entries outside of jrnl.
My current holdup is that I haven't been able to reproduce this with the behave test suite.
@MinchinWeb I made a draft PR (#989) to repro the issue for you with behave. Let me know if that works for you.
@MinchinWeb I made a draft PR (#989) to repro the issue for you with behave. Let me know if that works for you.
Thank you! 馃檹
We're planning on putting out v2.4.4-beta this weekend, and I'd love to have the fix for this issue in that version.
@MinchinWeb Do you have time to finish the PR for this by Saturday? I'm happy to jump in if you're not available. Just let me know.
@wren It will be tomorrow afternoon before I'm able to look at this at the soonest... I though time might open up during the week, but it never did. I'll push to GitHub as soon as possible if I make any progress.
My next attempt was going to be to just feed the title and text together into Entry.text. Setting the title and body directly doesn't seem to be working; somewhere it tries to parse the incoming entry, and is replacing the title with the first line from the body.
@MinchinWeb Ok, no worries. I'll take a look at this tomorrow morning. Thanks for letting me know!
@my-flow This fix is currently out in the v2.4.4-beta. If you have a chance, can you test it out and confirm this fixes the issue you were seeing?
Thanks, this issue has been resolved with the latest v2.4.4-beta version:
(jrnl-waztzsdI-py3.8) fbreunig@Cod:~/Downloads/jrnl-2.4.4b0 $ jrnl --version
jrnl version v2.4.4b0
(jrnl-waztzsdI-py3.8) fbreunig@Cod:~/Downloads/jrnl-2.4.4b0 $ echo test | jrnl
[Entry added to default journal]
(jrnl-waztzsdI-py3.8) fbreunig@Cod:~/Downloads/jrnl-2.4.4b0 $ jrnl -n 1
2020-07-19 22:22 test
(jrnl-waztzsdI-py3.8) fbreunig@Cod:~/Downloads/jrnl-2.4.4b0 $ jrnl -n 1 --edit
[1 entries modified]
Great job, @MinchinWeb and @wren!
Most helpful comment
Thanks, this issue has been resolved with the latest v2.4.4-beta version:
Great job, @MinchinWeb and @wren!