After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 436230 - Crash during printing: TypeError
Crash during printing: TypeError
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: gnome-sudoku
unspecified
Other All
: High critical
: ---
Assigned To: Jason Clinton
GNOME Games maintainers
: 470814 475687 514824 518412 522635 522788 544981 549013 572378 581170 (view as bug list)
Depends on: 488636
Blocks:
 
 
Reported: 2007-05-05 22:35 UTC by Richard Lezcano
Modified: 2010-04-07 23:03 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
set page_size to 0 (1.78 KB, patch)
2008-09-21 17:23 UTC, Thomas Andersen
committed Details | Review

Description Richard Lezcano 2007-05-05 22:35:44 UTC
What were you doing when the application crashed?
I was trying to print multiples sudokus. Hang out happened when clicked "print preview" button.


Distribution: Ubuntu 7.04 (feisty)
Gnome Release: 2.18.1 2007-04-10 (Ubuntu)
BugBuddy Version: 2.18.1

System: Linux 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686
X Vendor: The X.Org Foundation
X Vendor Release: 70200000
Selinux: No
Accessibility: Disabled
GTK+ Theme: Human
Icon Theme: Human

Memory status: size: 0 vsize: 0 resident: 0 share: 0 rss: 0 rss_rlim: 0
CPU usage: start_time: 0 rtime: 0 utime: 0 stime: 0 cutime:0 cstime: 0 timeout: 0 it_real_value: 0 frequency: 0



