Bug 857592 - ASCII text files are not printed the same as ASCII C++ text files: tab characters and white space are not preserved.
ASCII text files are not printed the same as ASCII C++ text files: tab chara...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: paps (Show other bugs)
16
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Akira TAGOH
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-14 22:35 EDT by Greta Watson
Modified: 2012-10-16 05:21 EDT (History)
4 users (show)

See Also:
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 05:21:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
ASCII text makefile with some lines having a leading tab character (154 bytes, application/octet-stream)
2012-09-24 00:00 EDT, Greta Watson
no flags Details

  None (edit)
Description Greta Watson 2012-09-14 22:35:38 EDT
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 07:48:19 EDT
What does 'rpm -q paps' say?
Comment 2 Greta Watson 2012-09-17 10:56:47 EDT
$ rpm -q paps
paps-0.6.8-17.fc16.x86_64
Comment 3 Tim Waugh 2012-09-17 11:47:55 EDT
If you remove that package, do you get better or worse results?
Comment 4 Greta Watson 2012-09-17 13:01:05 EDT
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 13:09:54 EDT
C++ files don't use that package, so print okay with the package removed.
Comment 6 Tim Waugh 2012-09-18 05:06:48 EDT
OK, the problem is with the paps filter then.  Changing component and reassigning.
Comment 7 Fedora Update System 2012-09-21 04:33:41 EDT
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 04:34:19 EDT
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 04:35:13 EDT
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 02:30:47 EDT
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 12:11:38 EDT
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-23 21:54:30 EDT
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 00:00:10 EDT
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 00:01:29 EDT
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 05:21:03 EDT
dunno why this bug wasn't closed even though the updated package has already been pushed to the stable. anyway closing.

Note You need to log in before you can comment on or make changes to this bug.