danielmagnussons / orgmode

orgmode is for keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system.
MIT License
753 stars 70 forks source link

open_recently_closed does not work on sb3 #27

Closed danielmagnussons closed 10 years ago

danielmagnussons commented 10 years ago

ctrl+shift+t gives this:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 207, in on_load
    callback.on_load(v)
  File "C:\Users\ok\AppData\Roaming\Sublime Text 3\Packages\orgmode\open_recently_closed_file.py", line 75, in on_load
    project_name = get_current_project_hash()
  File "C:\Users\ok\AppData\Roaming\Sublime Text 3\Packages\orgmode\open_recently_closed_file.py", line 57, in get_current_project_hash
    m.update(path)
TypeError: Unicode-objects must be encoded before hashing

Found easy fix:

def get_current_project_hash():
    m = hashlib.md5()
    for path in sublime.active_window().folders():
        m.update(path.encode('utf-8'))  # fix here, encode utf8
    return m.hexdigest()
melku commented 10 years ago

On my side, to solve this issue, I just removed the open_recently_closed_file script and the shortcut to it in the sublime-keymap file. Sublime Text has this functionality built in now.