Sep-16-2020, 01:23 AM
Thanks for the response.
To address the first part, I should be able to just add the brackets around the list of arguments, right?
Your elif block suggestion is great. Thank you!
To address the first part, I should be able to just add the brackets around the list of arguments, right?
subprocess.run(['mktorrent', '-vp', '-s', 'HUH', '-l', piece_size, '-a', 'https://sometracker.org/announce.php', target_file, '-o', torrent_name, final_dest])With that change, I'm now receiving the following error:
Error:Traceback (most recent call last):
File "C:\Users\REMOVED\python_apps\my_progs\create_torrent\create_torrent.py", line 39, in <module>
subprocess.run(['mktorrent', '-vp', '-s', 'HUH', '-l', piece_size, '-a', 'https://sometracker.org/announce.php', target_file, '-o', torrent_name, final_dest])
File "C:\Users\REMOVED\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 489, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\REMOVED\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\REMOVED\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1247, in _execute_child
args = list2cmdline(args)
File "C:\Users\REMOVED\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 549, in list2cmdline
for arg in map(os.fsdecode, seq):
File "C:\Users\REMOVED\AppData\Local\Programs\Python\Python38-32\lib\os.py", line 818, in fsdecode
filename = fspath(filename) # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not int
The only integer in the command is piece_size. Does this mean that there's an issue with the command argument order? I was hoping to avoid that by verifying the expected command worked in cmd.Your elif block suggestion is great. Thank you!