----------- .xsession-errors (10 sec old) ---------------------
(gnome-sudoku:5967): GnomePrint-CRITICAL **: gnome_print_filter_reset: assertion `GNOME_IS_PRINT_FILTER (f)' failed
(gnome-sudoku:5967): GnomePrint-CRITICAL **: gnome_print_filter_flush: assertion `GNOME_IS_PRINT_FILTER (f)' failed
/usr/lib/python2.5/site-packages/gnome_sudoku/gnome_sudoku.py:988: Warning: g_object_set: assertion `G_IS_OBJECT (object)' failed
  gtk.main()
** (gnome-sudoku:5967): WARNING **: could not set the value of Settings.Document.Filter, node not found
Traceback (most recent call last):
  • File "/usr/lib/python2.5/site-packages/gnome_sudoku/printing.py", line 215 in response_cb
    if not self.drawn: self.draw_sudokus()
  • File "/usr/lib/python2.5/site-packages/gnome_sudoku/printing.py", line 246 in draw_sudokus
    dimensions,square_size =  fit_squares_in_rectangle(width,height,self.sudokus_per_page,self.margin)
TypeError: 'NoneType' object is not iterable
--------------------------------------------------
Traceback (most recent call last):
  • File "/usr/lib/python2.5/site-packages/gnome_sudoku/printing.py", line 215 in response_cb
    if not self.drawn: self.draw_sudokus()
  • File "/usr/lib/python2.5/site-packages/gnome_sudoku/printing.py", line 246 in draw_sudokus
    dimensions,square_size =  fit_squares_in_rectangle(width,height,self.sudokus_per_page,self.margin)
TypeError: 'NoneType' object is not iterable

Comment 1 Thomas Andersen 2007-07-14 00:45:27 UTC
Are you able to reliably reproduce this? I tried but it works for me
Comment 2 Thomas Andersen 2007-09-11 06:01:45 UTC
*** Bug 470814 has been marked as a duplicate of this bug. ***
Comment 3 Thomas Andersen 2007-09-11 06:01:50 UTC
*** Bug 475687 has been marked as a duplicate of this bug. ***
Comment 4 Richard Lezcano 2007-09-11 15:57:14 UTC
No, I'm not able to reproduce the error now ...
Comment 5 Thomas Andersen 2007-09-11 21:42:45 UTC
did you upgrade gnome-games since you experienced the bug?
Comment 6 Richard Lezcano 2007-09-12 03:34:16 UTC
Probably I did, because I use to accept every automatic update warning.
The problem has disappeared, if it comes back I will provide better information.
Thank you for the time dedicated to this issue.
Comment 7 Gianluca Borello 2008-02-07 14:40:58 UTC
*** Bug 514824 has been marked as a duplicate of this bug. ***
Comment 8 Gianluca Borello 2008-02-29 22:00:09 UTC
*** Bug 518412 has been marked as a duplicate of this bug. ***
Comment 9 Gianluca Borello 2008-03-15 18:13:06 UTC
*** Bug 522635 has been marked as a duplicate of this bug. ***
Comment 10 Gianluca Borello 2008-03-16 18:54:43 UTC
*** Bug 522788 has been marked as a duplicate of this bug. ***
Comment 11 Susana 2008-07-29 18:16:46 UTC
*** Bug 544981 has been marked as a duplicate of this bug. ***
Comment 12 Jesse Zhang 2008-08-23 12:13:59 UTC
This bug can be easily and always reproduced on my gnome (gnome-dev-kit, with newest gnome-games).
Just try to  
Comment 13 Jesse Zhang 2008-08-23 12:25:40 UTC
I am so sorry, I promise I didn't click the 'save changes'..

Just try to print multiple sudokus, no matter when I haven't choose a game or already in one.

Here are some points I find about the printing issue.

1. in printing.py==SudokuDrawer==draw_sudokus(), self.sudokus_per_per_page is not updated. It remains -1 (in each condition, print one or multiple).

1). main.py:print_game() should offer an argument of 1 to sudokus_per_page (of printing.print_sudokus), not using default (-1).

2). In game_selector.GamePrinter.response_cb, self.sudokusPerPageSpinButton.get_adjustment().get_value() returns -1.0, not the right value from the dialog.

2. In printing.py :draw_sudokus :
"if not self.sudokus_per_page"
is not proper, since "if -1" evaluates to True.

Changing the test to 'if self.sudokus_per_page <=0" will no longer crash Sudoku when trying to print multiple games. But it will ignore the setting of sudokus_per_page, because of the first point.

3. other apps use the same printer among them, firefox, eye of gnome, evolution, gedit. What's the one sudoku uses? Are they different?

And it seems to be the gnomeprint.Job in printing.py==SudokuPrinter.__init__
that generates all the never-stopped warnings:

** (gnome-sudoku.in.in:8147): WARNING **: IPP request failed with status 1030
With other applications, their printers don't generate one error.

** (gnome-sudoku.in.in:8147): WARNING **: could not set the value of Settings.Document.Filter, node not found
Comment 14 Jesse Zhang 2008-08-25 07:51:56 UTC
Seems "sudokusPerPageSpinButton.get_adjustment().get_value()" always return -1, and the up/down doesn't work however you press the arrow buttons.

It, together with the "if not self.sudokus_per_page" test, result in sudokus_per_page staying at -1 and so fit_squares_in_rectangle returning None, and so the exception "'NoneType' object is not iterable" ( which is now updated to unpack non-sequence ).

To prove the sudokusPerPageSpinButton behaves bad, I connected a callback to each of sudokusPerPageSpinButton and sudokusToPrintSpinButton, answering to 'value_changed' signal. The later works well but the first's callback is never called, i.e. the value stays -1.

I think fixing the sudokusPerPageSpinButton will do the work, but I can't find the code to modify.
Comment 15 Jesse Zhang 2008-08-28 12:57:44 UTC
I changed back from gnome-dev-kit to foresight, so from bleeding edge back to stable. I am disappointed (or delighted?) to find that the sudokusPerPageSpinButton works perfect..

It no longer crashes..

(but the error msg  'IPP request failed with status 1030 still appears' ( because I have no real printer?))

Sorry for these many comments without fixing the problem.

Maybe it has something to do with gtk.
Comment 16 Thomas Andersen 2008-09-21 17:22:16 UTC
There has been a change in gtk to gtkadjustment that might have caused some of the problems here. I'm attaching a patch that should fix the problem. Could you test that one Zhang?

Gnome-sudoku currently uses and old soon-to-be-deprecated method for printing. We should port to use gtkprint instead. That should hopefully fix all our current printing problems.

If the patch fixes the problems with the spinbutton I suggest we put that in 2.24.1 and port over to gtkprint in 2.25.1.
Comment 17 Thomas Andersen 2008-09-21 17:23:21 UTC
Created attachment 119119 [details] [review]
set page_size to 0
Comment 18 Jesse Zhang 2008-09-23 02:46:12 UTC
Sorry Thomas, but I now have no current-version gnome, now it's 2.22.3 on foresight linux (2.24 should come soon?). Spinbutton already works well, and also no problem after your patch.

But these errors still appears:

** (gnome-sudoku.in.in:5106): WARNING **: IPP request failed with status 1030

** (gnome-sudoku.in.in:5106): WARNING **: could not set the value of Settings.Document.Filter, node not found

You mean porting to gtkprint could possibly fix these errors?

Maybe I should again set up Developers Kit.
Comment 19 Thomas Andersen 2008-10-07 22:47:10 UTC
*** Bug 549013 has been marked as a duplicate of this bug. ***
Comment 20 Thomas Andersen 2008-10-10 11:09:01 UTC
I committed the patch to fix the spin buttons in the print dialog. We should definitely port to using gtkprint in 2.25.
Comment 21 palfrey 2009-02-19 10:11:37 UTC
*** Bug 572378 has been marked as a duplicate of this bug. ***
Comment 22 Thomas Andersen 2009-03-28 03:43:59 UTC
sudoku was ported to gtk-print in trunk (will be 2.27.1). Could someone test if the problem is still there?
Comment 23 Gianluca Borello 2009-05-03 09:43:44 UTC
*** Bug 581170 has been marked as a duplicate of this bug. ***
Comment 24 Thomas Andersen 2010-04-07 23:03:23 UTC
Closing as there have been no noise here since the port to gtk-print.