When --log is specified and there already is a file with the same name in the directory, bdfr adds .1/.2/... to the end of the filename, which is the desired behavior. However, for some reason at least on my WIndows machine it always creates one empty file too many, even when there is no file with this name already. So specifying --log log.txt in an empty directory for example creates the logfile log.txt and a empty log.txt.1 file. Running the command again fills this file with the log, but now a new empty log.txt.2 is created, and so on. This isn't a big issue, but deleting the superfluent log files manually is a bit annoying, and it shouldn't happen in the first place.
Command
bdfr download -l 147bge9 --log log.txt ""
Environment (please complete the following information)
OS: Windows 10
Python version: 3.9.4
Shell: Git Bash
Logs
[2023-06-12 07:26:46,245 - bdfr.connector - DEBUG] - Disabling the following modules:
[2023-06-12 07:26:46,246 - bdfr.connector - Level 9] - Created download filter
[2023-06-12 07:26:46,246 - bdfr.connector - Level 9] - Created time filter
[2023-06-12 07:26:46,246 - bdfr.connector - Level 9] - Created sort filter
[2023-06-12 07:26:46,269 - bdfr.connector - Level 9] - Create file name formatter
[2023-06-12 07:26:46,269 - bdfr.connector - DEBUG] - Using unauthenticated Reddit instance
[2023-06-12 07:26:46,270 - bdfr.connector - Level 9] - Created site authenticator
[2023-06-12 07:26:46,270 - bdfr.connector - Level 9] - Retrieved subreddits
[2023-06-12 07:26:46,270 - bdfr.connector - Level 9] - Retrieved multireddits
[2023-06-12 07:26:46,270 - bdfr.connector - Level 9] - Retrieved user data
[2023-06-12 07:26:46,271 - bdfr.connector - Level 9] - Retrieved submissions for given links
[2023-06-12 07:26:46,765 - bdfr.downloader - DEBUG] - Attempting to download submission 147bge9
[2023-06-12 07:26:46,766 - bdfr.downloader - DEBUG] - Using Direct with url https://i.redd.it/peg1a673qh5b1.jpg
[2023-06-12 07:26:46,912 - bdfr.downloader - DEBUG] - Written file to C:\Users\user\Downloads\Temp\197\ORPHAN-OBLITERATOR_wizardposting_147bge9.jpg
[2023-06-12 07:26:46,912 - bdfr.downloader - DEBUG] - Hash added to master list: 07048d78dd98bfd6e424be0fd91997f6
[2023-06-12 07:26:46,912 - bdfr.downloader - INFO] - Downloaded submission 147bge9 from 197
[2023-06-12 07:26:46,912 - root - INFO] - Program complete
Are you running this on Windows and directing it to a location on the same machine? Not a network share but something connected by a physical connection with the NTFS file system?
Are you including the extra "" quotes in the command? What is the purpose that this argument fulfills?
Does this happen when you don't include that last argument?
Description
When --log is specified and there already is a file with the same name in the directory, bdfr adds .1/.2/... to the end of the filename, which is the desired behavior. However, for some reason at least on my WIndows machine it always creates one empty file too many, even when there is no file with this name already. So specifying --log log.txt in an empty directory for example creates the logfile log.txt and a empty log.txt.1 file. Running the command again fills this file with the log, but now a new empty log.txt.2 is created, and so on. This isn't a big issue, but deleting the superfluent log files manually is a bit annoying, and it shouldn't happen in the first place.
Command
Environment (please complete the following information)
Logs