Skip to content

Commit

Permalink
fix unicode encode err; _winreg is winreg in py3
Browse files Browse the repository at this point in the history
`(unicode error) 'unicodeescape' codec can't decode bytes in position...`

The Windows path in example was being interpreted as a Unicode escape
sequence.

Leo build: 20190213230228
  • Loading branch information
maphew committed Feb 14, 2019
1 parent 10763f8 commit 79928aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions leo/core/commit_timestamp.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"asctime": "Mon Feb 11 14:02:48 EST 2019",
"timestamp": "20190211140248"
"asctime": "Wed Feb 13 23:02:28 PST 2019",
"timestamp": "20190213230228"
}
9 changes: 6 additions & 3 deletions leo/scripts/register-leo.leox
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def register_leo(pyexe, launchLeo, icon):
else:
g.es("LeoDoc.ico not in expected location, can't continue.")
#@+node:maphew.20130510011223.1646: *3* sample registry outcome
'''This is what the resulting registry key should look like, once exported from
r'''This is what the resulting registry key should look like, once exported from
regedit. The translated hex code is:

"d:\Python27\python.exe" "C:\Users\Matt\Dropbox\apps\leo-editor\launchLeo.py" "%1" %*
Expand Down Expand Up @@ -100,8 +100,11 @@ regedit. The translated hex code is:
# 00,72,00,5c,00,6c,00,61,00,75,00,6e,00,63,00,68,00,4c,00,65,00,6f,00,2e,00,\
# 70,00,79,00,22,00,20,00,22,00,25,00,31,00,22,00,20,00,25,00,2a,00,00,00
#@-others
from _winreg import *

try:
from _winreg import *
except ModuleNotFoundError as err:
from winreg import *

# g.es("\n--- Running register-leo Leo script")

pyexe = g.sys.executable
Expand Down

0 comments on commit 79928aa

Please sign in to comment.