Skip to content

TypeError: object of type 'map' has no len() #24

@pmsmall

Description

@pmsmall

File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 736, in from_path
return point_cloud_from_path(fname)
File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 303, in point_cloud_from_path
pc = point_cloud_from_fileobj(f)
File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 296, in point_cloud_from_fileobj
return PointCloud(metadata, pc_data)
File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 671, in init
self.check_sanity()
File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 683, in check_sanity
assert(_metadata_is_consistent(md))
File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 177, in _metadata_is_consistent
if not check(metadata):
File "/usr/local/lib/python3.5/dist-packages/pypcd/pypcd.py", line 162, in
checks.append((lambda m: len((m['type'])) == len((m['count'])) ==
TypeError: object of type 'map' has no len()

In python 3, map has no len()

162 checks.append((lambda m: len(m['type']) == len(m['count']) ==
163 len(m['fields']),

Add a list() to resolve the problems?

162 checks.append((lambda m: len(list(m['type'])) == len(list(m['count'])) ==
163 len(list(m['fields'])),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions