Tuchuanhuhuhu commited on
Commit
28da654
·
1 Parent(s): e64a20a

修复历史记录文件夹可能会不存在的问题, thanks @libukai ! #722

Browse files
Files changed (1) hide show
  1. modules/utils.py +1 -0
modules/utils.py CHANGED
@@ -580,6 +580,7 @@ def get_latest_filepath(dirname):
580
 
581
  def get_history_filepath(username):
582
  dirname = os.path.join(HISTORY_DIR, username)
 
583
  latest_file = get_latest_filepath(dirname)
584
  if not latest_file:
585
  latest_file = new_auto_history_filename(dirname)
 
580
 
581
  def get_history_filepath(username):
582
  dirname = os.path.join(HISTORY_DIR, username)
583
+ os.mkdir(dirname, exist_ok=True)
584
  latest_file = get_latest_filepath(dirname)
585
  if not latest_file:
586
  latest_file = new_auto_history_filename(dirname)