Bug 147292

Summary: Fails importing (attached) .PPD correctly, claims success
Product: [Fedora] Fedora Reporter: Olov Johansson <olojo619>
Component: system-config-printerAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.6.129-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-05-12 11:19:37 UTC Type: ---
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
B4300.ppd none

Description Olov Johansson 2005-02-06 15:12:28 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041111 Firefox/1.0

Description of problem:
system-config-printer fails to import the attached PPD-file.

Problem:
The PPD has Macintosh-style lineendings (0x0d instead of 0x0a). The
parser in queueTree.py expects unix or windows newlines (thus views
the PPD as one line long).

(For the record: Installing the same PPD via CUPS webinterface
http://localhost:631/ works fine.)


Solution/Patch:
in queueTree.py, exchange the line: f = file (filename)
with: f = file (filename, 'rU')


From python library reference:
"In addition to the standard fopen() values mode  may be 'U' or 'rU'.
If Python is built with universal newline support (the default) the
file is opened as a text file, but lines may be terminated by any of
'\n', the Unix end-of-line convention, '\r', the Macintosh convention
or '\r\n', the Windows convention. All of these external
representations are seen as '\n'  by the Python program. If Python is
built without universal newline support mode 'U' is the same as normal
text mode. "


Version-Release number of selected component (if applicable):
system-config-printer-0.6.116.1.1-1

How reproducible:
Always

Steps to Reproduce:
1. Open system-config-printer, import the attached PPD.
2. Dialog claims "PPD imported" 


Actual Results:  Trying to add a printer reveals that Oki B4300 isn't
in list.    

Expected Results:  Either:
1) (preferred) A PPD with macstyle newlines should be possible to
import, see solution in full description.
2) The installer shouldn't claim "PPD imported" when it didn't parse
the file (specifically Manufacturer and ShortNickName) correctly.


Additional info:

Comment 1 Olov Johansson 2005-02-06 15:14:45 UTC
Created attachment 110703 [details]
B4300.ppd

Comment 2 Matthew Lenz 2005-03-23 22:56:39 UTC
I can confirm the same problem with a PCL ppd sent to me by the Ricoh
development team.  If I copy the PCL ppd for the printer to the
/usr/share/cups/model directory, restart cups and then add and configure the
printer via the cups web interface I can print just fine to the printer.  If
import the ppd via the system settings / import ppd it does not print properly
(dumps unfiltered postscript data to the printer) to the printer.  Ricoh is
preparing an install document for linux that can't use this import feature cuz
it just plain doesn't work properly.

Comment 3 Tim Waugh 2005-03-30 15:35:03 UTC
Fixed in CVS.  Thanks.