TypeError: string argument without an encoding

后端 未结 3 2070
执念已碎
执念已碎 2020-12-20 11:10

I want to upload compressed gzip of Json into Google Storage.

I have this code:

import datalab.storage as storage
import gzip
path = prefix + \'/orde         


        
3条回答
  •  余生分开走
    2020-12-20 11:56

    When you read any python function docs as

    bytes([source[, encoding[, errors]]])
    

    square brackets represent that those parameters are optional. multiple square brackets inside another mean they are next level of option params. For example

    bytes([source....
    

    means we can call bytes as byes() itself as [source] is optional here

    bytes() -> empty bytes object
    
    bytes(22)
    

    Here 22 is being passed as the source

    read this for more details about bytes and its params

    https://docs.python.org/3/library/stdtypes.html#bytes

提交回复
热议问题