Giter Site home page Giter Site logo

bce-sdk-python's People

Contributors

chensheng0 avatar ddc-console avatar ltttttt3 avatar mrssklove avatar xuchuan avatar zha34jack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bce-sdk-python's Issues

use pycryptodome instead of pycrypto

(.venv) root@411e8a2f:~# pip freeze|grep pycrypto
pycrypto==2.6.1
pycryptodome==3.9.4
pycryptodomex==3.9.4
(.venv) root@411e8a2f:~# 
>>> import baidubce
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    import baidubce
  File "/cmdb/.venv/lib/python3.6/site-packages/baidubce/__init__.py", line 18, in <module>
    from . import protocol
  File "/cmdb/.venv/lib/python3.6/site-packages/baidubce/protocol.py", line 20, in <module>
    from .utils import Expando
  File "/cmdb/.venv/lib/python3.6/site-packages/baidubce/utils.py", line 32, in <module>
    from Crypto.Cipher import AES
  File "/cmdb/.venv/lib/python3.6/site-packages/Crypto/Cipher/__init__.py", line 27, in <module>
    from Crypto.Cipher._mode_ecb import _create_ecb_cipher
  File "/cmdb/.venv/lib/python3.6/site-packages/Crypto/Cipher/_mode_ecb.py", line 29, in <module>
    from Crypto.Util._raw_api import (load_pycryptodome_raw_lib,
  File "/cmdb/.venv/lib/python3.6/site-packages/Crypto/Util/_raw_api.py", line 33, in <module>
    from Crypto.Util.py3compat import byte_string
ImportError: cannot import name 'byte_string'
>>> 

sts get_session_token 返回的是空字符串

    sts_client = StsClient(bos_config)

    duration_seconds = 3600
    access_dict = {
        'service': 'bce:bos',
        'region': 'su',
        'effect': 'Allow',
        'resource': ['bucket'],
        'permission': ['WRITE']
    }

    acl = {'accessControlList': [access_dict]}
    response = sts_client.get_session_token(
        acl=acl, duration_seconds=duration_seconds)

我用 bce-sdk-js node的demo是成功的,python没返回东西

TypeError: can't concat str to bytes

Here is the simple code when running with python 3.8:

response1 = bts_client.list_instances()
for instance in response1.instances:
    response2 = bts_client.list_tables(instance.name)
    for table in response2.tables:
        print(instance.name, table.name)

Here is the error message:
File "/usr/local/lib/python3.8/site-packages/baidubce/services/bts/bts_client.py", line 205, in list_tables
path = bts.URL_PREFIX + b"/" + instance_name + b"/tables"
TypeError: can't concat str to bytes

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.