~bennabiy/+junk/python-xlib

« back to all changes in this revision

Viewing changes to Xlib/xauth.py

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura, Ramkumar Ramachandra, Andrew Shadura
  • Date: 2015-08-13 08:14:19 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20150813081419-hdefinnghp2iydkx
Tags: 0.14+20091101-3
[ Ramkumar Ramachandra ]
* Remove useless debugging output (Closes: #565996)

[ Andrew Shadura ]
* Switch to 3.0 (quilt) format.
* Rename patches.
* Use debhelper 9 in its short form.
* Use pybuild.
* Bump Standards-Version.
* Don't build or install PostScript documentation and info files.
* Use system-provided texi2html instead of a shipped version
  (Closes: #795057).
* Update debian/copyright (Closes: #795057).
* Don't install Makefile or texi2html with the documentation.
* Set executable bit for examples.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
        try:
42
42
            raw = open(filename, 'rb').read()
43
 
        except IOError, err:
 
43
        except IOError as err:
44
44
            raise error.XauthError('~/.Xauthority: %s' % err)
45
45
 
46
46
        self.entries = []
81
81
                if len(data) != length:
82
82
                    break
83
83
 
84
 
                self.entries.append((family, addr, num, name, data))
85
 
        except struct.error, e:
86
 
            print "Xlib.xauth: warning, failed to parse part of xauthority file (%s), aborting all further parsing" % filename
 
84
                self.entries.append((family, addr.decode('UTF-8'),
 
85
                                     num.decode('UTF-8'), name.decode('UTF-8'), data))
 
86
        except struct.error as e:
 
87
            print ("Xlib.xauth: warning, failed to parse part of xauthority file (%s), aborting all further parsing" % filename)
87
88
            #pass
88
89
 
89
90
        if len(self.entries) == 0:
90
 
            print "Xlib.xauth: warning, no xauthority details available"
 
91
            print ("Xlib.xauth: warning, no xauthority details available")
91
92
            # raise an error?  this should get partially caught by the XNoAuthError in get_best_auth..
92
93
 
93
94
    def __len__(self):