mirror of
https://github.com/beetbox/beets.git
synced 2026-01-03 14:32:55 +01:00
convert: playlist: Debug commit: Learn syspath()
Learn what's happening in syspath().
This commit is contained in:
parent
da01be3d93
commit
5f5be52a89
1 changed files with 6 additions and 0 deletions
|
|
@ -409,11 +409,17 @@ def syspath(path, prefix=True):
|
|||
# reported as the FS encoding by Windows. Try both.
|
||||
try:
|
||||
path = path.decode('utf-8')
|
||||
print("syspath: this is path:")
|
||||
print(path)
|
||||
except UnicodeError:
|
||||
# The encoding should always be MBCS, Windows' broken
|
||||
# Unicode representation.
|
||||
encoding = sys.getfilesystemencoding() or sys.getdefaultencoding()
|
||||
path = path.decode(encoding, 'replace')
|
||||
print("syspath: this is encoding:")
|
||||
print(encoding)
|
||||
print("syspath: this is path:")
|
||||
print(path)
|
||||
|
||||
# Add the magic prefix if it isn't already there.
|
||||
# https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx
|
||||
|
|
|
|||
Loading…
Reference in a new issue