OpenPrinting / system-config-printer

Graphical user interface for CUPS administration
GNU General Public License v2.0
163 stars 89 forks source link

TypeError on <dict>.update call #76

Closed jellelicht closed 6 years ago

jellelicht commented 6 years ago

This line seems to crash on my ubuntu 17.10 machine. My limited understanding of python notwithstanding, it seems that there are no valid values for key and val where this line would work. It seems this line was last touched in d05c82a7e

The full error log I got was:

Traceback (most recent call last):
  File "/usr/share/system-config-printer/jobviewer.py", line 1616, in on_job_authenticate_activate
    uri, auth_info_required, True)
  File "/usr/share/system-config-printer/jobviewer.py", line 1048, in get_authentication
    val)
TypeError: update expected at most 1 arguments, got 2
zdohnal commented 6 years ago

Hi, thank you for reporting this issue - does this commit helps? 1a87f99fecc39dd238f143adf05ce1db8e5451a2

jellelicht commented 6 years ago

It does, but this leads to a new problem:

Traceback (most recent call last):
  File "/usr/share/system-config-printer/jobviewer.py", line 1615, in on_job_authenticate_activate
    uri, auth_info_required, True)
  File "/usr/share/system-config-printer/jobviewer.py", line 1051, in get_authentication
    search_obj = ItemSearch(service, attrs)
  File "/usr/share/system-config-printer/jobviewer.py", line 116, in __init__
    self.on_search_item)
TypeError: argument cancellable: Expected Gio.Cancellable, but got jobviewer.method
TypeError: on_get_service() missing 1 required positional argument: 'unused'

NB, this all happens when I click the "authenticate" item in the right click menu of my print queue.

zdohnal commented 6 years ago

I'm sorry about this issue - this is just experimental code, which shouldn't get into stable release in this state. But I am thankful for your issues, it helps me with debugging (I wasn't sure how to trigger this functionality and I still don't see option 'Authenticate' in right click menu in s-c-p in Fedora 26). If you can manage without authentication by s-c-p (s-c-p is only tool to manipulate with cups, all in s-c-p can be done with cups itself), you can turn it off in /usr/share/system-config-printer/jobviewer.py by setting USE_SECRET=False in l. 59 for now.

jellelicht commented 6 years ago

I was able to use something like smbclient -U <user> -W <domain> //<smb-url> -c "print <document>" which worked perfectly. Maybe the fact that I was using a smb-shared printer is relevant to triggering this bug? Either way, it would be nice to have some certainty about all code paths being run once before a release :wink:.

Would it be helpful if I also reported this bug to Ubuntu's bugtracker for this package?

zdohnal commented 6 years ago

You're right and I'm deeply sorry about it - my idea was to release it as beta for Fedora Rawhide, where it can be tested before it lands into actual stable release. I didn't count the option that master branch's HEAD could be taken and pushed into stable release. About reporting to Ubuntu - yes, that would be great.

john-tornblom commented 6 years ago

I believe the same type error exist on line 1208. Fixing these two was enough to fix printing from my Ubuntu 17.10 machine to samba printers that require authentication.

zdohnal commented 6 years ago

Thank you a lot, John. Now I fixed it there too. @jellelicht @john-tornblom shall I now close this issue or are there other problems connected to it?

zdohnal commented 6 years ago

commit 9e6c1f72ab

john-tornblom commented 6 years ago

My problems went away with these fixes, so I assume you can close the ticket. I did not try to authenticate via the printing job queue though.

zdohnal commented 6 years ago

Ok, I'll close the ticket for now.