sickmartian / quick_simplenote

Sublime Text 2 plugin for Simplenote
MIT License
11 stars 7 forks source link

Local changes are not saved #22

Closed lf-araujo closed 6 years ago

lf-araujo commented 7 years ago

Installed for the first time today, using st3.

After configuration, first sync pulls notes correctly, but saving changes in local files are not being kept. Closing the notes causes changes to be lost.

sickmartian commented 7 years ago

A couple of questions.. I'm on ST3 as well and it's working fine for me so it might be related to the use or the platform.

Are you saving over files that have names like [FIRST LINE OF THE FILE] (123456789019283764abcdef) ? Are you saving over an existing note or over a new one? On which platform are you and which version of ST3 are you using? Do you have any other simple note client open at the same time? Do you get something on the console after saving the file? (View -> Show Console)

lf-araujo commented 7 years ago

2017-03-20 23:46 GMT+11:00 sickmartian notifications@github.com:

Are you saving over files that have names like [FIRST LINE OF THE FILE]

(123456789019283764abcdef) ?

Yes

Are you saving over an existing note or over a new one?

Existing one, the problem is ocurring only to existing notes.

On which platform are you and which version of ST3 are you using?

Archlinux

Do you have any other simple note client open at the same time?

Not at the same time.

Do you get something on the console after saving the file? (View -> Show

Console)

Yep. This:

QuickSimplenote: Updating c80c1162e3eb12a9a14443e6a955fd4a Exception in thread Thread-118: Traceback (most recent call last): File "./python3.3/threading.py", line 901, in _bootstrap_inner File "/home/luis/.config/sublime-text-3/Packages/QuickSimplenote/operations.py", line 174, in run note_update_operation = self.simplenote_instance.update_note(self.note) File "/home/luis/.config/sublime-text-3/Packages/QuickSimplenote/simplenote.py", line 137, in update_note request = urllib.request.Request(url, urllib.parse.quote(json.dumps(note)).encode('utf-8')) AttributeError: 'module' object has no attribute 'parse'

Traceback (most recent call last): File "/home/luis/.config/sublime-text-3/Packages/QuickSimplenote/quick_simplenote.py", line 234, in check_operations self.current_operation.join() File "/home/luis/.config/sublime-text-3/Packages/QuickSimplenote/operations.py", line 22, in join result = self.get_result() File "/home/luis/.config/sublime-text-3/Packages/QuickSimplenote/operations.py", line 181, in get_result return self.result AttributeError: 'NoteUpdater' object has no attribute 'result' QuickSimplenote: Sync ommited 1490055930.4877546

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sickmartian/quick_simplenote/issues/22#issuecomment-287749007, or mute the thread https://github.com/notifications/unsubscribe-auth/AJq5LsOo3Au_YqBezJWB5saKmcTr1V1Eks5rnnUtgaJpZM4MiRP3 .

sickmartian commented 7 years ago

Ah, I think I got it. You didn't use a package control to install it, right? I'm guessing you are using the version from master which is not the one you need for ST3, get the latest version here: https://github.com/sickmartian/quick_simplenote/releases/tag/st3-0.2.5

The file simplenote.py should start with import urllib.request, urllib.parse, urllib.error instead of import urllib after the comments. Let me know if this solves the problem.

lf-araujo commented 7 years ago

Great, should I extract it inside sublime-text-3/Packages (and remove the old one)?

2017-03-21 11:41 GMT+11:00 sickmartian notifications@github.com:

Ah, I think I got it. You didn't use a package control to install it, right? I'm guessing you are using the version from master which is not the one you need for ST3, get the latest version here: https://github.com/ sickmartian/quick_simplenote/releases/tag/st3-0.2.5

The file simplenote.py should start with import urllib.request, urllib.parse, urllib.error instead of import urllib after the comments. Let me know if this solves the problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sickmartian/quick_simplenote/issues/22#issuecomment-287942269, or mute the thread https://github.com/notifications/unsubscribe-auth/AJq5LrtIpyVk4waRTI179sX0uCHNYr0Iks5rnxy-gaJpZM4MiRP3 .

lf-araujo commented 7 years ago

