* ADD patches from Mikael Nordfeldth.
* FIXES#14 issues with strcmp in unittests looking for string literals when
Python3 expects byte strings.
* TODO: perhaps there should be a generalized function in
gnupg/test/test_gnupg.py which automatically translates Python2 strings to
b'' strings.
* CLOSES issue #14.
* ADD patch by Mikael Nordfeldth to file python3 syntax compatibility due to
the 'file' builtin being removed.
isinstance(foo, file) → hasattr(foo, 'read'), or,
file = _io._IOBase
* CLOSES issue #13.
https://github.com/isislovecruft/python-gnupg/pull/13
This patch sets the environment variable LANGUGE to 'en', meaning English translation is used for outputs. The string comparisons in test_gpg_binary_version_str failed otherwise when using a non-English locale. Another choice may be to set LANG=C to avoid locales all-in-all.
* CHANGE default key type to RSA for older GnuPG versions, since they seems
to not understand using a 'default' key type.
* UPDATE docstring for GPG.gen_key_input().
* ADD functions _util._match_version_string(), _util._is_gpg2(), and
_util._is_gpg1() for determining whether to set the default Key-Type to
'default' (for GnuPG v2.x) or to 'RSA' (for GnuPG v1.x).
* ADD class attribute GPG.binary_version, which stores the GnuPG executable's
version string, which should be in the form x.x.x, where 'x' is an integer.
* ADD docs/change-license-emails.txt, which includes email exchanges between
myself and intrigeri, including links to Debian and LEAP mailing lists with
arguments for and against using AGPL for a library.
* CHANGE license header for all files.
* CHANGE LICENSE file and gnupg/copyright.py to use GPLv3+ text.
* FIX Python3 error where a :class:`collections.OrderedDict` instance,
including it's keys() method, is not iterable.
* CLOSES PR#7 In Python 3 OrderedDict.keys() are not indexable
* CHANGE an occurence of xrange() iteration over a fixed length list to use
range(); Python3's range() function is equivalent to Python2's xrange(),
while the small fixed length of the list in this case doesn't effect speed
at all.
The following snippet shows that to create a proper timestamp, we should
feed mktime() with localtime() data rather than gmtime(), as it is locale
aware.
>>> from time import mktime, gmtime, localtime
>>> bad = gmtime(mktime(gmtime()))
>>> good = gmtime(mktime(localtime()))
>>> judge = gmtime()
>>> if bad == good: "You're using UTC. Demonstration is impossible."
... elif bad == judge: "I can be wrong"
... elif good == judge: "but this shows I'm right"
...
"but this shows I'm right"
The above code checks whether gmtime() == gmtime(timestamp) from
mktime(). Obviously we don't get the same 'now' if we feed the bad value
to mktime.
GPG signature timestamps are considered UTC, this may cause times to be off
by delta > 1000 in def test_signature_string_verification because it
incorrectly gave gmtime() as an argument to mktime().
Python 2 and 3 docs both say that mktime should have a struct_time argument
"which expresses the time in local time, not UTC". So the test is now using
time.localtime() instead of time.gmtime()
We could always cast counts.keys() to a list, from the dictionary view they
are but a more efficient way of doing this is to simply pop the items from
our result list as we traverse the returned iterable dictionary view.
* I don't actually remember if this solves the problem where Github looks for
a .md file and setup.py wants a README file that must actually be a hard
file. *le sigh*.