OF-Scraper icon indicating copy to clipboard operation
OF-Scraper copied to clipboard

# final_user_script causes error

Open ghi820 opened this issue 6 months ago • 1 comments

final_user_script.py causes ValueError

A clear and concise description of what the bug is.

To Reproduce

run the scraper with a post script

Expected behavior

script is executed

Screenshots/Logs

 2025-06-29 16:01:23:[final_user_script.post_user_script:107]  An unexpected error occurred while running post user script for XXXXXXX with script '/XXXX/scripts/postdl_json.sh': stdout and stderr arguments may not be used with capture_output.
Traceback (most recent call last):
  File "/home/your_username/.local/share/uv/tools/ofscraper/lib/python3.11/site-packages/ofscraper/scripts/final_user_script.py", line 71, in post_user_script
    result = run(
             ^^^^
  File "/home/your_username/.local/share/uv/tools/ofscraper/lib/python3.11/site-packages/ofscraper/utils/system/subprocess.py", line 9, in run
    t = subprocess.run(*args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 543, in run
    raise ValueError('stdout and stderr arguments may not be used '
ValueError: stdout and stderr arguments may not be used with capture_output.
 2025-06-29 16:01:23:[level.inner:10]  stdout and stderr arguments may not be used with capture_output.
 2025-06-29 16:01:23:[level.inner:10]  Traceback (most recent call last):
  File "/home/your_username/.local/share/uv/tools/ofscraper/lib/python3.11/site-packages/ofscraper/scripts/final_user_script.py", line 71, in post_user_script
    result = run(
             ^^^^
  File "/home/your_username/.local/share/uv/tools/ofscraper/lib/python3.11/site-packages/ofscraper/utils/system/subprocess.py", line 9, in run
    t = subprocess.run(*args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 543, in run
    raise ValueError('stdout and stderr arguments may not be used '
ValueError: stdout and stderr arguments may not be used with capture_output.

Config

actually irrelevant (call error between run() and the final_user_script call...

System Info

  • OS: Linux (Debian)
  • uv install, 3.13.4

Additional context

Add any other context about the problem here.

ghi820 avatar Jun 29 '25 16:06 ghi820

ValueError: stdout and stderr arguments may not be used with capture_output.

es error del código: en subprocess.run() usa capture_output=True y stdout= y stderr= es como si dijeras dos veces qué hacer con la salida

por ejemplo:

  • usar capture_output y NO poner stdout o stderr:
subprocess.run(
    ["echo", "hello"],
    capture_output=True,
    text=True
)
  • O usar stdout y stderr y NO capture_output:
subprocess.run(
    ["echo", "hello"],
    stdout=subprocess.PIPE,
    stderr=subprocess.PIPE,
    text=True
)

Puk0 avatar Jun 29 '25 23:06 Puk0