X-Git-Url: https://jfr.im/git/z_archive/twitter.git/blobdiff_plain/192f2893a4bee7b82ca949941c84a104c99fa273..27e0c7a48bc951a35c6e1b9eb914b58f9f74ef23:/twitter/cmdline.py diff --git a/twitter/cmdline.py b/twitter/cmdline.py index e529d84..fd062f0 100644 --- a/twitter/cmdline.py +++ b/twitter/cmdline.py @@ -110,8 +110,8 @@ OPTIONS = { 'refresh_rate': 600, 'format': 'default', 'prompt': '[cyan]twitter[R]> ', - 'config_filename': os.environ.get('HOME', '') + os.sep + '.twitter', - 'oauth_filename': os.environ.get('HOME', '') + os.sep + '.twitter_oauth', + 'config_filename': os.environ.get('HOME', os.environ.get('USERPROFILE', '')) + os.sep + '.twitter', + 'oauth_filename': os.environ.get('HOME', os.environ.get('USERPROFILE', '')) + os.sep + '.twitter_oauth', 'length': 20, 'timestamp': False, 'datestamp': False, @@ -132,8 +132,9 @@ def parse_args(args, options): 'datestamp', 'no-ssl', 'force-ansi'] short_opts = "e:p:f:h?rR:c:l:td" opts, extra_args = getopt(args, short_opts, long_opts) - extra_args = [arg.decode(locale.getpreferredencoding()) - for arg in extra_args] + if extra_args and hasattr(extra_args[0], 'decode'): + extra_args = [arg.decode(locale.getpreferredencoding()) + for arg in extra_args] for opt, arg in opts: if opt in ('-f', '--format'):