Address Book import of CSV files messes up on quoted fields

RESOLVED FIXED in Thunderbird 19.0


Address Book
5 years ago
5 years ago


(Reporter: grawlix.computing, Assigned: mconley)


({regression, testcase})

16 Branch
Thunderbird 19.0
regression, testcase

Thunderbird Tracking Flags

(thunderbird16 affected, thunderbird17+ fixed, thunderbird18 fixed)



(3 attachments)



5 years ago
Created attachment 673563 [details]

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0
Build ID: 20121010144125

Steps to reproduce:

I've attempted to import a simple CSV file into the Address Book.  The file is attached.

Actual results:

The record was imported, but the fields were not properly extracted from their quoted format in the file.  For example, instead of getting:

Acer America

...this was imported:

"Acer Americ

Expected results:

Quoted fields should not be mangled on import.

Comment 1

5 years ago
This can be reliably reproduced on two systems running Thunderbird 16.0.1.  One system is running Windows 7 (64-bit), and the other, Windows XP SP3.

Comment 2

5 years ago
I should also add that I believe this bug has shown up with the 16.0.1 update, as I have been routinely been making this type of import up to this point with no difficulties.
Grawlix can you try to find out when this regressed (eg using nightly builds just for that) ?
Component: Untriaged → Address Book
Ever confirmed: true
Keywords: regression, regressionwindow-wanted, testcase

Comment 4

5 years ago
The defect is not present in 15.0.1, but appears in 16.0b1.
could you try to narrow this down a bit more (see ?

Comment 6

5 years ago
If the bug is *not* in the 15.0.1 release, but is in 16.0, I should be looking for 16a1, 16a2, 16aX nightlies?

Comment 7

5 years ago
16.0a1, 16.0a2, 16.0aX nightlies?

Comment 8

5 years ago
The bug is *not* in this daily (July 10, 2012):

The big is in this daily (July 11, 2012):

This looks like a regression from bug 145293
Blocks: 145293
tracking-thunderbird17: --- → ?
Keywords: regressionwindow-wanted
Created attachment 674609 [details] [diff] [review]
Unit test from testcase

This is a unit test based on the testcase attached to the bug.

Hiro, could you have a look at what has regressed here?
tracking-thunderbird17: ? → +


5 years ago
Assignee: nobody → mconley

Comment 11

5 years ago
I think I'm narrowing down in on the problem.

This line here:

Is supposed to return the number of quote characters are in a string.

Well, for this string:  

,,\"Acer America\",,,,,\"(800) 000-0000\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",,,\"Acer Americ

It's returning 38, when there are only 37 quotes in there. Not sure why though - my debugger seems to become useless when I start descending into macros.

Neil, any idea of what's going on?
Flags: needinfo?(neil)
There's a line missing from the patch in bug 145293.
>-    const char *pStart = pChar;
>-    PRInt32        fLen = 0;
>-    bool          quoted = false;
>-    if (*pChar == '"') {
>-        pStart++;
>+    PRInt32 fLen = 0;
>+    PRInt32 startPos = pos;
>+    bool    quoted = false;
>+    if (aLine[pos] == '"') {
Note that pStart++; was deleted but no startPos++; was added :-(
Flags: needinfo?(neil)

Comment 13

5 years ago
Created attachment 677749 [details] [diff] [review]

"It's a strange fate that we should suffer so much fear and doubt over something so small, such a little thing."

- Boromir, The Lord of the Rings

All import tests, including the one packaged in this bug, pass with this patch.
Attachment #677749 - Flags: review?(mbanner)
Attachment #674609 - Flags: review?(mconley)

Comment 14

5 years ago
Comment on attachment 674609 [details] [diff] [review]
Unit test from testcase

Review of attachment 674609 [details] [diff] [review]:

Just some tailing whitespace, otherwise good.

Good stuff.

::: mailnews/import/test/unit/resources/addressbook.json
@@ +72,5 @@
> +    {
> +      "DisplayName"      : "Acer America",
> +      "Work Phone"       : "(800) 000-0000",
> +      "Organization"     : "Acer America"
> +    } 

Trailing whitespace
Attachment #674609 - Flags: review?(mconley) → review+
Attachment #677749 - Flags: review?(mbanner) → review+
Comment on attachment 674609 [details] [diff] [review]
Unit test from testcase

[Triage Comment]
We want these for 17, to fix the regression.
Attachment #674609 - Flags: approval-comm-beta+
Attachment #674609 - Flags: approval-comm-aurora+
Attachment #677749 - Flags: approval-comm-beta+
Attachment #677749 - Flags: approval-comm-aurora+

Comment 16

5 years ago
Landed on comm-central:







5 years ago
Last Resolved: 5 years ago
status-thunderbird16: --- → affected
status-thunderbird17: --- → fixed
status-thunderbird18: --- → fixed
OS: Windows 7 → All
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 19.0


5 years ago
Duplicate of this bug: 812128
You need to log in before you can comment on or make changes to this bug.