ddrescue-tui crashes if LogDir doesn't exist #115

Closed
opened 2019-06-11 15:41:28 -06:00 by 2Shirt · 0 comments
2Shirt commented 2019-06-11 15:41:28 -06:00 (Migrated from gitea.2shirt.work)

Create the LogDir before attempting to save to it. Or better yet, always attempt to create the folder if it doesn't exist.

Maybe:

try:
  with open(...) as f:
    #TODO
except Exception:
  if os.path.exists(LogDir):
    raise
  os.makedirs(LogDir)
  #retry
Create the LogDir before attempting to save to it. Or better yet, always attempt to create the folder if it doesn't exist. Maybe: ``` try: with open(...) as f: #TODO except Exception: if os.path.exists(LogDir): raise os.makedirs(LogDir) #retry ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: 2Shirt/WizardKit#115
No description provided.