VERSION | 2 +- doc/install.rst | 12 ++++++------ doc/news.rst | 8 ++++++++ doc/thanks.rst | 2 ++ pyderasn.py | 17 ++++++++++------- diff --git a/VERSION b/VERSION index 0ff4c879ffc21ccff360dbb4e55627d804ff95ab0735552cd4dab6ba75d57c45..1ef68e351036fb994c26bcfc348dbcadef5b77c652b03d1048ee3381eb92c4db 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.0 +8.1 diff --git a/doc/install.rst b/doc/install.rst index fe578969053ad77c1fd7ef7b7f3b6fc02d9a9d4aaf00be2b98b99b307437f413..5714645e77918d55c58fce7d7389d9a460851b22508e1d84303fd019fdd9725f 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -4,11 +4,11 @@ Preferable way is to :ref:`download ` tarball with the signature from `official website `__:: - $ [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 @@ -21,7 +21,7 @@ You could use pip (**no** OpenPGP authentication is performed!) with PyPI:: $ cat > requirements.txt <`_ for helping with :py:class:`pyderasn.AutoAddSlots` metaclass * `Tim Perevezentsev `_ for huge quantity of improvement ideas +* `Evgeny Drobotun `_ for testing under Windows + and bugreporting diff --git a/pyderasn.py b/pyderasn.py index 0a110171386be4aa2aff412062b9d97713cdd4c39f16989017d28422c32b7b10..32fefcb2fcdc174ca8213c69798f837f26054b8cef68faa1b68ace18afb61417 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -1170,8 +1170,6 @@ from datetime import datetime 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 @@ -1201,7 +1199,7 @@ except ImportError: # pragma: no cover def colored(what, *args, **kwargs): return what -__version__ = "8.0" +__version__ = "8.1" __all__ = ( "agg_octet_string", @@ -1292,8 +1290,13 @@ """Make mmap-ed memoryview for reading from file :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): @@ -7897,12 +7900,12 @@ type=argparse.FileType("rb"), 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 ()