Giter VIP home page Giter VIP logo

dag-cbor's Issues

Improve error messages

Errors messages should convey detailed information about the specific point in the byte-stream at which the error occurred, together with a snapshow of the relevant byte values, for easier debugging of applications using this library.

Transfer Ownership of 'quetz' Namespace in PyPI

Apologies for this unrelated GitHub issue, but I couldn't find a better way to contact you.

I'm one of the maintainers of Quetz, the open-source server for Conda packages. We're currently distributing our library under the 'quetz-server' namespace on PyPI, as 'quetz' is already taken by you. This breaks some of our automation, which makes releasing new versions of Quetz inconvenient.

Are you open to giving us ownership over the 'quetz' namespace on PyPI? This would help us tremendously.
If that's okay with you, I suggest transferring the project ownership to my PyPI account, jan_jagusch.

Thanks a lot in advance for considering my request. If you have any questions, please let me know. ๐Ÿ™

Infinite recursion loop

Hi all! First off, thank you for maintaining dag-cbor. It's great!

I came across an encoded DAG-CBOR object that makes dag-cbor recurse infinitely, or at least deeper than Python's default max recursion depth. Here it is, base64-encoded: bad.b64.txt

Here's the stack trace snippet:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ryan/src/bridgy-fed/local/lib/python3.11/site-packages/dag_cbor/decoding/__init__.py", line 127, in decode
    data, _ = _decode_item(stream, options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/src/bridgy-fed/local/lib/python3.11/site-packages/dag_cbor/decoding/__init__.py", line 149, in _decode_item
    value, num_bytes_further_read = _decoders[major_type](stream, arg, options)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/src/bridgy-fed/local/lib/python3.11/site-packages/dag_cbor/decoding/__init__.py", line 272, in _decode_dict
    v, _ = _decode_item(stream, options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/src/bridgy-fed/local/lib/python3.11/site-packages/dag_cbor/decoding/__init__.py", line 149, in _decode_item
    value, num_bytes_further_read = _decoders[major_type](stream, arg, options)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/src/bridgy-fed/local/lib/python3.11/site-packages/dag_cbor/decoding/__init__.py", line 231, in _decode_list
    item, _ = _decode_item(stream, options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/src/bridgy-fed/local/lib/python3.11/site-packages/dag_cbor/decoding/__init__.py", line 149, in _decode_item
    value, num_bytes_further_read = _decoders[major_type](stream, arg, options)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/src/bridgy-fed/local/lib/python3.11/site-packages/dag_cbor/decoding/__init__.py", line 231, in _decode_list
    item, _ = _decode_item(stream, options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...

You're not the only ones, whatever JS lib @ericvolp12 is using on atproto.tools has the same problem ๐Ÿ˜†: https://atproto.tools/records?did=did%3Aplc%3A4agp2hcrps6ou4vjv7uux7dm

Thanks in advance!

The package is not compatible with typing-extensions >=4.6.0

traceback:

File "/Users/ilyasiamionau/projects/atproto/atproto/cbor/__init__.py", line 4, in <module>
    import dag_cbor as _dag_cbor
  File "/Users/ilyasiamionau/Library/Caches/pypoetry/virtualenvs/atproto-iBRicY1L-py3.8/lib/python3.8/site-packages/dag_cbor/__init__.py", line 9, in <module>
    from .ipld import IPLDKind, IPLDScalarKind, IPLDObjPath
  File "/Users/ilyasiamionau/Library/Caches/pypoetry/virtualenvs/atproto-iBRicY1L-py3.8/lib/python3.8/site-packages/dag_cbor/ipld.py", line 30, in <module>
    from multiformats import CID
  File "/Users/ilyasiamionau/Library/Caches/pypoetry/virtualenvs/atproto-iBRicY1L-py3.8/lib/python3.8/site-packages/multiformats/__init__.py", line 22, in <module>
    from . import multibase
  File "/Users/ilyasiamionau/Library/Caches/pypoetry/virtualenvs/atproto-iBRicY1L-py3.8/lib/python3.8/site-packages/multiformats/multibase/__init__.py", line 22, in <module>
    from bases import (base2, base16, base8, base10, base36, base58btc, base58flickr, base58ripple,
  File "/Users/ilyasiamionau/Library/Caches/pypoetry/virtualenvs/atproto-iBRicY1L-py3.8/lib/python3.8/site-packages/bases/__init__.py", line 40, in <module>
    from . import encoding as encoding
  File "/Users/ilyasiamionau/Library/Caches/pypoetry/virtualenvs/atproto-iBRicY1L-py3.8/lib/python3.8/site-packages/bases/encoding/__init__.py", line 293, in <module>
    base8 = FixcharBaseEncoding(alphabet.base8, pad_char="=", padding="include")
  File "/Users/ilyasiamionau/Library/Caches/pypoetry/virtualenvs/atproto-iBRicY1L-py3.8/lib/python3.8/site-packages/bases/encoding/fixchar.py", line 106, in __init__
    validate(char_nbits, Union[int, Literal["auto"]])
  File "/Users/ilyasiamionau/Library/Caches/pypoetry/virtualenvs/atproto-iBRicY1L-py3.8/lib/python3.8/site-packages/typing_validation/validation.py", line 635, in validate
    _validate_union(val, t)
  File "/Users/ilyasiamionau/Library/Caches/pypoetry/virtualenvs/atproto-iBRicY1L-py3.8/lib/python3.8/site-packages/typing_validation/validation.py", line 515, in _validate_union
    validate(val, member_t)
  File "/Users/ilyasiamionau/Library/Caches/pypoetry/virtualenvs/atproto-iBRicY1L-py3.8/lib/python3.8/site-packages/typing_validation/validation.py", line 691, in validate
    raise unsupported_type_error
ValueError: Unsupported validation for type typing_extensions.Literal['auto'].

pls dont drop support of typing-extensions < 4.6.0 during fix, thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.