Skip to content

[introspector] failing when env is set by the user #203

Closed

Description

@stonier

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • crystal
  • DDS implementation:
    • default
  • Client library (if applicable):
    • n/a

Steps to reproduce issue

Add an env dict to the arguments for a node action and also call the introspector.

    launch_description = launch.LaunchDescription()
    launch_description.add_action(
        launch_ros.actions.Node(
            package='py_trees_ros_tutorials',
            node_name="one",
            node_executable="tree-data-gathering",
            output='screen',
            env={'PYTHONUNBUFFERED': '1'}
        )
    )
    print(launch.LaunchIntrospector().format_launch_description(launch_description))

Expected behavior

No errors.

Actual behavior

Traceback (most recent call last):
  File "/mnt/mervin/workspaces/crystal/py_trees/install/py_trees_ros_tutorials/lib/py_trees_ros_tutorials/tutorial-one-data-gathering", line 11, in <module>
    load_entry_point('py-trees-ros-tutorials', 'console_scripts', 'tutorial-one-data-gathering')()
  File "/mnt/mervin/workspaces/crystal/py_trees/build/py_trees_ros_tutorials/py_trees_ros_tutorials/one_data_gathering.py", line 123, in launch_main
    print(launch.LaunchIntrospector().format_launch_description(launch_description))
  File "/opt/ros/crystal/lib/python3.6/site-packages/launch/launch_introspector.py", line 134, in format_launch_description
    entity_descriptions = format_entities(launch_description.entities)
  File "/opt/ros/crystal/lib/python3.6/site-packages/launch/launch_introspector.py", line 74, in format_entities
    result.extend(format_action(cast(Action, entity)))
  File "/opt/ros/crystal/lib/python3.6/site-packages/launch/launch_introspector.py", line 114, in format_action
    for k, v in typed_action.env.items()]) + '}',
AttributeError: 'list' object has no attribute 'items'

Activity

  1. added
    bug
    help wanted
    good first issue
    on Mar 18, 2019
  2. wjwwood commented on Mar 18, 2019

    @wjwwood
    Member

    Yeah, looks like the custom logic for ExecuteProcess hasn't been updated. My intention was to enable automatic rendering of launch entities, so that the action specific custom code in launch introspector could be removed at some point.

  3. changed the title [-]Introspector failing when env is set by the user[/-] [+][introspector] failing when env is set by the user[/+] on Mar 18, 2019
  4. oswinso commented on Mar 26, 2019

    @oswinso
    Contributor

    Weird, because I can't reproduce the error on Ubuntu 18.04 on Master. I get the correct output:

    <launch.launch_description.LaunchDescription object at 0x7fdc7aa14240>
    └── ExecuteProcess(cmd=[ExecInPkg(pkg='py_trees_ros_tutorials', exec='tree-data-gathering'), LocalVar('node name')], cwd=None, env={'PYTHONUNBUFFERED': '1'}, shell=False)
    
  5. stonier commented on Mar 27, 2019

    @stonier
    ContributorAuthor

    Yes, also confirmed. Looks like 632ef1f#diff-970fc3c5d394ad33c14e4f9fe55288ceR113 bugfixed it, but this is applied post v0.7.3 which is the version that this bug was reported against. I've tested that one-line patch on the crystal release and verified it works without anything beyond that line.

  6. added a commit that references this issue on Mar 27, 2019
    31c201e
  7. added
    in review
    on Mar 27, 2019
  8. added a commit that references this issue on Mar 27, 2019
    7d4ec92
  9. nuclearsandwich commented on Mar 28, 2019

    @nuclearsandwich
    Member

    CI for the branch in #220.

    • Linux Build Status
    • Linux-aarch64 Build Status
    • macOS Build Status
    • Windows Build Status
  10. nuclearsandwich commented on Mar 28, 2019

    @nuclearsandwich
    Member

    The failures above are down to #169 not being backported. We've ignored them previously because launch wasn't being included in the patch release.

  11. self-assigned this
    on Mar 29, 2019
  12. wjwwood commented on Mar 29, 2019

    @wjwwood
    Member

    So we need to backport #169 as well @nuclearsandwich?

  13. wjwwood commented on Mar 30, 2019

    @wjwwood
    Member

    I backported #169 speculatively.

  14. added 2 commits that reference this issue on Mar 30, 2019
    1b606dd
    36f47cf
  15. wjwwood commented on Apr 2, 2019

    @wjwwood
    Member

    I'm going to close this since it's fixed on master and it is staged for backport into Crystal as well.

  16. removed
    in review
    on Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issuehelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions