Bug#547180: Segmentation Fault when using addPrinter() method

sebastien requiem sebastien at requiem.fr
Thu Sep 17 13:52:17 UTC 2009


Package: python-cupsutils
Version: 1.0.0-4lenny1



Here are some important infos :
System: lenny
python version:  2.5
Arch : armv5tejl (but same behaviour on x386)


When executing that piece of code (that is suppose to cahnge the paper
size for the designed printer)



==== python code =====
		self.connection = cupshelpers.cups.Connection()

...

(printer_name contains the name of my printer "Deskjet_F4200_Series"
page_size contains 'A4')

		printer = cupshelpers.getPrinters(self.connection)[printer_name]
		ppd = printer.getPPD()
		ppd.markOption('PageSize', page_size)
		print "ppd setup"
		
		try:
			self.connection.addPrinter(printer.name,
								location=printer.location,
								info=printer.info,
								device=printer.device_uri,
								ppd=ppd)
			print "printer added !"
		except cupshelpers.cups.IPPError:
			print "Oups ..."


===== python code =====



$> python test.py
printer exisits
ppd setup
printer added
Segmentation fault
$>


I have a segfault at the end of the function. I precise that the  
function is in fact
a class's method.

I have also tried different approaches like using filename instead of  
ppd
when calling addPrinter() func => same behaviour.


Am I missing something obvious in the code that make it segfault ??
(I am using hal-cups-utils which call addPrinter without a problem  
when needed)



regards,







More information about the pkg-gnome-maintainers mailing list