Show More
@@ -554,9 +554,10 b' def lookupreg(key, valname=None, scope=N' | |||||
554 | scope = (scope,) |
|
554 | scope = (scope,) | |
555 | for s in scope: |
|
555 | for s in scope: | |
556 | try: |
|
556 | try: | |
557 | val = winreg.QueryValueEx(winreg.OpenKey(s, key), valname)[0] |
|
557 | with winreg.OpenKey(s, encoding.strfromlocal(key)) as hkey: | |
558 | # never let a Unicode string escape into the wild |
|
558 | val = winreg.QueryValueEx(hkey, valname)[0] | |
559 | return encoding.unitolocal(val) |
|
559 | # never let a Unicode string escape into the wild | |
|
560 | return encoding.unitolocal(val) | |||
560 | except EnvironmentError: |
|
561 | except EnvironmentError: | |
561 | pass |
|
562 | pass | |
562 |
|
563 |
General Comments 0
You need to be logged in to leave comments.
Login now