Opened 11 years ago
Closed 11 years ago
#11498 closed defect (fixed)
Failures of unit tests for authz_policy.py with ConfigObj 5.0.1
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 0.12.6 |
Component: | general | Version: | 0.12-stable |
Severity: | normal | Keywords: | authzpolicy unicode configobj |
Cc: | Branch: | ||
Release Notes: |
Fix breaking |
||
API Changes: | |||
Internal Changes: |
Description
I got the following on 0.12-stable. Also the same occur on 1.0-stable.
====================================================================== FAIL: test_unicode_resource_name (tracopt.perm.tests.authz_policy.AuthzPolicyTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/jun66j5/src/trac/tests/4ae2068eece9886ff8772338043cb9830e129de0/src/tracopt/perm/tests/authz_policy.py", line 75, in test_unicode_resource_name self.check_permission('WIKI_VIEW', 'anonymous', resource, None)) AssertionError: False != None ====================================================================== FAIL: test_unicode_username (tracopt.perm.tests.authz_policy.AuthzPolicyTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/jun66j5/src/trac/tests/4ae2068eece9886ff8772338043cb9830e129de0/src/tracopt/perm/tests/authz_policy.py", line 69, in test_unicode_username self.check_permission('WIKI_VIEW', u'änon', resource, None)) AssertionError: True != False ---------------------------------------------------------------------- Ran 1313 tests in 35.507s
It seems to be related to the following warning.
tracopt/perm/authz_policy.py:263: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if who in valid_users or \
Installed libraries:
Babel==0.9.6 Genshi==0.6 MySQL-python==1.2.5 Pygments==1.6 configobj==5.0.1 distribute==0.6.24 lxml==3.3.1 psycopg2==2.5.2 pytz==2013.9 six==1.5.2 twill==0.9 wsgiref==0.1.2
Attachments (0)
Change History (6)
comment:1 by , 11 years ago
Milestone: | next-minor-0.12.x → 0.12.6 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:2 by , 11 years ago
easy_install ConfigObj
in a Python 2.5 environment results in the install of ConfigObj 5.0.1 with errors. Like what was suggested for Babel in comment:12:ticket:11258, it would be nice if there was a Python version check in the setup script for ConfigObj. Additionally, it would be nice if a Python 2.5 environment were able to locate and install ConfigObj 4.7.2 rather than 5.0.1. I opened a ticket for the issue here.
follow-up: 4 comment:3 by , 11 years ago
I noticed that extra_require
in setup.py
on 0.12-stable doesn't have ConfigObj
. Should we backport [12037/branches/1.0-stable/setup.py] to 0.12-stable?
follow-up: 5 comment:4 by , 11 years ago
Replying to jomae:
I noticed that
extra_require
insetup.py
on 0.12-stable doesn't haveConfigObj
. Should we backport [12037/branches/1.0-stable/setup.py] to 0.12-stable?
I think it makes sense to backport it.
I had to do some testing to remind myself how this works. After [12037/branches/1.0-stable/setup.py], if ConfigObj
is not installed, the component is not shown on the plugin admin panel. If enabled by editing trac.ini, the log shows:
03:10:54 AM Trac[loader] DEBUG: Loading tracopt.perm.authz_policy from /home/user/Workspace/t11498/teo-rjollos.git 03:10:54 AM Trac[loader] DEBUG: Skipping "tracopt.perm.authz_policy = tracopt.perm.authz_policy [configobj]": ("DistributionNotFound: ConfigObj" not found)
Whereas prior to the change the plugin would be shown on the admin page and would load when enabled,
03:13:52 AM Trac[loader] DEBUG: Loading tracopt.perm.authz_policy from /home/user/Workspace/t11498/teo-rjollos.git
but then we just get many entries of the following in the logs when ConfigObj
isn't installed:
03:06:42 AM Trac[authz_policy] ERROR: configobj package not found
The behavior with [12037/branches/1.0-stable/setup.py] seems much better. Later on I think it would be nice to show tracopt.perm.authz_policy.*
on the plugin admin panel when ConfigObj
is not installed, but not allow it to be enabled and provide an indication of why it can't be enabled.
comment:5 by , 11 years ago
Keywords: | configobj added |
---|
The behavior with [12037/branches/1.0-stable/setup.py] seems much better.
Thanks for information! I'll backport it to 0.12-stable.
Unicode characters handling seems to be changed after configobj 5.0.0.
configobj 4.7.2
configobj 5.0.1
Proposed changes can be found in jomae.git@t11498 and jomae.git@t11498_0.12.6dev.