Menu

#113 Error when opening a previously-opened archive with special characters in the filename

SVN
closed-fixed
None
7
2023-09-20
2018-11-13
No

I recently realized that, for many of my archive files, my installation of MComix can open it once and then never again. For instance, given this freshly-downloaded archive:

tina@pannychis:~$ mcomix \[MetCN\]\ 2011.10.01\ Mao\ Ming\ 毛明.cbz 
15:50:35 [MainThread] WARNING: czipfile not available! using zipfile

It works the first time, so I close the program and try it again:

tina@pannychis:~$ mcomix \[MetCN\]\ 2011.10.01\ Mao\ Ming\ 毛明.cbz 
15:51:17 [MainThread] WARNING: czipfile not available! using zipfile
15:51:23 [MainThread] ERROR: ! Callback <bound method ?._listed_contents of <mcomix.file_handler.FileHandler object at 0x7f8775738710>> failed: 'NoneType' object is not iterable

…and now MComix will open, but without the file, as though I started the program by itself. This happens, with the same error, every time thereafter I try to open that same file.
When I rename the file, it will work again… once, and then get the same error the second time onward

tina@pannychis:~$ mv \[MetCN\]\ 2011.10.01\ Mao\ Ming\ 毛明.cbz \[MetCN\]\ 2011.10.01\ Mao\ Ming.cbz
tina@pannychis:~$ mcomix \[MetCN\]\ 2011.10.01\ Mao\ Ming.cbz 
16:21:09 [MainThread] WARNING: czipfile not available! using zipfile
tina@pannychis:~$ mcomix \[MetCN\]\ 2011.10.01\ Mao\ Ming.cbz 
16:21:35 [MainThread] WARNING: czipfile not available! using zipfile
16:21:41 [MainThread] ERROR: ! Callback <bound method ?._listed_contents of <mcomix.file_handler.FileHandler object at 0x7facbe3e4750>> failed: 'NoneType' object is not iterable
/usr/local/lib/python2.7/dist-packages/mcomix/run.py:266: GtkWarning: IA__gdk_window_get_events: assertion 'GDK_IS_WINDOW (window)' failed
  gtk.main()
/usr/local/lib/python2.7/dist-packages/mcomix/run.py:266: Warning: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
  gtk.main()
/usr/local/lib/python2.7/dist-packages/mcomix/run.py:266: Warning: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
  gtk.main()

(Those “gtk.main()” warnings happened when I closed the empty MComix window.)
When I change the filename back, once again, it will not work anymore.

tina@pannychis:~$ mv \[MetCN\]\ 2011.10.01\ Mao\ Ming.cbz \[MetCN\]\ 2011.10.01\ Mao\ Ming\ 毛明.cbz
tina@pannychis:~$ mcomix \[MetCN\]\ 2011.10.01\ Mao\ Ming\ 毛明.cbz 
16:47:44 [MainThread] WARNING: czipfile not available! using zipfile
16:47:49 [MainThread] ERROR: ! Callback <bound method ?._listed_contents of <mcomix.file_handler.FileHandler object at 0x7f180056f750>> failed: 'NoneType' object is not iterable

Now, this filename contains square brackets (escaped), spaces (escaped), and Asian characteres (not escaped). I thought one of those might indicate where the bug is. In my experiments, I tried removing each of these different types of characters from the original file name, and the only filenames that worked consistently were when I had taken out all the spaces…

tina@pannychis:~$ mv \[MetCN\]\ 2011.10.01\ Mao\ Ming\ 毛明.cbz \[MetCN\]_2011.10.01_Mao_Ming_毛明.cbz
tina@pannychis:~$ mcomix \[MetCN\]_2011.10.01_Mao_Ming_毛明.cbz 
16:23:28 [MainThread] WARNING: czipfile not available! using zipfile
tina@pannychis:~$ mcomix \[MetCN\]_2011.10.01_Mao_Ming_毛明.cbz 
16:23:50 [MainThread] WARNING: czipfile not available! using zipfile
tina@pannychis:~$ mcomix \[MetCN\]_2011.10.01_Mao_Ming_毛明.cbz 
16:24:28 [MainThread] WARNING: czipfile not available! using zipfile
tina@pannychis:~$ mv \[MetCN\]_2011.10.01_Mao_Ming_毛明.cbz \[MetCN\]\ 2011.10.01\ Mao\ Ming\ 毛明.cbz

…or when I’d taken out everything special but spaces:

tina@pannychis:~$ mv \[MetCN\]\ 2011.10.01\ Mao\ Ming\ 毛明.cbz MetCN\ 2011.10.01\ Mao\ Ming\.cbz
tina@pannychis:~$ mcomix MetCN\ 2011.10.01\ Mao\ Ming.cbz 
16:35:04 [MainThread] WARNING: czipfile not available! using zipfile
tina@pannychis:~$ mcomix MetCN\ 2011.10.01\ Mao\ Ming.cbz 
16:36:04 [MainThread] WARNING: czipfile not available! using zipfile
tina@pannychis:~$ mv MetCN\ 2011.10.01\ Mao\ Ming.cbz \[MetCN\]\ 2011.10.01\ Mao\ Ming\ 毛明.cbz

(No, I have no idea what the “czipfile not available” warning means, but every time I got it without an error afterward, everything worked fine.)
All my other experiments (taking out just the Asian characters, taking out just the square brackets, taking out just the first two periods) had the same results as the original filename: it worked once, and then yielded the error every subsequent try.

This is a weird error, but I hope I’ve given enough experimental data to point y’all in the right direction. I’m using Ubuntu MATE 18.04 64-bit, using the WepUpd8 PPA package described here: https://launchpad.net/~nilarimogard/+archive/ubuntu/webupd8/+sourcepub/9257329/+listing-archive-extra The package version number is “1.2.1-1~webupd8~bionic2”, while the version number given by “mcomix --version” is “1.3.dev0”.

Discussion

  • Tomasz Golinski

    Tomasz Golinski - 2019-06-08

    I have a very similar problem. However in my case it is not related to special characters (or even spaces) in file names. It is usually enough to open an archive, then open another and go back to the first one. It won't open and I see in console:

    [MainThread] ERROR: ! Callback <bound method ?._listed_contents of <mcomix.file_handler.FileHandler object at 0x7fbcc5701f10>> failed: 'NoneType' object is not iterable
    

    I'm using mcomix-1.2.1_p20190406 (reported as MComix 1.3.dev0) on Gentoo, Python 3.6.5, pillow-6.0.0.

     
  • Spencer Berger

    Spencer Berger - 2019-06-23

    Didn't really want to register a sourceforge account just to send in this patch (seriously, registration didn't even work in firefox), but emailing aaku@users.sourceforge.net didn't work. I discovered and fixed this awhile ago, patch attached. https://github.com/multiSnow/mcomix3 doesn't have the same issue because it was fixed when refactoring.

    The bug is a regression introduced in https://sourceforge.net/p/mcomix/git/ci/3f8f3dcd2d55e4afc5ce85ca88eb1ab7dc7a0336/

    The issue is that get_page_filesize can return None, but _update_page_information does not deal with this case in double page mode.

    To reproduce: Set "Store information about recently opened files" to "always." Enable double page mode. Open an archive, navigate to a page that is displayed as double, close mcomix, reopen mcomix and open the same archive.

     

    Last edit: Spencer Berger 2019-06-23
  • Oddegamra

    Oddegamra - 2023-09-19
    • status: open --> pending
    • assigned_to: Oddegamra
     
  • Oddegamra

    Oddegamra - 2023-09-20
    • status: pending --> closed-fixed
     

Log in to post a comment.