Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Traceback (most recent call last):
- File "C:/_codes/pycharm/first-webapp/www/aaaaaaaa.py", line 11, in <module>
- loop.run_until_complete(test())
- ... ...
- File "C:/_codes/pycharm/first-webapp/www/aaaaaaaa.py", line 6, in test
- await www.orm.create_pool(user='root', password='', db='first_webapp')
- File "C:_codespycharmfirst-webappwwworm.py", line 22, in create_pool
- loop = loop
- ... ...
- File "C:Python35libsite-packagesaiomysqlconnection.py", line 75, in _connect
- conn = Connection(*args, **kwargs)
- File "C:Python35libsite-packagesaiomysqlconnection.py", line 176, in __init__
- self._encoding = charset_by_name(self._charset).encoding
- **AttributeError: 'NoneType' object has no attribute 'encoding'**
- Exception ignored in: bound method Connection.__del__ of aiomysql.connection.Connection object at 0x0000000003347E10
- Traceback (most recent call last):
- File "C:Python35libsite-packagesaiomysqlconnection.py", line 691, in __del__
- **AttributeError: 'Connection' object has no attribute '_writer'**
- async def create_pool(loop=None, **kw):
- logging.info('create database connection pool...')
- global __pool
- __pool = await aiomysql.create_pool(
- host = kw.get('host', 'localhost'),
- port = kw.get('port', 3306),
- user = kw['user'],
- password = kw['password'],
- db = kw['db'],
- charset = kw.get('charset', 'utf-8'),
- autocommit = kw.get('autocommit', 'True'),
- maxsize = kw.get('maxsize', 10),
- minsize = kw.get('minsize', 1),
- loop = loop
- )
- async def test():
- await www.orm.create_pool(user='root', password='', db='first_webapp')
- u = User(name='Test', email='test@example.com', passwd='1234567890', image='about:blank')
- await u.save()
- loop = asyncio.get_event_loop()
- loop.run_until_complete(test())
- loop.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement