It was giving troubles with debian dh_sphinxdoc, due
to an old, unrecognized version of jquery being there that
could not be symlinked to the js-sphinxdoc version.
This is a rather elegant trick from upstream to deal with the differences
between bytesarrays, strings, and unicode literals between Python2.x and
Py3k. However, it doesn't actually make a difference if we're running Py3k or
not to use the trick, since it dynamically calls the builtin type for the
native string in any Python version. It works like so:
>>> import sys
>>> data = '{}\n2 + 2 ≠ 5'.format(sys.version[:5])
>>> print(data)
3.3.2
2 + 2 ≠ 5
>>> type(data)
<class 'str'>
>>> type(data)()
''
>>> unicodedata = u'Mon corps et moi étions un, á cause de cette corde maudite.'
>>> type(unicodedata)
<class 'str'>
Also, in Python2.x:
>>> import sys
>>> data = '{}\n2 + 2 ≠ 5'.format(sys.version[:5])
>>> print data
2.7.5
2 + 2 ≠ 5
>>> type(data)
<type 'str'>
>>> type(data)()
''
>>> unicodedata = u'Mon corps et moi étions un, á cause de cette corde maudite.'
>>> type(unicodedata)
<type 'unicode'>
>>> type(unicodedata)()
u''
For some reason, in GnuPG>=2.x, a missing/corrupted trustdb is a fatal
error. This means that if the homedir was just changed, and any command which
utilizes keys is called (e.g. sign, encrypt, decrypt, etc.) GnuPG dies without
executing the command because we can't find a valid trustdb.
What's even more is that there is a new command in GnuPG>=2.x:
'--fix-trustdb'. You'd think it would, you know, *fix the trustdb*. Hah! Think
again! It prints out a series of shell commands (incorrect ones, at that, as
they don't respect the relevant env variables such as $GNUPGHOME) in a format
which is *not* exec'able (i.e. you can't do something similar to how
$ exec `ssh-agent`
is used). Software engineering, motherfuckers. #FML.
We should only add these methods (or rather, link them to their corresponding
functions in the gnupg._trust module) if using GnuPG>=2.x.
* ADD --export-ownertrust and --import-ownertrust functionality.
* ADD function gnupg._trust._create_trustdb().
* ADD function gnupg._trust.import_ownertrust().
* ADD function gnupg._trust.export_ownertrust().
* ADD function gnupg._trust.fix_trustdb().
* ADD function _util._deprefix() for stripping a given prefix from the
beginning of another string.
* ADD function _util._separate_keywork() for extracting the keyword from the
beginning of status-fd output.
* REMOVE excess EOL whitespace.
* CLEANUP method gnupg.GPGBase._read_response().
* CHANGE _find_binary() utility function to look for a gpg2 binary on the
users PATH if no binary is given and gpg is not found.
* FIXES an error where only gpg=>1.4.x was found.
* CHANGE unittest test_copy_data_bytesio() to actually check that the output
data matches the original message string given to io.BytesIO().
* REMOVE class test.test_gnupg.ResultStringIO, as it is now not used
anywhere.
* FIXES test_copy_data_bytesio() not actually testing what it was supposed
to.
* CHANGE unittest test_make_args_drop_protected_options() to discover the
path to the GnuPG binary; the discovered path SHOULD be the same as that
which was discovered upon class instantiation.
* FIXES failure in unittest test_make_args_drop_protected_options() which was
caused by the path to the GnuPG binary being hardcoded.