new install of phatch is broken out-of-box

Bug #1682919 reported by cpesc on 2017-04-14
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Phatch
Undecided
Unassigned
phatch (Ubuntu)
Undecided
Unassigned

Bug Description

i run just with new 17.04 fresh installed ubuntu.
phatch program is broken.
same trouble of red-hat bugzilla bug 1410995
if i run a verbose phatch.....

phatch --verbose

** (phatch:10156): WARNING **: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py:8196: GtkWarning: gtk_disable_setlocale() must be called before gtk_init()
  return _core_.PyApp__BootstrapApp(*args, **kwargs)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py", line 16765, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "/usr/share/phatch/phatch/pyWx/gui.py", line 1218, in show_frame
    frame = Frame(self.filename, None, -1, ct.TITLE)
  File "/usr/share/phatch/phatch/pyWx/gui.py", line 327, in __init__
    frame.Frame.__init__(self, *args, **keyw)
  File "/usr/share/phatch/phatch/pyWx/wxGlade/frame.py", line 141, in __init__
    self.tree = Tree(self, -1, style=wx.TR_HAS_BUTTONS|wx.TR_NO_LINES|wx.TR_FULL_ROW_HIGHLIGHT|wx.TR_HIDE_ROOT|wx.TR_DEFAULT_STYLE|wx.SUNKEN_BORDER)
  File "/usr/share/phatch/phatch/pyWx/wxGlade/frame.py", line 26, in __init__
    set_dirty = parent.set_dirty,
  File "/usr/share/phatch/phatch/lib/pyWx/treeEdit.py", line 96, in __init__
    self.CreateImageList(icon_size)
  File "/usr/share/phatch/phatch/lib/pyWx/treeEdit.py", line 111, in CreateImageList
    self._AddFormToImageList(form, icon_size, icon_disabled)
  File "/usr/share/phatch/phatch/lib/pyWx/treeEdit.py", line 120, in _AddFormToImageList
    wx_image = pil_wxImage(wxImage_pil(wx_image).resize(icon_size,\
  File "/usr/share/phatch/phatch/lib/pyWx/wxPil.py", line 45, in wxImage_pil
    image = Image.new('RGB', size)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2051, in new
    _check_size(size)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2027, in _check_size
    raise ValueError("Size must be a tuple")
ValueError: Size must be a tuple

thanks for help

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in phatch (Ubuntu):
status: New → Confirmed
Changed in phatch (Ubuntu):
status: Confirmed → Fix Released
Goury (madoo) wrote :

No it's not, stop lying, there was no updates for years

thanks for your answer.

I tryed tis morning to make a new user (without importing my prévious
home content) under my 17.04 ubuntu.

and phatch runs correctly.

I'm not a lyer, i was not carefull enough before making my call. Please,
accepts my excuses

I have to search in my home environment what is wrong.

Bests regards.

(i'm a french poor english speaking so, i hope you understand)

Le 16/04/2017 à 22:58, Goury a écrit :
> No it's not, stop lying, there was no updates for years
>

florin (florin-arjocu) wrote :

It says Fix Released. It is to be available soon? This is probably the last thing that stops me from switching from Ubuntu 16.10. Thanks!

florin (florin-arjocu) wrote :

PS: this is my output when running from terminal:

/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py:8196: GtkWarning: gtk_disable_setlocale() must be called before gtk_init()
  return _core_.PyApp__BootstrapApp(*args, **kwargs)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py", line 16765, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "/usr/share/phatch/phatch/pyWx/gui.py", line 1218, in show_frame
    frame = Frame(self.filename, None, -1, ct.TITLE)
  File "/usr/share/phatch/phatch/pyWx/gui.py", line 327, in __init__
    frame.Frame.__init__(self, *args, **keyw)
  File "/usr/share/phatch/phatch/pyWx/wxGlade/frame.py", line 141, in __init__
    self.tree = Tree(self, -1, style=wx.TR_HAS_BUTTONS|wx.TR_NO_LINES|wx.TR_FULL_ROW_HIGHLIGHT|wx.TR_HIDE_ROOT|wx.TR_DEFAULT_STYLE|wx.SUNKEN_BORDER)
  File "/usr/share/phatch/phatch/pyWx/wxGlade/frame.py", line 26, in __init__
    set_dirty = parent.set_dirty,
  File "/usr/share/phatch/phatch/lib/pyWx/treeEdit.py", line 96, in __init__
    self.CreateImageList(icon_size)
  File "/usr/share/phatch/phatch/lib/pyWx/treeEdit.py", line 111, in CreateImageList
    self._AddFormToImageList(form, icon_size, icon_disabled)
  File "/usr/share/phatch/phatch/lib/pyWx/treeEdit.py", line 120, in _AddFormToImageList
    wx_image = pil_wxImage(wxImage_pil(wx_image).resize(icon_size,\
  File "/usr/share/phatch/phatch/lib/pyWx/wxPil.py", line 45, in wxImage_pil
    image = Image.new('RGB', size)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2051, in new
    _check_size(size)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2027, in _check_size
    raise ValueError("Size must be a tuple")
ValueError: Size must be a tuple

cpesc (cpesc-free) wrote :

GOURY, i'm not lyer
i had take time to make a full installation ..... phatch is not working!

please try to install a new brand 1704 ubuntu
after, install all updates proposed

to have phatch proposed, add Canonical partner to other software.
and finally install phatch by unbutu software buton.
it's impossible to run phatch under unbutu 1704.
Please change status of this bug try tu make this simple install i propose you.
I plan to return in 1604 if bugs aren't solved.
Bugs could be about more in python environment that in installed by canonical partner.

Christian PESCHOUX

florin (florin-arjocu) wrote :

I tried something and for me it seems to be working now.

Go to line 2027 and disable the check that gives that error (I do not see fit to check some image size on startup, it makes no sense anyway); it should look like this:
` """if not isinstance(size, (list, tuple)):
  raise ValueError("Size must be a tuple")
 """`

I am not sure everything will be working, but for me, it did start, shrink a folder of pictures and added the watermark.

florin (florin-arjocu) wrote :

PS: I hope my fix is just temporary, I would not like to have to edit a file (and maybe also get some secondary bugs because of the edit).
PS2: skip the ` sign from the above code, you only need the 3 double quotes to open/close commenting area (to disable code between).

stan383 (stan383) wrote :
Nick Evans (evansn) wrote :

@florin 's solution of 2017-05-06 worked for me also - for the benefit of people who might be a bit stuck with implementing it - as I would have been a few years ago:

Open terminal
sudo nautilus (or whatever your file manager is - enter your admin password at prompt)

this will open your file manager with admin rights

navigate to /usr/lib/python2.7/dist-packages/PIL/Image.py

open this file with a text editor or - my preferred option - Bluefish (this means you can just enter the line number to find the bit to change)

Comment out the lines (or just copy and paste this

` """if not isinstance(size, (list, tuple)):
  raise ValueError("Size must be a tuple")
 """`

to replace the un-commented lines

Save the file

Run Phatch jut like you did on 14.x :)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers