Closed Bug 469794 Opened 16 years ago Closed 15 years ago

On windows, export bug list to CSV breaks because of extra line breaks


(Bugzilla :: Query/Bug List, defect)

Windows XP
Not set



Bugzilla 3.2


(Reporter: ycombarnous, Assigned: LpSolit)



(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/2008102920 Firefox/3.0.4
Build Identifier: Bugzilla 3.2

When exporting a buglist to CSV in Windows 2k3 (ActiveState 5.10 build 1004), I get one extra line break for every loop/check (FOR EACH, IF) in template list.csv. So every bug takes 3/4 lines per column exported!

This was not happening when using Bugzilla 3.0 and Active State 5.8.8 build 822. Is this a known issue of TT or other module?

To fix, I had to remove all line breaks and make conditions happen on one line:

[% FOREACH bug = bugs %]
[% bug.bug_id %][% FOREACH column = displaycolumns %][% colsepchar %][% IF column == "opendate" OR column == "changeddate" %][% rawcolumn = column.replace("date", "time") %][% bug.$column = date.format(bug.$rawcolumn, "%Y-%m-%d %H:%M:%S") %][% ELSIF column == 'bug_status' %][% bug.$column = get_status(bug.$column) %][% ELSIF column == 'resolution' %][%- bug.$column = get_resolution(bug.$column) %][% END %][% bug.$column FILTER csv %][% END %][% END %]

Reproducible: Always

Steps to Reproduce:
1. Create a search
2. Click on CSV to export bug list as CSV
Actual Results:  
For each bug, a column is display every 3 lines.

Expected Results:  
Columns should be displaying next to each other, no below each other.
Version: unspecified → 3.2
Not sure if this is related to bug 467920
Yeah, this is almost certainly related to bug 467920. You know, I bet the problem is that we read templates in a binmode, now. Maybe we have to add a :crlf filter to the IO layer that we read templates through.
Bug 464992 comment 41: related bug can be remedied by upgrading Perl to 5.10.0.
(In reply to comment #3)
> Bug 464992 comment 41: related bug can be remedied by upgrading Perl to 5.10.0.

Per my description, I already run perl 5.10: "(ActiveState 5.10 build 1004)"
Unable to reproduce on 5.10 and Win XP myself.

Reported two more times on
(In reply to comment #5)
> Unable to reproduce on 5.10 and Win XP myself.
> Reported two more times on

Ok, i'll test on my server.

(In reply to comment #4)
> Per my description, I already run perl 5.10: "(ActiveState 5.10 build 1004)"

Could you paste the result of my script?
I could not reproduce this on ActivePerl 5.10 (1004) on Win2k3.
With saving en\default\list\list.csv.tmpl with CrLf, the same. (not reproduced).

  Locally applied patches:
        ActivePerl Build 1004 [287188]
        33741 avoids segfaults invoking S_raise_signal() (on Linux)
        33763 Win32 process ids can have more than 16 bits
        32809 Load 'loadable object' with non-default file extension
        32728 64-bit fix for Time::Local
  Built under MSWin32
  Compiled at Sep  3 2008 13:16:37

> Yann
* What is your Template-Toolkit version?
* is it possible to attach 'data\template\template\en\default\list\list.csv.tmpl' file? (change en to the language in use)
Reproducable with Version 3.2 

When exporting the same buglist to CSV with Version 3.2.2, no errors occur.

Using on both machines ActivePerl 5.10 on Windows 2k3.
This has been reported by enough people (here and on the mailing list) that it's confirmed.
Assignee: query-and-buglist → mkanat
Severity: normal → major
Ever confirmed: true
Flags: blocking3.2.4+
Hardware: x86 → All
Target Milestone: --- → Bugzilla 3.2
I've pinged the Template Toolkit maintainer about the relevant TT bug ( ) again.
The TT bug has been resolved, and will be fixed in the next release. I'm not going to block release on this, because basically at this point we're just waiting on a new version of Template Toolkit, and I don't know when that's going to happen.
Flags: blocking3.2.4+ → blocking3.2.4-
TT 2.21 has been released a few days ago, which includes this fix.
Max, want to block 3.4rc1 on it now that TT 2.21 is available? Per our discussion on IRC, it's probably only required on Windows.
Flags: blocking3.4?
Flags: blocking3.4? → blocking3.4+
I'm not going to fix this bug until theoryx5 updates their repo to have the latest Template-Toolkit, which I believe LpSolit has asked them to do.
Yeah, I asked Randy yesterday.
FYI, TT 2.21 is not available on Windows because it doesn't pass its own tests. Andy Wardley, the maintainer of Template-Toolkit, said this problem was fixed in the development version 2.21_02. So we now have to wait for TT 2.22, it looks like.
This patch is for 3.2.5 only as 3.4 and HEAD will get the patch from bug 457524, which requires TT 2.22 on all platforms.
Assignee: mkanat → LpSolit
Attachment #389184 - Flags: review?(mkanat)
Attachment #389184 - Flags: review?(mkanat) → review+
Flags: approval3.2+
This patch will land on the 3.2 branch only, see comment 17.
Flags: blocking3.4-
Flags: blocking3.4+
Flags: blocking3.2.5+
(In reply to comment #15)
> Yeah, I asked Randy yesterday.

He just replied to me right now. TT 2.21 is now available from theory58S.

Checking in Bugzilla/Install/;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/,v  <--
new revision:; previous revision:
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.