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

Text-/Comment-Qualifiers corrupt csv import data #11502

Open
q6276270 opened this issue Nov 27, 2024 · 3 comments
Open

Text-/Comment-Qualifiers corrupt csv import data #11502

q6276270 opened this issue Nov 27, 2024 · 3 comments
Assignees
Milestone

Comments

@q6276270
Copy link

q6276270 commented Nov 27, 2024

Overview

In KeypassXC 2.6.6 importing a CSV file a text qualifiers contained in a field breaks the line. Also the recognition of text qualifiers is greedy within the current csv-entry, i.e. it doesn't check wether it is a textqualifier directly followed by a separator or linebreak to close the field.

Steps to Reproduce

  1. Try import csv
  2. Try importing a file with fields containing 3 textqualifiers among other random strings or ending a csv field early with a closing textqualfier.

Expected Behavior

I'd have thought a textqualifier qualifies the entire csv-field as text. To parse this one would have to check for the opening qualifier directly after a linebreak or previous separator and the closing qualfier directly followed by either a linebreak or a separator.
Alternatively it should be possible to disable text/comment-qualifiers.

Actual Behavior

The early closing of the text-qualifier in a csv-field acts similar to a linebreak.

KeePassXC - 2.6.6
Revision: 9c108b9

Operating System: Linux
Desktop Env: Cinnamon

@q6276270 q6276270 added the bug label Nov 27, 2024
@droidmonkey
Copy link
Member

droidmonkey commented Nov 27, 2024

Update to 2.7.9

What you describe, however, sounds like "invalid" CSV formatting. CSV is not a well defined standard, but there are some norms. We support the norms and they are well tested.

Also, you should provide a sample CSV file that fails your test if you want a second opinion.

@q6276270
Copy link
Author

q6276270 commented Nov 27, 2024

In 2.7.9 it also fails with https://pastebin.com/vMT8DEum, separator as "\t" and text qualifier as "|".
It probably is due to invalid CSV-Formatting if you assume a CSV-Format with parsing of qualifiers. That's why I suggested an option to disable qualifiers. Surely a format without them would be valid? It's impossible to automatically and correctly import such a file at the moment if data in the fields contain all of the available qualifiers at some point.

@droidmonkey
Copy link
Member

Ok i can replicate the behavior and it needs fixing, thank you.

@droidmonkey droidmonkey reopened this Nov 27, 2024
@droidmonkey droidmonkey self-assigned this Nov 27, 2024
@droidmonkey droidmonkey added this to the v2.7.10 milestone Nov 27, 2024
@github-project-automation github-project-automation bot moved this to To triage in WIP Tracker Nov 27, 2024
@droidmonkey droidmonkey moved this from To triage to In progress in WIP Tracker Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

No branches or pull requests

2 participants