Bug 982071
Summary: | Python exception when selecting "install local driver": 'int' object has no attribute 'has_key' [PROPOSED FIX INCLUDED] | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Johannes Goller <jogojapan> |
Component: | system-config-printer | Assignee: | Tim Waugh <twaugh> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 19 | CC: | jogojapan, jpopelka, twaugh |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | system-config-printer-1.4.5-1.fc20 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-07-10 00:23:58 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: |
Description
Johannes Goller
2013-07-08 05:17:24 UTC
Looking at the current version of the code (master branch), the line I mentioned seems to correspond to line 1125: https://git.fedorahosted.org/cgit/system-config-printer.git/tree/newprinter.py#n1125 There are other lines in this code that compare `driver` (returned from `model.get_value()` to `None`. I suspect they all need to be prepared for the possibility of a value of `0` instead of `None`. (In reply to Johannes Goller from comment #0) > 4. Select "local driver" I can't find any "local driver". I see only: * Select printer from database * Provide PPD file * Search for a printer driver to download The affected code seem to handle the last case but I can't reproduce it. > if driver is not None and driver != 0 and driver.has_key ('packages'): nice, thanks, but we need to know how/why the 0 got there, it could contain other values, not just 0. >> 4. Select "local driver" > I can't find any "local driver". I see only: > * Select printer from database > * Provide PPD file > * Search for a printer driver to download I am sorry. I was looking at the Japanese version and made assumptions about the English original... It's the "provide a PPD file" option, then. > nice, thanks, but we need to know how/why the 0 got there, it could contain other values, not just 0. Sure, my fix is very ad-hoc. Tracked the cause of this down to commit b21756ca49e22feb3d055be331739707254516a7: Commit: Tim Waugh <twaugh> CommitDate: Fri Nov 9 18:12:12 2012 +0000 Avoid putting None in models whose columns don't allow it. I should have checked for comparisons elsewhere in the code, and for some reason I missed this. Thanks for the patch. I've applied it now. system-config-printer-1.4.5-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/system-config-printer-1.4.5-1.fc20 Package system-config-printer-1.4.5-1.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing system-config-printer-1.4.5-1.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-8100/system-config-printer-1.4.5-1.fc20 then log in and leave karma (feedback). system-config-printer-1.4.5-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report. |