Advertisement
Guest User

Untitled

a guest
Jul 10th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. Traceback (most recent call last):
  2.  
  3. File "C:/_codes/pycharm/first-webapp/www/aaaaaaaa.py", line 11, in <module>
  4.  
  5. loop.run_until_complete(test())
  6.  
  7. ... ...
  8.  
  9. File "C:/_codes/pycharm/first-webapp/www/aaaaaaaa.py", line 6, in test
  10.  
  11. await www.orm.create_pool(user='root', password='', db='first_webapp')
  12.  
  13. File "C:_codespycharmfirst-webappwwworm.py", line 22, in create_pool
  14.  
  15. loop = loop
  16.  
  17. ... ...
  18.  
  19. File "C:Python35libsite-packagesaiomysqlconnection.py", line 75, in _connect
  20.  
  21. conn = Connection(*args, **kwargs)
  22.  
  23. File "C:Python35libsite-packagesaiomysqlconnection.py", line 176, in __init__
  24.  
  25. self._encoding = charset_by_name(self._charset).encoding
  26.  
  27. **AttributeError: 'NoneType' object has no attribute 'encoding'**
  28.  
  29. Exception ignored in: bound method Connection.__del__ of aiomysql.connection.Connection object at 0x0000000003347E10
  30.  
  31. Traceback (most recent call last):
  32.  
  33. File "C:Python35libsite-packagesaiomysqlconnection.py", line 691, in __del__
  34.  
  35. **AttributeError: 'Connection' object has no attribute '_writer'**
  36.  
  37. async def create_pool(loop=None, **kw):
  38. logging.info('create database connection pool...')
  39. global __pool
  40. __pool = await aiomysql.create_pool(
  41. host = kw.get('host', 'localhost'),
  42. port = kw.get('port', 3306),
  43. user = kw['user'],
  44. password = kw['password'],
  45. db = kw['db'],
  46. charset = kw.get('charset', 'utf-8'),
  47. autocommit = kw.get('autocommit', 'True'),
  48. maxsize = kw.get('maxsize', 10),
  49. minsize = kw.get('minsize', 1),
  50. loop = loop
  51. )
  52.  
  53. async def test():
  54. await www.orm.create_pool(user='root', password='', db='first_webapp')
  55. u = User(name='Test', email='test@example.com', passwd='1234567890', image='about:blank')
  56. await u.save()
  57.  
  58. loop = asyncio.get_event_loop()
  59. loop.run_until_complete(test())
  60. loop.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement