keep icon indicating copy to clipboard operation
keep copied to clipboard

Windows strftime incompatibility

Open KaelBaldwin opened this issue 8 years ago • 3 comments

Not sure if this is the only roadblock to windows compatibility, but I think the %D strftime format code isn't compatible with windows?

I attempted to run this on python 3.4 and I'm getting:

Traceback (most recent call last):                                                     
  File "c:\python34\lib\runpy.py", line 170, in _run_module_as_main                    
    "__main__", mod_spec)                                                              
  File "c:\python34\lib\runpy.py", line 85, in _run_code                               
    exec(code, run_globals)                                                            
  File "C:\Python34\Scripts\keep.exe\__main__.py", line 9, in <module>                 
  File "c:\python34\lib\site-packages\click\core.py", line 722, in __call__            
    return self.main(*args, **kwargs)                                                  
  File "c:\python34\lib\site-packages\click\core.py", line 696, in main                
    with self.make_context(prog_name, args, **extra) as ctx:                           
  File "c:\python34\lib\site-packages\click\core.py", line 621, in make_context        
    self.parse_args(ctx, args)                                                         
  File "c:\python34\lib\site-packages\click\core.py", line 1018, in parse_args         
    rest = Command.parse_args(self, ctx, args)                                         
  File "c:\python34\lib\site-packages\click\core.py", line 880, in parse_args          
    value, args = param.handle_parse_result(ctx, opts, args)                           
  File "c:\python34\lib\site-packages\click\core.py", line 1404, in handle_parse_result
    self.callback, ctx, self, value)                                                   
  File "c:\python34\lib\site-packages\click\core.py", line 78, in invoke_param_callback
    return callback(ctx, param, value)                                                 
  File "c:\python34\lib\site-packages\click\core.py", line 809, in show_help           
    echo(ctx.get_help(), color=ctx.color)                                              
  File "c:\python34\lib\site-packages\click\core.py", line 496, in get_help            
    return self.command.get_help(self)                                                 
  File "c:\python34\lib\site-packages\click\core.py", line 830, in get_help            
    self.format_help(ctx, formatter)                                                   
  File "c:\python34\lib\site-packages\click\core.py", line 845, in format_help         
    self.format_options(ctx, formatter)                                                
  File "c:\python34\lib\site-packages\click\core.py", line 956, in format_options      
    self.format_commands(ctx, formatter)                                               
  File "c:\python34\lib\site-packages\click\core.py", line 1000, in format_commands    
    for subcommand in self.list_commands(ctx):                                         
  File "c:\python34\lib\site-packages\keep\cli.py", line 40, in list_commands          
    utils.check_update()                                                               
  File "c:\python34\lib\site-packages\keep\utils.py", line 23, in check_update         
    today = datetime.date.today().strftime("%D")                                       
ValueError: Invalid format string                                                      ```

KaelBaldwin avatar Feb 24 '17 15:02 KaelBaldwin

manually changing to %d worked for me... dunno if this will cause any other problems down the road.

KaelBaldwin avatar Feb 24 '17 15:02 KaelBaldwin

@KaelBaldwin I'm sorry I didn't test it on Windows, my bad. Can you confirm that this change makes Keep compatible with Windows? It'd be great if you could send the PR. :)

OrkoHunter avatar Feb 24 '17 16:02 OrkoHunter

@OrkoHunter No Problem, this is a neat tool, thank you for making it!

It does work on windows with the change, I'll have to double check linux, but I don't see why it wouldn't. I'll submit a PR when I have a little free time to double check that.

KaelBaldwin avatar Feb 24 '17 16:02 KaelBaldwin