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

VCF writer - no way to pass escapechar param #12

Open
davmlaw opened this issue Sep 18, 2024 · 0 comments
Open

VCF writer - no way to pass escapechar param #12

davmlaw opened this issue Sep 18, 2024 · 0 comments

Comments

@davmlaw
Copy link

davmlaw commented Sep 18, 2024

If you try and write a string that needs escaping, writing fails with:

need to escape, but no escapechar set

Fix would be to add an escapechar param. Or, just allow **kwargs that you pass to csv.writer (let me know if you want a pull request but this is super simple)

Workaround is to override the writer property

    vcf_writer = Writer(f, vcf_reader)
    # Need to pass escapechar so redefine writer
    vcf_writer.writer = csv.writer(
        f,
        delimiter="\t",
        lineterminator="\n",
        quoting=csv.QUOTE_NONE,
        escapechar="\\",
    )
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

1 participant