Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output file has an additional blank line #22

Open
Ninelpienel opened this issue Mar 14, 2023 · 4 comments
Open

Output file has an additional blank line #22

Ninelpienel opened this issue Mar 14, 2023 · 4 comments

Comments

@Ninelpienel
Copy link

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

@FichteFoll
Copy link

FichteFoll commented Mar 14, 2023

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.

with open(args.output, 'w', encoding="utf-8-sig") as f:
f.write(str(sub_obj))

@Funami580
Copy link

@FichteFoll
Copy link

Yeah, that should be it. Called from dubdigest via

def __str__(self):
sio = io.StringIO()
with warnings.catch_warnings():
warnings.simplefilter("ignore", UserWarning)
self.sub_file.dump_file(sio)
return sio.getvalue()

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 added a commit to chireiden/python-ass that referenced this issue Mar 22, 2023
@FichteFoll
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants