Myaamori-Aegisub-Scripts icon indicating copy to clipboard operation
Myaamori-Aegisub-Scripts copied to clipboard

Output file has an additional blank line

Open Ninelpienel opened this issue 1 year ago • 4 comments

Hey, when I use subdigest my output file has an additional blank line at the end. Various other programs that work with ass cannot handle this. Would be great if you could fix this.

Input:

image

Output:

image

Ninelpienel avatar Mar 14 '23 16:03 Ninelpienel

Subdigest doesn't do anything special in this regard, so this may be a result of the upstream ass library. Haven't tried to reproduce it yet, however.

https://github.com/TypesettingTools/Myaamori-Aegisub-Scripts/blob/f2a52ee38eeb60934175722fa9d7f2c2aae015c6/scripts/sub-digest/subdigest.py#L565-L566

FichteFoll avatar Mar 14 '23 19:03 FichteFoll

Just a guess, but perhaps this line?

https://github.com/chireiden/python-ass/blob/8243bd515531fa8e7180941bfc0fbac7fb24702f/ass/document.py#L152

Funami580 avatar Mar 14 '23 19:03 Funami580

Yeah, that should be it. Called from dubdigest via

https://github.com/TypesettingTools/Myaamori-Aegisub-Scripts/blob/f2a52ee38eeb60934175722fa9d7f2c2aae015c6/scripts/sub-digest/subdigest.py#L512-L517

Subdigest would also do better in using the dump_file method with the file it wants to write to directly instead of always writing to a StringIO first and then writing that. Catching the warning may be necessary for writing to stdout, though iirc we fixed overreporting with that warning a while ago. Could also be that it only occurs on Windows, though.

FichteFoll avatar Mar 14 '23 19:03 FichteFoll

Fixed in https://github.com/chireiden/python-ass/releases/tag/0.5.3.

FichteFoll avatar Mar 22 '23 23:03 FichteFoll