import libtiff fails, unless it has been ran with root privileges before

Bug #1595540 reported by Wolfgang Noichl on 2016-06-23
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Medium
Unassigned
pylibtiff (Debian)
Fix Released
Unknown
pylibtiff (Ubuntu)
Medium
Unassigned

Bug Description

When imported for the first time, python-libtiff tries to create some file in /usr/lib:

In [1]: import libtiff
Generating '/usr/lib/python2.7/dist-packages/libtiff/tiff_h_4_0_6.py'
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
<ipython-input-1-4492fa448634> in <module>()
----> 1 import libtiff

/usr/lib/python2.7/dist-packages/libtiff/__init__.py in <module>()
     18 __all__ = ['TIFF', 'TIFF3D', 'TIFFfile', 'TiffArray', 'TiffFile', 'TiffFiles', 'TiffChannelsAndFiles', 'TiffBase']
     19
---> 20 from .libtiff_ctypes import libtiff, TIFF, TIFF3D
     21 from .tiff import TIFFfile, TIFFimage, TiffArray
     22 from .tiff_file import TiffFile

/usr/lib/python2.7/dist-packages/libtiff/libtiff_ctypes.py in <module>()
    115 fn = os.path.join (os.path.dirname (os.path.abspath (__file__)), tiff_h_name+'.py')
    116 print 'Generating %r' % (fn)
--> 117 f = open(fn, 'w')
    118 f.write ('\n'.join(l) + '\n')
    119 f.close()

IOError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/libtiff/tiff_h_4_0_6.py'

Which it obviously can't.

If you run it with root privileges, it can:

In [1]: import libtiff
Generating '/usr/lib/python2.7/dist-packages/libtiff/tiff_h_4_0_6.py'

Afterwards, running with normal privileges works. So presumably, tiff_h_4_0_6.py should already have been created during installation.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: python-libtiff 0.4.1~20150805-1
ProcVersionSignature: Ubuntu 4.4.0-24.43-generic 4.4.10
Uname: Linux 4.4.0-24-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: XFCE
Date: Thu Jun 23 15:24:46 2016
InstallationDate: Installed on 2015-10-22 (244 days ago)
InstallationMedia: Xubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SourcePackage: pylibtiff
UpgradeStatus: Upgraded to xenial on 2016-04-22 (62 days ago)

Wolfgang Noichl (w-noichl) wrote :
Wolfgang Noichl (w-noichl) wrote :

"sudo pip install libtiff" yields the same problem, "sudo pip install git+https://github.com/pearu/pylibtiff.git" doesn't. So it's fixed upstream already.

Changed in pylibtiff (Debian):
status: Unknown → Confirmed
Changed in pylibtiff (Ubuntu):
status: New → Confirmed
Changed in pylibtiff (Ubuntu):
importance: Undecided → Medium
Changed in hundredpapercuts:
status: New → Confirmed
importance: Undecided → Medium
Changed in pylibtiff (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.