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-8.0.tar.xz
- $ [fetch|wget] http://pyderasn.cypherpunks.ru/pyderasn-8.0.tar.xz.sig
- $ gpg --verify pyderasn-8.0.tar.xz.sig pyderasn-8.0.tar.xz
- $ xz --decompress --stdout pyderasn-8.0.tar.xz | tar xf -
- $ cd pyderasn-8.0
+ $ [fetch|wget] http://pyderasn.cypherpunks.ru/pyderasn-8.1.tar.xz
+ $ [fetch|wget] http://pyderasn.cypherpunks.ru/pyderasn-8.1.tar.xz.sig
+ $ gpg --verify pyderasn-8.1.tar.xz.sig pyderasn-8.1.tar.xz
+ $ xz --decompress --stdout pyderasn-8.1.tar.xz | tar xf -
+ $ cd pyderasn-8.1
$ 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==8.0 --hash=sha256:TO-BE-FILLED
+ pyderasn==8.1 --hash=sha256:TO-BE-FILLED
six==1.14.0 --hash=sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a
EOF
$ pip install --requirement requirements.txt
News
====
+.. _release8.1:
+
+8.1
+---
+* Workability under Microsoft Windows OS should be restored: it has
+ different ``mmap`` constants and implementation, preventing
+ ``pyderasn`` importing
+
.. _release8.0:
8.0
:py:class:`pyderasn.AutoAddSlots` metaclass
* `Tim Perevezentsev <riffm2005@gmail.com>`_ for huge quantity of
improvement ideas
+* `Evgeny Drobotun <drobotun@xakep.ru>`_ for testing under Windows
+ and bugreporting
from datetime import timedelta
from io import BytesIO
from math import ceil
-from mmap import mmap
-from mmap import PROT_READ
from operator import attrgetter
from string import ascii_letters
from string import digits
def colored(what, *args, **kwargs):
return what
-__version__ = "8.0"
+__version__ = "8.1"
__all__ = (
"agg_octet_string",
:param fd: file object
:returns: memoryview over read-only mmap-ing of the whole file
+
+ .. warning::
+
+ It is known to work under neither Python 2.x nor Windows.
"""
- return memoryview(mmap(fd.fileno(), 0, prot=PROT_READ))
+ import mmap
+ return memoryview(mmap.mmap(fd.fileno(), length=0, prot=mmap.PROT_READ))
def pureint(value):
help="Path to BER/CER/DER file you want to decode",
)
args = parser.parse_args()
- if PY2:
+ try:
+ raw = file_mmaped(args.RAWFile)[args.skip:]
+ except:
args.RAWFile.seek(args.skip)
raw = memoryview(args.RAWFile.read())
args.RAWFile.close()
- else:
- raw = file_mmaped(args.RAWFile)[args.skip:]
oid_maps = (
[obj_by_path(_path) for _path in (args.oids or "").split(",")]
if args.oids else ()