Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Shell commands fail when paths contain spaces (backup, restore, disk usage) | GoodFirstPicks

Shell commands fail when paths contain spaces (backup, restore, disk usage)

frappe/frappe 1 comments 12d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeFrappe / ERPNextPython

Why this is a good first issue

Shell command failures due to spaces in paths require careful handling across multiple files.

AI Summary

The issue involves shell commands failing when paths contain spaces, affecting multiple files. The proposed fix is to use `shlex.quote()` for paths and executables, but this requires changes across several areas. The scope is somewhat clear, but the cross-cutting nature and potential for regressions increase the difficulty.

Issue Description

Bug

When paths or executable locations contain spaces (e.g. bench in ~/My Documents/frappe-bench), shell commands built with string concatenation fail. The shell splits on spaces, causing errors like:

/bin/bash: /path/to/My: is a directory

Affected areas

  • frappe/utils/backups.py – GPG enc/dec, tar, SQLite/MariaDB dump
  • frappe/database/db_manager.py – restore pipeline
  • frappe/utils/__init__.py – get_disk_usage
  • frappe/installer.py – validate_database_sql
  • frappe/commands/site.py – restore/partial-restore file detection

Proposed fix

Use shlex.quote() for all paths and executables passed to execute_in_shell().

Fix branch: https://github.com/debugHere/frappe/tree/fix/shell-path-quoting-spaces

Patch file: shell-path-quoting-fix.patch

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 25 points when you complete it!

Risk Flags

  • cross-cutting changes
  • potential regressions
Loading labels...

Details

Points25 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno
AssigneeAarDG10