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

fix paths (and regex for paths) comparison issues #1592

Merged
merged 5 commits into from
Feb 5, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/test_rospy/test/unit/test_rospy_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def test_loggers(self):
base, ext = os.path.splitext(this_file)
if ext == '.pyc':
this_file = base + '.py'
if os.path.sep == '\\':
this_file = this_file.replace(os.path.sep, r'\\')
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it make more sense to re.escape(this_file)?

Same below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for sharing this with us! will change to use re.escape


try:
# hack to replace the stream handler with a debug version
Expand Down
1 change: 1 addition & 0 deletions tools/rosgraph/src/rosgraph/roslogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def findCaller(self, dummy=False): # Dummy second arg to match Python3 function
file name, line number, and function name with class name if possible.
"""
file_name, lineno, func_name = super(RospyLogger, self).findCaller()[:3]
file_name = os.path.normcase(file_name)

f = inspect.currentframe()
if f is not None:
Expand Down
3 changes: 3 additions & 0 deletions tools/rosgraph/test/test_roslogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def test_rosconsole__logging_format():
base, ext = os.path.splitext(this_file)
if ext == '.pyc':
this_file = base + '.py'

if os.path.sep == '\\':
this_file = this_file.replace(os.path.sep, r'\\')

for i, loc in enumerate(['module', 'function', 'method']):
if loc == 'module':
Expand Down