• Carlos Ramos Carreño's avatar
    Transform tree data to `bytes`. · fadc5a07
    Carlos Ramos Carreño authored
    The data in the tree test cannot be automatically converted to `bytes`
    as a encoding is necessary in that case:
    
    ```python
    Traceback (most recent call last):
      File "/srv/slapgrid/slappart66/git/pygolang/golang/__init__.py", line 125, in _
        return f(*argv, **kw)
      File "/srv/slapgrid/slappart66/git/wendelin.core/wcfs/internal/xbtree/xbtreetest/treegen.py", line 281, in TreesSrv
        zblk.setblkdata(v2)
      File "/srv/slapgrid/slappart66/git/wendelin.core/bigfile/file_zodb.py", line 294, in setblkdata
        blkdata = bytes(buf)                    # FIXME does memcpy
    TypeError: string argument without an encoding
    ```
    
    As we know that the data is ASCII, we use the ASCII encoder to convert
    it to `bytes`.
    fadc5a07
treegen.py 19 KB