nvpy icon indicating copy to clipboard operation
nvpy copied to clipboard

Error saving notes in text file mode

Open klintron opened this issue 12 years ago • 6 comments

I'm using nvPY is text file mode. I've found that if I change a file, then try to exit nvPY, I'll be prompted with "Are you sure you want to exit? I'm still busy: Saving [X] notes."

X varies depending on how long I've left the program open -- it can be thousands of notes, even though I only have 170. If I click "yes" at this prompt I lose my changes.

The display in the lower right corner of the app says "current note modified." Clicking "Sync current note" doesn't seem to help.

It used to work fine, not sure if I did something here or not...

Operating system: Windows 7 nvPY version: 0.9.4

klintron avatar Nov 06 '12 23:11 klintron

Please could you start nvpy from the commandline (python nvpy.py). if the saving loop kicks in, look at the commandline for errors and please paste them back here.

swestdijk avatar Nov 08 '12 11:11 swestdijk

Here we go. FWIW, there is no 11_15_2012 folder in the epistle folder -- not even a hidden one. Could this be a Dropbox issue?

c:\Python27>python c:\python27\scripts\nvpy-script.pyw Exception in thread Thread-1: Traceback (most recent call last): File "c:\Python27\lib\threading.py", line 552, in **bootstrap_inner self.run() File "c:\Python27\lib\threading.py", line 505, in run self.__target(_self.__args, *_self.__kwargs) File "c:\Python27\lib\site-packages\nvpy\notes_db.py", line 813, in worker_sav e self.helper_save_note(o.key, o.note) File "c:\Python27\lib\site-packages\nvpy\notes_db.py", line 441, in helper_sav e_note with codecs.open(fn, mode='wb', encoding='utf-8') as f: File "c:\Python27\lib\codecs.py", line 881, in open file = __builtin**.open(filename, mode, buffering) IOError: [Errno 22] invalid mode ('wb') or filename: u'C:\Users\kl\Documents\ \My Dropbox\epistle\11_15_2012\r.txt'

Here's my cfg:

[nvpy] notes_as_txt = 1 txt_path = C:\Users\kl\Documents\My Dropbox\epistle simplenote_sync = 0

klintron avatar Nov 15 '12 21:11 klintron

Can you confirm that there is no \r on the first line in the note.

Since you are on windows it's maybe a line separator issue ( carriage return (CR) and line feed (LF) )

swestdijk avatar Nov 16 '12 05:11 swestdijk

The first line is "#done"

klintron avatar Nov 16 '12 19:11 klintron

This is very strange; the first line of a note will be the file name of the text note. I don't see any relation between "#done" and "11_15_2012\r.txt".

Have you the line from the nvpy.log at the time of this issue?

I don't use dropbox my self so i can't say anything about this.

swestdijk avatar Nov 17 '12 19:11 swestdijk

That's the whole log -- all I did was launch the app and make a small change to #done

There is no r.txt file either.

klintron avatar Nov 18 '12 21:11 klintron