You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/local/lib/python3.5/dist-packages/flask_restful/__init__.py", line 270, in error_router
return original_handler(e)
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 32, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.5/dist-packages/flask_restful/__init__.py", line 270, in error_router
return original_handler(e)
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 32, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.5/dist-packages/flask_restful/__init__.py", line 462, in wrapper
resp = resource(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/flask/views.py", line 84, in view
return self.dispatch_request(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/flask_restful/__init__.py", line 572, in dispatch_request
resp = meth(*args, **kwargs)
File "/media/sf_workspace/python/flask/codebot_kakao/app.py", line 66, in post
url = save_to_pastebin(code, format="python")
File "/media/sf_workspace/python/flask/codebot_kakao/app.py", line 28, in save_to_pastebin
paste_private = 'unlisted')
File "/usr/local/lib/python3.5/dist-packages/pastebin.py", line 679, in paste
request_string = urllib.urlopen(self._api_url, urllib.urlencode(argv))
AttributeError: module 'urllib' has no attribute 'urlopen'
It should be replace to urllib.request.urlopen
The text was updated successfully, but these errors were encountered:
There's a bit more too here, we'll also run into issues with urlencode(), etc. Using the six package would be a better way to go about this. @Morrolan are you open to pull requests to make this work on both py2 and py3?
howiezhao
added a commit
to howiezhao/PastebinAPI
that referenced
this issue
Mar 17, 2021
python3 raise AttributeError.
It should be replace to
urllib.request.urlopen
The text was updated successfully, but these errors were encountered: