Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip安装报错“段错误 (核心已转储)”,以及python3的"TypeError: can't concat str to bytearray" #36

Closed
ghost opened this issue Dec 19, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 19, 2018

pip提示信息:
Installing collected packages: pycrypto, simplejson, six, certifi, idna, chardet, urllib3, requests, xmltodict, python-weixin
Successfully installed certifi-2018.11.29 chardet-3.0.4 idna-2.8 pycrypto-2.6.1 python-weixin-0.4.5 requests-2.21.0 simplejson-3.16.0 six-1.12.0 urllib3-1.24.1 xmltodict-0.11.0
段错误 (核心已转储)

环境:
系统:ubuntu18.04
Python:3.6.7

@ghost
Copy link
Author

ghost commented Dec 19, 2018

通过pip没有安装上,直接下载的源码,使用下面的代码测试:

from weixin.client import WeixinAPI

# 海浪小程序的资料
APP_ID = "xxx"
APP_SECRET = "xxx"


REDIRECT_URI = 'http://xxx.com/redirect_uri'  # 这里一定要注意 地址一定要加上http/https

scope = ("snsapi_login", )
api = WeixinAPI(appid=APP_ID,
                app_secret=APP_SECRET,
                redirect_uri=REDIRECT_URI)

authorize_url = api.get_authorize_url(scope=scope)

print(">>>", authorize_url)

有以下的报错

Traceback (most recent call last):
  File "weixin.py", line 15, in <module>
    authorize_url = api.get_authorize_url(scope=scope)
  File "/test/weixin/oauth2.py", line 88, in get_authorize_url
    return req.get_authorize_url(scope=scope, state=state)
  File "/test/weixin/oauth2.py", line 164, in get_authorize_url
    return self._url_for_authorize(scope=scope, state=state)
  File "/test/weixin/oauth2.py", line 125, in _url_for_authorize
    url_params = url_encode(client_params, sort=True)
  File "/test/weixin/helper.py", line 329, in url_encode
    return separator.join(_url_encode_impl(obj, charset, encode_keys, sort, key))
  File "/test/weixin/helper.py", line 323, in _url_encode_impl
    yield url_quote_plus(key) + '=' + url_quote_plus(value)
  File "/test/weixin/helper.py", line 309, in url_quote_plus
    return url_quote(string, charset, errors, safe + ' ', '+').replace(' ', '+')
  File "/test/weixin/helper.py", line 298, in url_quote
    safe = frozenset(bytearray(safe) + _always_safe) - frozenset(bytearray(unsafe))
TypeError: can't concat str to bytearray

不支持python3吧

@ghost ghost changed the title pip安装报错“段错误 (核心已转储)” pip安装报错“段错误 (核心已转储)”,以及python3的"TypeError: can't concat str to bytearray" Dec 19, 2018
@gusibi
Copy link
Owner

gusibi commented Dec 21, 2018

TypeError: can't concat str to bytearray 已经修复了 fixed

@gusibi
Copy link
Owner

gusibi commented Dec 21, 2018

段错误 (核心已转储) 这个不是包的错误吧 看起来是系统存储的报错

@gusibi gusibi closed this as completed Dec 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant