LianjiaTech / sosotest

sosotest自动化测试平台
MIT License
506 stars 265 forks source link

跟python3.7有兼容性问题 #2

Open sharpdeep opened 4 years ago

sharpdeep commented 4 years ago

python3 manage.py migrate

BASE_DIR: /Users/ruishencai/work/code/github/sosotest/AutotestWebD rootDir: /Users/ruishencai/work/code/github/sosotest config.ini CONFDICT: {'COMMON': {'support_charset': 'UTF8,UTF-8,GBK,GB2312', 'file_max_show_len': '4000', 'allowed_host': '[""]', 'groupLevel1': '业务线', 'groupLevel2': '模块', 'loginType': 'SYSTEM', 'showMenuConfig': '{"HttpInterface":1,"DubboInterface":1,"StatisticTask":1}'}, 'LDAP': {'AUTH_LDAP_SERVER_URI': 'ldap://yourldapserver.com:389', 'AUTH_LDAP_BIND_DN': 'CN=ldapauth,OU=Sysusers,DC=ustaff,DC=com', 'AUTH_LDAP_BIND_PASSWORD': 'xxxxxxxxxxxxxx', 'AUTH_LDAP_USER_ATTR_MAP': '{"first_name": "cn","email": "mail"}', 'AUTH_LDAP_GROUP_SEARCH': 'LDAPSearch("OU=mailground,DC=ustaff,DC=com",ldap.SCOPE_SUBTREE, "(objectClass=group)" )', 'AUTH_LDAP_GROUP_TYPE': 'GroupOfNamesType(name_attr="CN")', 'AUTH_LDAP_USER_SEARCH': 'LDAPSearchUnion(\nLDAPSearch(\'ou=XXX,dc=xxxxx,dc=com\', ldap.SCOPE_SUBTREE, "(&(objectClass=person)(sAMAccountName=%(user)s))"),\n)'}, 'SITE': {'site_name': 'sosotest', 'header': 'sosotest自动化测试平台管理系统', 'title': 'sosotest自动化测试平台管理系统', 'framework_version': 'sosotest-AutotestPlatform-v2.2'}, 'DIR': {'root': 'sosotest_opensource', 'framework': 'AutotestFramework', 'web': 'AutotestWebD', 'uiFramework': 'RobotUiTest', 'releaseRoot': 'D:/all_github/sosotest', 'useTag': 'TEST01'}, 'DB': {'host': '127.0.0.1', 'port': '3306', 'username': 'root', 'password': 'Root.1234', 'dbname': 'sosotest_data'}, 'TCP': {'host': '127.0.0.1', 'port': '9298', 'uiport': '8298', 'ftpport': '6299'}, 'WEB': {'uri': 'http://test.sosotest.com', 'debug': 'True'}, 'EMAIL': {'sender': 'test@163.com', 'smtpserver': 'smtp.163.com', 'username': 'fateuser', 'password': 'fatepassword'}, 'REDIS': {'host': '127.0.0.1', 'port': '6379', 'password': ''}, 'DIRFILE': {'filepath': '/data0/release/sosotest_files', 'log': 'rootlog', 'uploads': 'uploads', 'reports': 'reports'}, 'DB-TEST01': {'host': '127.0.0.1', 'port': '3306', 'username': 'root', 'password': 'password', 'dbname': 'sosotest_data'}, 'TCP-TEST01': {'host': '127.0.0.1', 'port': '9298', 'uiport': '8298', 'ftpport': '6299'}, 'WEB-TEST01': {'uri': 'http://test.sosotest.com', 'debug': 'True'}, 'EMAIL-TEST01': {'sender': 'test@163.com', 'smtpserver': 'smtp.163.com', 'username': 'fateuser', 'password': 'fatepassword'}, 'REDIS-TEST01': {'host': '127.0.0.1', 'port': '6379', 'password': ''}, 'DIRFILE-TEST01': {'filepath': '/Users/ruishencai/work/code/github/sosotest/soso_files', 'log': 'rootlog', 'uploads': 'uploads', 'reports': 'reports'}} srcRootDir: /Users/ruishencai/work/code/github/src releaseDir: D:/all_github/sosotest ALLOWED_HOSTS: [''] GroupLevel1:业务线 GroupLevel2:模块 showMenuConfig:{'HttpInterface': 1, 'DubboInterface': 1, 'StatisticTask': 1} TEST_ENV [TEST01] TCP_HOST[127.0.0.1] TCP_PORT[9298] TCP_UIPORT[8298] dbHost[127.0.0.1] dbPort[3306] dbUsername[root] dbPassword[password] dbName[sosotest_data] logRoot:/Users/ruishencai/work/code/github/sosotest/soso_files/rootlog uploadsRoot:/Users/ruishencai/work/code/github/sosotest/soso_files/uploads reportsRoot:/Users/ruishencai/work/code/github/sosotest/soso_files/reports CONF_KEYS:dbKey[DB-TEST01] tcpKey[TCP-TEST01] webKey[WEB-TEST01] emailKey[EMAIL-TEST01] ############################################################################# ###############################isRelase[False]############################### ############################################################################# [DJANGOSETTINGINFOS] Traceback (most recent call last): File "manage.py", line 22, in execute_from_command_line(sys.argv) File "/Users/ruishencai/.virtualenvs/sosotest/lib/python3.7/site-packages/django/core/management/init.py", line 364, in execute_from_command_line utility.execute() File "/Users/ruishencai/.virtualenvs/sosotest/lib/python3.7/site-packages/django/core/management/init.py", line 338, in execute django.setup() File "/Users/ruishencai/.virtualenvs/sosotest/lib/python3.7/site-packages/django/init.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/Users/ruishencai/.virtualenvs/sosotest/lib/python3.7/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/Users/ruishencai/.virtualenvs/sosotest/lib/python3.7/site-packages/django/apps/config.py", line 94, in create module = import_module(entry) File "/Users/ruishencai/.virtualenvs/sosotest/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/Users/ruishencai/.virtualenvs/sosotest/lib/python3.7/site-packages/django/contrib/admin/init.py", line 4, in from django.contrib.admin.filters import ( File "/Users/ruishencai/.virtualenvs/sosotest/lib/python3.7/site-packages/django/contrib/admin/filters.py", line 10, in from django.contrib.admin.options import IncorrectLookupParameters File "/Users/ruishencai/.virtualenvs/sosotest/lib/python3.7/site-packages/django/contrib/admin/options.py", line 12, in from django.contrib.admin import helpers, widgets File "/Users/ruishencai/.virtualenvs/sosotest/lib/python3.7/site-packages/django/contrib/admin/widgets.py", line 151 '%s=%s' % (k, v) for k, v in params.items(), ^ SyntaxError: Generator expression must be parenthesized

找了一下,貌似是python3.7跟django有兼容问题

https://zhuanlan.zhihu.com/p/44276280

sunyongsheng112 commented 4 years ago

File "/Users/ruishencai/.virtualenvs/sosotest/lib/python3.7/site-packages/django/contrib/admin/widgets.py", line 151 把这行后面的逗号去掉就行了