Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 352687 - net-print/hplip-3.11.1 - hp-setup fails on adding printer with fax capabilities
Summary: net-print/hplip-3.11.1 - hp-setup fails on adding printer with fax capabilities
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Daniel Pielmeier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-25 14:00 UTC by Bas Nedermeijer
Modified: 2012-11-13 19:00 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Output of hp-check.log (hp-check.log,13.23 KB, text/plain)
2011-04-06 10:23 UTC, Bas Nedermeijer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bas Nedermeijer 2011-01-25 14:00:32 UTC
After starting hp-setup and finding a printer (officejet 6500) it crashes with a Traceback.

Traceback (most recent call last):
  File "/usr/share/hplip/ui4/setupdialog.py", line 1235, in NextButton_clicked
    self.showAddPrinterPage()
  File "/usr/share/hplip/ui4/setupdialog.py", line 680, in showAddPrinterPage
    self.readwriteFaxInformation()
  File "/usr/share/hplip/ui4/setupdialog.py", line 1059, in readwriteFaxInformation
    self.fax_name_company = unicode(d.getStationName())
  File "/usr/share/hplip/fax/ledmfax.py", line 134, in getStationName
    return self.readAttributeFromXml("/DevMgmt/FaxConfigDyn.xml",'faxcfgdyn:faxconfigdyn-faxcfgdyn:systemsettings-dd:companyname')
  File "/usr/share/hplip/base/device.py", line 2465, in readAttributeFromXml
    return str(xmlDict[attribute])
KeyError: 'faxcfgdyn:faxconfigdyn-faxcfgdyn:systemsettings-dd:companyname'



Reproducible: Always

Steps to Reproduce:
1. Start hp-setup
2. Choose network/ethernet   click next
3. Printer is found
4. Click next


Actual Results:  
Traceback (most recent call last):
  File "/usr/share/hplip/ui4/setupdialog.py", line 1235, in NextButton_clicked
    self.showAddPrinterPage()
  File "/usr/share/hplip/ui4/setupdialog.py", line 680, in showAddPrinterPage
    self.readwriteFaxInformation()
  File "/usr/share/hplip/ui4/setupdialog.py", line 1059, in readwriteFaxInformation
    self.fax_name_company = unicode(d.getStationName())
  File "/usr/share/hplip/fax/ledmfax.py", line 134, in getStationName
    return self.readAttributeFromXml("/DevMgmt/FaxConfigDyn.xml",'faxcfgdyn:faxconfigdyn-faxcfgdyn:systemsettings-dd:companyname')
  File "/usr/share/hplip/base/device.py", line 2465, in readAttributeFromXml
    return str(xmlDict[attribute])
KeyError: 'faxcfgdyn:faxconfigdyn-faxcfgdyn:systemsettings-dd:companyname'

Expected Results:  
Printer is added.

This did not happen with 3.10 (but there was no fax support yet for the OfficeJet 6500)
Comment 1 Bas Nedermeijer 2011-01-25 14:03:44 UTC
The following patch seems to fix the problem. Apparently some items can be None which causes an error


# diff -u /usr/share/hplip/base/device.py device.py 
--- /usr/share/hplip/base/device.py     2011-01-25 14:51:16.000000000 +0100
+++ device.py   2011-01-25 14:50:18.000000000 +0100
@@ -2462,7 +2462,13 @@
             log.error("Unable To read the XML data from device")
             return ""
         xmlDict = utils.XMLToDictParser().parseXML(data)  
-        return str(xmlDict[attribute])
+
+       try:
+           rA = xmlDict[attribute]
+       except KeyError:
+           rA = ""
+
+        return str(rA)
 
     def downloadFirmware(self, usb_bus_id=None, usb_device_id=None): # Note: IDs not currently used
         ok = False
Comment 2 Daniel Pielmeier gentoo-dev 2011-01-25 18:09:50 UTC
Thank you very much for your report. I would appreciate if you open a bug upstream [1] about this issue and report the Bug URL here. If the bug is confirmed I can add the patch to the ebuild.

[1] https://bugs.launchpad.net/hplip
Comment 3 Bas Nedermeijer 2011-01-25 20:25:45 UTC
(In reply to comment #2)
> Thank you very much for your report. I would appreciate if you open a bug
> upstream [1] about this issue and report the Bug URL here. If the bug is
> confirmed I can add the patch to the ebuild.
> 
> [1] https://bugs.launchpad.net/hplip
> 

Sounds like a good idea, unfortunately I am unable to get past the captcha and cannot create an account.

Anyway, just letting you know.
Comment 4 Daniel Pielmeier gentoo-dev 2011-01-25 21:44:19 UTC
(In reply to comment #3)
> 
> Sounds like a good idea, unfortunately I am unable to get past the captcha and
> cannot create an account.
> 
> Anyway, just letting you know.
> 

Thanks for letting me know. I opened bug 707655 [1] for you. I hope you tried more than once to answer the captcha. I remember I needed a few attempts there as well.

[1] https://bugs.launchpad.net/hplip/+bug/707655
Comment 5 Bas Nedermeijer 2011-01-25 22:19:58 UTC
(In reply to comment #4)
> Thanks for letting me know. I opened bug 707655 [1] for you. I hope you tried
> more than once to answer the captcha. I remember I needed a few attempts there
> as well.
> 
> [1] https://bugs.launchpad.net/hplip/+bug/707655
> 

Thanks! (I stopped trying after 12 or so times.)
Comment 6 Daniel Pielmeier gentoo-dev 2011-02-14 08:03:13 UTC
Can you please attach the output of hp-check. I will forward this information to the upstream bug.
Comment 7 Daniel Pielmeier gentoo-dev 2011-03-31 12:12:57 UTC
@Bas: We can not proceed without the information I requested in comment #6.
Comment 8 Bas Nedermeijer 2011-04-06 10:23:30 UTC
Created attachment 268701 [details]
Output of hp-check.log
Comment 9 Bas Nedermeijer 2011-04-06 10:24:08 UTC
Sorry I missed the last comments requesting for information.

The problem stil persists in hplip 3.11.3a
Comment 10 Daniel Pielmeier gentoo-dev 2011-04-06 10:49:57 UTC
Thanks for the information. Reopening.
Comment 11 Yuriy Rusinov 2011-09-02 09:12:49 UTC
Possible I duplicate this bug here https://bugs.gentoo.org/show_bug.cgi?id=381475.
Comment 12 Daniel Pielmeier gentoo-dev 2012-02-07 18:38:35 UTC
Is this still a problem with hpli-3.11.12-r2?
Comment 13 Daniel Pielmeier gentoo-dev 2012-02-07 20:05:47 UTC
I just added hplip-3.12.2. Please try this version instead.
Comment 14 Daniel Pielmeier gentoo-dev 2012-11-13 19:00:13 UTC
According to the upstream bug and by reviewing the code this bug has been fixed. Closing!