Bug 857592

Summary: ASCII text files are not printed the same as ASCII C++ text files: tab characters and white space are not preserved.
Product: [Fedora] Fedora Reporter: Greta Watson <greta_watson>
Component: papsAssignee: Akira TAGOH <tagoh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: i18n-bugs, jpopelka, tagoh, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: paps-0.6.8-22.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-16 09:21:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
ASCII text makefile with some lines having a leading tab character none

Description Greta Watson 2012-09-15 02:35:38 UTC
Description of problem:
When one uses the lp command on a .txt file, formatting of the file is lost.  White spaces are converted to a single white space.  Files with a .c extension are handled properly--tabs and spaces are maintained.

Version-Release number of selected component (if applicable):
cups-1.5.2-9.fc16.x86_64

How reproducible:
Create a file with tabs and spaces.  Give it a .txt extension.  Print it.  Rename it so it ends with .c.  Print again.  The two files are printed differently

Steps to Reproduce:
1.  Create file test.txt with contents:
    <tab>first line
    <tab>second line
2.   lp test.txt
3.   mv test.txt test.c
     lp test.c

The two files have the same contents but are treated differently.  In addition, if the file has a .txt extension, it is treated like a .c file if the first two characters in the file are //.
  
Actual results:
Tabs are replaced by a single space

Expected results:
Tabs should be maintained, in other words, there should be indentation of 8 characters.  There should be consistency between text files and c files.


Additional info:

Work-around:  set the printer to use the driver used by text-only printers.  Then spaces and tabs seem to be preserved correctly.  However, then you can't print other types of files.

Comment 1 Tim Waugh 2012-09-17 11:48:19 UTC
What does 'rpm -q paps' say?

Comment 2 Greta Watson 2012-09-17 14:56:47 UTC
$ rpm -q paps
paps-0.6.8-17.fc16.x86_64

Comment 3 Tim Waugh 2012-09-17 15:47:55 UTC
If you remove that package, do you get better or worse results?

Comment 4 Greta Watson 2012-09-17 17:01:05 UTC
Nothing prints, and I get the error message:
  There is a missing print filter for printer 'HP-Printer'.
When I re-install the package, it again prints, but with the wrong formatting.  Tab characters are still converted into a single space.  Spaces seem to be preserved at this point.

This bug has been around for a while.  I just got tired of having to write scripts to get around the problem.

Comment 5 Greta Watson 2012-09-17 17:09:54 UTC
C++ files don't use that package, so print okay with the package removed.

Comment 6 Tim Waugh 2012-09-18 09:06:48 UTC
OK, the problem is with the paps filter then.  Changing component and reassigning.

Comment 7 Fedora Update System 2012-09-21 08:33:41 UTC
paps-0.6.8-21.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/paps-0.6.8-21.fc18

Comment 8 Fedora Update System 2012-09-21 08:34:19 UTC
paps-0.6.8-21.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/paps-0.6.8-21.fc17

Comment 9 Fedora Update System 2012-09-21 08:35:13 UTC
paps-0.6.8-21.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/paps-0.6.8-21.fc16

Comment 10 Fedora Update System 2012-09-22 06:30:47 UTC
Package paps-0.6.8-21.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing paps-0.6.8-21.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14538/paps-0.6.8-21.fc18
then log in and leave karma (feedback).

Comment 11 Greta Watson 2012-09-23 16:11:38 UTC
paps-0.6.8-21.fc17 did not fix the issue.  I updated today, tested, and left karma.

Tabs are still treated as a single blank, so the fix did not work.

The same .txt file, renamed as a .c file prints properly.
If I don't rename the .txt file, but put two slashes as the first two characters, the file prints properly.

It seems that ASCII text files should not need to use paps.  They should be treated the same as .c files, or as files that have two slashes as their first two characters.

Comment 12 Akira TAGOH 2012-09-24 01:54:30 UTC
It works for me. can you attach simple test case and expected result? or if you didn't update paps-libs too, please do. if it's the case, I'm fixing it in next release.

Comment 13 Greta Watson 2012-09-24 04:00:10 UTC
Created attachment 616352 [details]
ASCII text makefile with some lines having a leading tab character

ASCII text with leading tab characters on some lines.

Comment 14 Greta Watson 2012-09-24 04:01:29 UTC
With the addition of paps-libs-0.6.8-21.fc17, the problem has been solved.  Thank-you.

Comment 15 Akira TAGOH 2012-10-16 09:21:03 UTC
dunno why this bug wasn't closed even though the updated package has already been pushed to the stable. anyway closing.