Edgewall Software

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11876 closed defect (fixed)

Trac 1.0.2 RPM build failure in tests - git_fs.py

Reported by: Riot.Nrrrd.mail@… Owned by: Jun Omae
Priority: normal Milestone: 1.0.3
Component: plugin/git Version: 1.0.2
Severity: normal Keywords: unicode rpm
Cc: felix.schwarz@… Branch:
Release Notes:

Fix failures of unit tests for git_fs.py with C/POSIX locale.

API Changes:
Internal Changes:


I am currently running Trac 1.0.1 on a Red Hat RHEL 6.5 system with Python 2.6.6.

I built it from a Fedora Core 19 SRPM (trac-1.0.1-1.fc19.src.rpm) which I found on the Internet via "rpmfind":


I am now able to find Trac 1.0.2 source RPMs for Fedora Core 19; either trac-1.0.2-1.fc19.src.rpm or trac-1.0.2-2.fc19.src.rpm:



If I try to upgrade Trac using either of the trac-1.0.2-1 or trac-1.0.2-2 SRPMs from Fedora Core 19, the RPM build fails the same single test in both cases - and the RPM isn't built. Here is what happens:

[root@stride2 tests]# printenv LANG

[root@stride2 SRPMS]# rpmbuild --rebuild trac-1.0.2-2.fc19.src.rpm
Installing trac-1.0.2-2.fc19.src.rpm


ERROR: test_get_node (tracopt.versioncontrol.git.tests.git_fs.GitNormalTestCase)

Traceback (most recent call last):
 File "/root/rpmbuild/BUILD/Trac-1.0.2/tracopt/versioncontrol/git/tests/git_fs.py", line 267, in test_get_node
   self._git('branch', u'tïckét10605', 'master')
 File "/root/rpmbuild/BUILD/Trac-1.0.2/tracopt/versioncontrol/git/tests/git_fs.py", line 53, in _git
   cwd=self.repos_path, **kwargs)
 File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__
   errread, errwrite)
 File "/usr/lib64/python2.6/subprocess.py", line 1234, in _execute_child
   raise child_exception
TypeError: execv() arg 2 must contain only strings


I get the same results from the build attempts whether the LANG/locale is en_US.UTF-8 or C.

I also tried it on a Red Hat RHEL 7.0 system with Python 2.7.5 and, unsurprisingly, got the same exact result for both LANG=en_US.UTF-8 and C locales.

The git_fs.py code snippet is

[root@miplvm-rh7 SRPMS]# cat -n /root/rpmbuild/BUILD/Trac-1.0.2/tracopt/versioncontrol/git/tests/git_fs.py | sed -n '264,272p'
   265	        # git_fs doesn't support non-ANSI strings on Windows
   266	        if os.name != 'nt':
   267	            self._git('branch', u'tïckét10605', 'master')
   268	            repos.sync()
   269	            self.assertEqual(rev, repos.get_node('/', u'tïckét10605').rev)
   270	            self.assertEqual(rev, repos.get_node('/.gitignore',
   271	                                                 u'tïckét10605').rev)

Attachments (0)

Change History (5)

comment:1 by Jun Omae, 10 years ago

Component: i18nplugin/git
Keywords: unicode rpm added; git_fs.py Unicode LANG removed
Milestone: next-stable-1.0.x1.0.3
Owner: set to Jun Omae
Status: newassigned

Thanks for the reporting. It seems the rpmbuild command drops locale environments while processing %build and %check, etc….

comment:2 by Jun Omae, 10 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [13495] and merged to trunk in [13496].

in reply to:  1 ; comment:3 by Riot.Nrrrd.mail@…, 10 years ago

Replying to jomae:

It seems the 'rpmbuild' command drops locale environments while processing %build and %check, etc….

Hi … just out of curiosity, by "drops locale environments" did you mean "overrides $LANG setting and resets it to 'C'"?

This comes from the RPM macros file in Red Hat:

[root@stride2 SRPMS]# sed -n '133,154p' /usr/lib/rpm/redhat/macros

# Bad hack to set $LANG to C during all RPM builds
%prep \
export LANG\
unset DISPLAY\

%build %%build\
export LANG\
unset DISPLAY\

%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
export LANG\
unset DISPLAY\

What is weird to me is how this Fedora Core 19 SRPM could be built into a binary RPM without failing, given this macros file.

Maybe this segment of the macros file is different in Fedora Core 19 and newer, but somehow I doubt it … yet here we have the final RPM existing despite this issue:


Does your fix in [13495] make it possible to pass this test in the "C" locale?

in reply to:  3 comment:4 by Riot.Nrrrd.mail@…, 10 years ago

Replying to Riot.Nrrrd.mail@…:

Does your fix in [13495] make it possible to pass this test in the "C" locale?

Oh, duh, never mind :-)

comment:5 by Felix Schwarz, 10 years ago

Cc: felix.schwarz@… added

Just to solve the "Fedora 19" mystery: The package is built in mock (essentially a very minimal chroot) and we didn't install optional packages during build time so a lot of optional tests (i.e. the git tests mentioned in this ticket) were just skipped). I'll try to ensure that most (all?) of the optional tests will be run during our builds in the future.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.