Preferable way is to :ref:`download <download>` tarball with the
signature from `official website <http://pyderasn.cypherpunks.ru/>`__::
- $ [fetch|wget] http://pyderasn.cypherpunks.ru/pyderasn-6.1.tar.xz
- $ [fetch|wget] http://pyderasn.cypherpunks.ru/pyderasn-6.1.tar.xz.sig
- $ gpg --verify pyderasn-6.1.tar.xz.sig pyderasn-6.1.tar.xz
- $ xz --decompress --stdout pyderasn-6.1.tar.xz | tar xf -
- $ cd pyderasn-6.1
+ $ [fetch|wget] http://pyderasn.cypherpunks.ru/pyderasn-6.2.tar.xz
+ $ [fetch|wget] http://pyderasn.cypherpunks.ru/pyderasn-6.2.tar.xz.sig
+ $ gpg --verify pyderasn-6.2.tar.xz.sig pyderasn-6.2.tar.xz
+ $ xz --decompress --stdout pyderasn-6.2.tar.xz | tar xf -
+ $ cd pyderasn-6.2
$ python setup.py install
# or copy pyderasn.py (+six.py, possibly termcolor.py) to your PYTHONPATH
You could use pip (**no** OpenPGP authentication is performed!) with PyPI::
$ cat > requirements.txt <<EOF
- pyderasn==6.1 --hash=sha256:TO-BE-FILLED
+ pyderasn==6.2 --hash=sha256:TO-BE-FILLED
six==1.14.0 --hash=sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a
EOF
$ pip install --requirement requirements.txt
News
====
+.. _release6.2:
+
+6.2
+---
+* Python ``int()``'s accepts even more various non-decimal characters
+ than expected. Make validation fully strict, without relying in ``int()``
+
.. _release6.1:
6.1
def colored(what, *args, **kwargs):
return what
-__version__ = "6.1"
+__version__ = "6.2"
__all__ = (
"Any",
LENINDEF = b"\x80" # length indefinite mark
LENINDEF_PP_CHAR = "I" if PY2 else "∞"
NAMEDTUPLE_KWARGS = {} if PY2 else {"module": __name__}
-SET01 = frozenset(("0", "1"))
+SET01 = frozenset("01")
+DECIMALS = frozenset("0123456789")
DECIMAL_SIGNS = ".,"
def pureint(value):
- i = int(value)
- if (value[0] in "+- ") or (value[-1] == " "):
+ if not set(value) <= DECIMALS:
raise ValueError("non-pure integer")
- return i
+ return int(value)
def fractions2float(fractions_raw):
pureint(fractions_raw)