Ok, so I removed contents from QuickSimplenote directory and extracted the new files. Problems persist, it is a bit inconsistent. If I close the editor after edit and leave the note file open, as soon as I reopen subl3 some (not all) changes persisted... If I close the file and close the editor, after reopening its all gone, all changes disappears and I am back to the original copy.

The error log:

QuickSimplenote: Updating c80c1162e3eb12a9a14443e6a955fd4a
Exception in thread Thread-7:
Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "/home/luis/.config/sublime-text-3/Packages/QuickSimplenote/operations.py", line 174, in run
    note_update_operation = self.simplenote_instance.update_note(self.note)
  File "/home/luis/.config/sublime-text-3/Packages/QuickSimplenote/simplenote.py", line 137, in update_note
    request = urllib.request.Request(url, urllib.parse.quote(json.dumps(note)).encode('utf-8'))
AttributeError: 'module' object has no attribute 'parse'

Traceback (most recent call last):
  File "/home/luis/.config/sublime-text-3/Packages/QuickSimplenote/quick_simplenote.py", line 234, in check_operations
    self.current_operation.join()
  File "/home/luis/.config/sublime-text-3/Packages/QuickSimplenote/operations.py", line 22, in join
    result = self.get_result()
  File "/home/luis/.config/sublime-text-3/Packages/QuickSimplenote/operations.py", line 181, in get_result
    return self.result
AttributeError: 'NoteUpdater' object has no attribute 'result'
sickmartian commented 7 years ago

Well this is weird.. can you input the next 4 sentences into the console and show me what you get back? I will take a deeper look tomorrow: import urllib import urllib.parse urllib.parse urllib urllib.parse.quote

For reference this is what I'm getting:

>>> import urllib
>>> import urllib.parse
>>> urllib.parse
<module 'urllib.parse' from '/Applications/Sublime Text.app/Contents/MacOS/python3.3.zip/urllib/parse.pyo'>
>>> urllib
<module 'urllib' from '/Applications/Sublime Text.app/Contents/MacOS/python3.3.zip/urllib/__init__.pyo'>
>>> urllib.parse.quote
<function quote at 0x10f5a1680>
lf-araujo commented 7 years ago

Sure,

import urllib import urllib.parse urllib.parse Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'parse' QuickSimplenote: Syncing: 1490060018.888365 urllib <module 'urllib' from '/opt/sublime_text_3/python3.3.zip/urllib/init.pyo'> urllib.parse.quote Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'parse'

sickmartian commented 7 years ago

Okay, let's recapitulate:

That error where urllib.parse doesn't exist is consistent with sublime text 3 using ptyhon2 instead of python3, which doesn't seem to be case as you get /opt/sublime_text_3/python3.3.zip/urllib/__init__.pyo as the location of the module and making this plugin work would be the least of your problems then.

Let's be ultra sure and check your python version on the ST console with:

import sys
sys.version
sys.version_info

In case everything still points to python3, then maybe there was some problem when installing it. Did you compile ST3 from source? Is this the only plugin that is causing you problems? Did you point ST3 to a python installation at any time?

I have no way of replicating your problem short of installing arch linux myself which will take me a while, so I would say you can also try reinstalling python3 and/or ST3 and see if it makes a difference.

lf-araujo commented 7 years ago

Sure, let me try:

2017-03-22 11:24 GMT+11:00 sickmartian notifications@github.com:

Let's be ultra sure and check your python version on the ST console with:

import sys sys.version sys.version_info

import sys sys.version '3.3.6 (default, Sep 22 2016, 23:41:32) \n[GCC 4.6.3]' sys.version_info sys.version_info(major=3, minor=3, micro=6, releaselevel='final', serial=0)

In case everything still points to python3, then maybe there was some problem when installing it. Did you compile ST3 from source?

Installed subl3 from AUR.

Is this the only plugin that is causing you problems?

Yep, and I use it A LOT, as it is my main editor for LaTeX.

Did you point ST3 to a python installation at any time?

Not sure how to do that.

I have no way of replicating your problem short of installing arch linux myself which will take me a while, so I would say you can also try reinstalling python3 and/or ST3 and see if it makes a difference.

Thanks for your help! Will try reinstalling ST3 from another source and see.

Best

lf-araujo commented 6 years ago

I will close this discussion, this was caused by Archlinux transition into python3 somehow. A few updates after and the script started working adequately. Thank you for the support.