[PR #126] [MERGED] Fix subprocess.run() crash in CRON job setup #122

Closed
opened 2026-03-02 04:06:53 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/FujiwaraChoki/MoneyPrinterV2/pull/126
Author: @FujiwaraChoki
Created: 2/26/2026
Status: Merged
Merged: 2/26/2026
Merged by: @FujiwaraChoki

Base: mainHead: fix/cron-job-subprocess-command


📝 Commits (1)

  • e8bd963 Fix subprocess.run() crash in CRON job setup

📊 Changes

1 file changed (+2 additions, -22 deletions)

View changed files

📝 src/main.py (+2 -22)

📄 Description

Summary

  • subprocess.run() in both YouTube and Twitter CRON job functions was called with a string command (e.g. "python /path/cron.py youtube uuid"), but without shell=True. This causes Python to treat the entire string as a single executable name, resulting in a FileNotFoundError whenever a user tries to set up scheduled uploads or posts.
  • Changed command construction from an f-string to a list (["python", path, "youtube", id]), which subprocess.run() handles correctly and is also safer against shell injection.

Test plan

  • Set up a YouTube CRON job (option 3 in YouTube menu) and verify no crash on job creation
  • Set up a Twitter CRON job (option 3 in Twitter menu) and verify no crash on job creation
  • Verify scheduled job executes cron.py correctly when triggered

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/FujiwaraChoki/MoneyPrinterV2/pull/126 **Author:** [@FujiwaraChoki](https://github.com/FujiwaraChoki) **Created:** 2/26/2026 **Status:** ✅ Merged **Merged:** 2/26/2026 **Merged by:** [@FujiwaraChoki](https://github.com/FujiwaraChoki) **Base:** `main` ← **Head:** `fix/cron-job-subprocess-command` --- ### 📝 Commits (1) - [`e8bd963`](https://github.com/FujiwaraChoki/MoneyPrinterV2/commit/e8bd96356b4c876edffc03f3776b37a5efdb43fc) Fix subprocess.run() crash in CRON job setup ### 📊 Changes **1 file changed** (+2 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `src/main.py` (+2 -22) </details> ### 📄 Description ## Summary - `subprocess.run()` in both YouTube and Twitter CRON job functions was called with a **string** command (e.g. `"python /path/cron.py youtube uuid"`), but without `shell=True`. This causes Python to treat the entire string as a single executable name, resulting in a `FileNotFoundError` whenever a user tries to set up scheduled uploads or posts. - Changed command construction from an f-string to a **list** (`["python", path, "youtube", id]`), which `subprocess.run()` handles correctly and is also safer against shell injection. ## Test plan - [x] Set up a YouTube CRON job (option 3 in YouTube menu) and verify no crash on job creation - [x] Set up a Twitter CRON job (option 3 in Twitter menu) and verify no crash on job creation - [x] Verify scheduled job executes `cron.py` correctly when triggered 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:06:53 +03:00
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
starred/MoneyPrinterV2#122
No description provided.