MarketSquare / MarketSquare/robotframework-sherlock

Script module.py raises ValueError in line 178

Open
#94 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
14
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Typing command sherlock --output output.xml . in my local repository causes occurance of such a fault:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\suchanek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Scripts\sherlock.e
xe\__main__.py", line 7, in
File "C:\Users\suchanek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sher
lock\__init__.py", line 19, in run_cli
raise err
File "C:\Users\suchanek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sher
lock\__init__.py", line 9, in run_cli
runner.run()
File "C:\Users\suchanek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sher
lock\core.py", line 31, in run
tree = self.map_resources_for_path(root)
File "C:\Users\suchanek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sher
lock\core.py", line 58, in map_resources_for_path
tree = Tree.from_directory(path=root, gitignore=self.config.default_gitignore)
File "C:\Users\suchanek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sher
lock\model.py", line 346, in from_directory
child_tree = cls.from_directory(path=child, gitignore=gitignore)
File "C:\Users\suchanek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sher
lock\model.py", line 346, in from_directory
child_tree = cls.from_directory(path=child, gitignore=gitignore)
File "C:\Users\suchanek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sher
lock\model.py", line 346, in from_directory
child_tree = cls.from_directory(path=child, gitignore=gitignore)
[Previous line repeated 5 more times]
File "C:\Users\suchanek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sher
lock\model.py", line 359, in from_directory
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\ast.py", line 279, in generic_visit
self.visit(item)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\ast.py", line 271, in visit
return visitor(node)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\ast.py", line 279, in generic_visit
self.visit(item)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\ast.py", line 271, in visit
return visitor(node)
File "C:\Users\suchanek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sher
lock\model.py", line 172, in visit_Variable
self.variables[node.name] = self.set_dict(node.value)
File "C:\Users\suchanek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sher
lock\model.py", line 178, in set_dict
key, val = value.split("=") if "=" in value else (value, "")
ValueError: too many values to unpack (expected 2)

My output.xml file has been loaded properly and sherlock gave me two logs:
Sherlock analysis of Robot Framework code:

Using C:\Users\suchanek\robotlte as source repository
Loaded C:\Users\suchanek\robotlte\output.xml output file

My output.xml file looks like that:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with `sherlock --output output.xml .`, then read `sherlock/core.py` and `sherlock/model.py`, especially `Tree.from_directory` and `set_dict` at line 178. Check how the Robot Framework repository is traversed and how values containing `=` are handled; done means the command completes without this ValueError and processes the repository output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.