~mikemc/ubuntuone-client/cleanup-platform-constants

« back to all changes in this revision

Viewing changes to bin/u1sdtool

- Converting abspath to unicode (LP: #917222).

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
        d.addCallback(lambda info: show_public_file_info(info, out))
156
156
        d.addErrback(lambda failure: show_error(failure, out))
157
157
    elif options.path_info:
158
 
        path = os.path.abspath(options.path_info)
 
158
        try:
 
159
            path = options.path_info.decode(sys.getfilesystemencoding())
 
160
        except (UnicodeDecodeError, UnicodeEncodeError):
 
161
            parser.error('PATH %r could not be decoded using the filesystem '
 
162
                         'encoding %r.' % (
 
163
                             options.path_info, sys.getfilesystemencoding()))
 
164
        path = os.path.abspath(path)
159
165
        if not os.path.exists(path):
160
166
            parser.error("PATH: '%s' don't exists" % path)
161
167
        d = sync_daemon_tool.get_metadata(path)