Skip to content

Handle NUL bytes in CSV query result export#7766

Open
keerthanapadige wants to merge 1 commit into
getredash:masterfrom
keerthanapadige:fix-csv-null-byte-export
Open

Handle NUL bytes in CSV query result export#7766
keerthanapadige wants to merge 1 commit into
getredash:masterfrom
keerthanapadige:fix-csv-null-byte-export

Conversation

@keerthanapadige

@keerthanapadige keerthanapadige commented Jul 1, 2026

Copy link
Copy Markdown
  • Bug Fix

Description

Fixes CSV export failure when query result string values contain embedded NUL bytes (\x00).

Previously, serialize_query_result_to_dsv() passed row values directly to csv.DictWriter.writerow(). If a string field contained a NUL byte, CSV export could fail with:

_csv.Error: need to escape, but no escapechar set

<!-- This is an auto-generated description by cubic. -->
<a href="https://cubic.dev/pr/getredash/redash/pull/7766?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

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

Successfully merging this pull request may close these issues.

1 participant