Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

vcstools make test fails on our build machines #77

Closed

Description

@tfoote

It's in the unicode command line test. I'm not sure why this fails. I'm going to try on my own lucid machine. It works fine on travis and my precise machine.

http://jenkins.willowgarage.com:8080/job/_release-vcstools/1/console

A         branches/test_branch
.WARNING [vcstools] No tar subdirectory chosen via the 'version' argument for url: https://code.ros.org/svn/release/download/stacks/exploration/exploration-0.3.0/exploration-0.3.0.tar.bz2[/vcstools]
.......
======================================================================
ERROR: test_shell_command_verbose (test.test_base.BaseTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rosbuild/hudson/workspace/_release-vcstools/test/test_base.py", line 76, in test_shell_command_verbose
    run_shell_command("echo %s"%(b'\xc3\xa4'.decode('UTF-8')), shell=True, verbose=True)
  File "/home/rosbuild/hudson/workspace/_release-vcstools/src/vcstools/common.py", line 132, in run_shell_command
    env=env)
  File "/usr/lib/python2.6/subprocess.py", line 633, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
    raise child_exception
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 5: ordinal not in range(128)

Activity

  1. tfoote commented on Jun 14, 2013

    @tfoote
    ContributorAuthor

    It works from my desktop lucid machine.

  2. tkruse commented on Jun 15, 2013

    @tkruse
    Contributor

    Tully, it seems Jenkins attempts to run the tests for a unused ancient branch:
    Commencing build of Revision bfe2a2a (origin/get_branches_enhancement)
    As opposed to building master only.

    So it seems mostly like a Jenkins config issue now. A workaround would be to remove all non-master branches from the vcstools repo, if you cannot figure out how to tell Jenkins to never mind anything else than master.

  3. tkruse commented on Jun 15, 2013

    @tkruse
    Contributor

    Hm, that looks like py2.6:

    /usr/lib/python2.6/subprocess.py

    Tests pass for me using python 2.6.8, which is also what runs on
    Travis. Can you find out which python2.6 minor version runs on
    jenkins? It does not seem like 2.6.8 (from the line numbers).

    On Sat, Jun 15, 2013 at 10:41 AM, Tully Foote [email protected]:

    Good catch on the branch. I've fixed that: ros-infrastructure/buildfarm@
    c961354ros-infrastructure/buildfarm@c961354

    However that test is still present and failing.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/77#issuecomment-19493314
    .

  4. tkruse commented on Jun 15, 2013

    @tkruse
    Contributor

    Yes, I am at a loss for how to fix this, if we use some outdated version of
    py2.6, then I'd recommend wrapping the test in "if sys.version_info >= (2,
    6, 8)".

    On Sat, Jun 15, 2013 at 11:28 AM, Thibault Kruse
    [email protected]:

    Hm, that looks like py2.6:

    /usr/lib/python2.6/subprocess.py

    Tests pass for me using python 2.6.8, which is also what runs on Travis. Can you find out which python2.6 minor version runs on jenkins? It does not seem like 2.6.8 (from the line numbers).

    On Sat, Jun 15, 2013 at 10:41 AM, Tully Foote [email protected]:

    Good catch on the branch. I've fixed that: ros-infrastructure/buildfarm@
    c961354ros-infrastructure/buildfarm@c961354

    However that test is still present and failing.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/77#issuecomment-19493314
    .

  5. tfoote commented on Jun 17, 2013

    @tfoote
    ContributorAuthor

    The machine we're running on is stock lucid:

    >>> sys.version_info
    (2, 6, 5, 'final', 0)
    

    Right now the lucid version of stdeb is the only one which will successfully release with python 2.6 support which we need for other lucid machines. I guess we'll need to add that check. This test looks like it's protecting another test. Is there another test we need to filter as well?

  6. tkruse commented on Jun 17, 2013

    @tkruse
    Contributor

    Not sure what you mean by "protecting another test".
    As far as I can remember, the test itself makes sure unicode is properly
    treated when passed to the shell command and when being returned as a
    result of a shell command.
    The failure of the test in python 2.6.5 seems to merely reflect a unicode
    bug in that old python2.6 version.

    The test has no asserts, as if there was a bug, there'd be an exception of
    the kind we sadly observe with python 2.6.5. Asserts could be added to make
    sure any encoding / decoding does not alter content, but I was happy at the
    time to reach a state of no exceptions.

    Unless i am mistaken, all other tests passed, so no need to filter more
    than that.

    On Mon, Jun 17, 2013 at 7:35 PM, Tully Foote [email protected]:

    The machine we're running on is stock lucid:

    sys.version_info
    (2, 6, 5, 'final', 0)

    Right now the lucid version of stdeb is the only one which will
    successfully release with python 2.6 support which we need for other lucid
    machines. I guess we'll need to add that check. This test looks like it's
    protecting another test. Is there another test we need to filter as well?

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/77#issuecomment-19561068
    .

  7. cottsay commented on Dec 14, 2014

    @cottsay
    Contributor

    FYI, the stock python in RHEL 6 has this issue. I'm going to exclude this test in the official RPM for now, but it would be nice to see an official fix...

    --scott

  8. cottsay commented on Feb 12, 2019

    @cottsay
    Contributor

    Taking another look at this, it seems that this test is broken whenever Python 2 isn't configured to use something besides ASCII, which is in fact, the default encoding. It appears that Python 2.7 will use the system's LANG value to change to unicode, which is why this doesn't repro consistently on workstations vs minimalist build environments.

    On RHEL 7, which uses Python 2.7, I have to set LANG=en_US.UTF-8 to work around the bug. On Fedora, I can use the lighter weight LANG=C.UTF-8, but the locale really doesn't matter as long as the encoding is unicode. On RHEL 6, which uses Python 2.6, I know of no simple workaround.

    Maybe we should just skip the test if Python isn't configured to use Unicode by default, or maybe we should make the decoding lossy. I'm not sure. I'm really not even sure what the test is designed to look for - the ticket numbers from commits at that time don't appear to index into this repositories issues.

    Related to commit 1e49d1c.

  9. tkruse commented on Feb 14, 2019

    @tkruse
    Contributor

    I would also be fine with skipping the test for all python2 versions, if that helps.
    Possibly running tests with any hack to change the encoding such as described in https://stackoverflow.com/questions/2276200/changing-default-encoding-of-python would also work I guess.

  10. dirk-thomas commented on Jun 25, 2020

    @dirk-thomas
    Contributor

    Closing since the repository is about to be archived: see #166.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions