Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[switchbot_ros]force to use python3 for lambda string sort #495

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

mqcmd196
Copy link
Member

Current code dies with python UnicodeEncodeError

[switchbot_ros-1] restarting process
process[switchbot_ros-1]: started with pid [9793]
[INFO] [WallTime: 1698028051.518458] [node:/switchbot_ros] [func:SwitchBotAction.get_switchbot_client]: Switchbot API Client initialized.
Traceback (most recent call last):
  File "/home/fetch/ros/melodic/src/jsk-ros-pkg/jsk_3rdparty/switchbot_ros/scripts/switchbot_ros_server.py", line 121, in <module>
    server = SwitchBotAction()
  File "/home/fetch/ros/melodic/src/jsk-ros-pkg/jsk_3rdparty/switchbot_ros/scripts/switchbot_ros_server.py", line 31, in __init__
    self.print_devices()
  File "/home/fetch/ros/melodic/src/jsk-ros-pkg/jsk_3rdparty/switchbot_ros/scripts/switchbot_ros_server.py", line 66, in print_devices
    key=lambda device: str(device['deviceName']))
  File "/home/fetch/ros/melodic/src/jsk-ros-pkg/jsk_3rdparty/switchbot_ros/scripts/switchbot_ros_server.py", line 66, in <lambda>
    key=lambda device: str(device['deviceName']))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)
[switchbot_ros-1] process has died [pid 9793, exit code 1, cmd /home/fetch/ros/melodic/src/jsk-ros-pkg/jsk_3rdparty/switchbot_ros/scripts/switchbot_ros_server.py __name:=switchbot_ros __log:=/home/fetch/.ros/log/cb16f396-7146-11ee-827c-c9d2ce386b33/switchbot_ros-1.log].
log file: /home/fetch/.ros/log/cb16f396-7146-11ee-827c-c9d2ce386b33/switchbot_ros-1*.log

This PR forces to use python3

@mqcmd196 mqcmd196 added the hacktoberfest-accepted https://hacktoberfest.digitalocean.com/hacktoberfest-update label Oct 23, 2023
@mqcmd196
Copy link
Member Author

The PR is tested on real robot (Fetch1075: melodic) and my PC (noetic)

@mqcmd196
Copy link
Member Author

mqcmd196 commented Oct 23, 2023

If this PR is merged, I will handle #491 rebasing this PR

switchbot_ros/package.xml Outdated Show resolved Hide resolved
@sktometometo
Copy link
Contributor

Great PR! I have left a comment.

Copy link
Member

@tkmtnt7000 tkmtnt7000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late. LGTM.

@k-okada k-okada added the MergeOK label Nov 7, 2023
@k-okada k-okada merged commit 546a5c2 into jsk-ros-pkg:master Nov 9, 2023
12 checks passed
@mqcmd196 mqcmd196 deleted the PR/switchbot_ros_python3 branch November 11, 2023 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted https://hacktoberfest.digitalocean.com/hacktoberfest-update MergeOK switchbot_ros
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants