Didn't aware of string.join and os.path.join
See original GitHub issueIssue Description
$ python3 examples/build_cfg.py /home/user/code-coba-home/manual-compile/staticfg/foo.py /home/user/code-coba-home/manual-compile/staticfg/
Traceback (most recent call last):
File "examples/build_cfg.py", line 15, in <module>
cfg = CFGBuilder().build_from_file(cfg_name, args.input_file)
File "/home/user/.virtualenvs/global_py3/lib/python3.5/site-packages/staticfg/builder.py", line 124, in build_from_file
return self.build_from_src(name, src)
File "/home/user/.virtualenvs/global_py3/lib/python3.5/site-packages/staticfg/builder.py", line 108, in build_from_src
return self.build(name, tree)
File "/home/user/.virtualenvs/global_py3/lib/python3.5/site-packages/staticfg/builder.py", line 92, in build
self.visit(tree)
File "/usr/lib/python3.5/ast.py", line 245, in visit
return visitor(node)
File "/usr/lib/python3.5/ast.py", line 253, in generic_visit
self.visit(item)
File "/usr/lib/python3.5/ast.py", line 245, in visit
return visitor(node)
File "/home/user/.virtualenvs/global_py3/lib/python3.5/site-packages/staticfg/builder.py", line 384, in visit_FunctionDef
self.new_functionCFG(node, asynchr=False)
File "/home/user/.virtualenvs/global_py3/lib/python3.5/site-packages/staticfg/builder.py", line 201, in new_functionCFG
self.current_id)
File "/home/user/.virtualenvs/global_py3/lib/python3.5/site-packages/staticfg/builder.py", line 92, in build
self.visit(tree)
File "/usr/lib/python3.5/ast.py", line 245, in visit
return visitor(node)
File "/usr/lib/python3.5/ast.py", line 253, in generic_visit
self.visit(item)
File "/usr/lib/python3.5/ast.py", line 245, in visit
return visitor(node)
File "/home/user/.virtualenvs/global_py3/lib/python3.5/site-packages/staticfg/builder.py", line 310, in visit_If
self.visit(child)
File "/usr/lib/python3.5/ast.py", line 245, in visit
return visitor(node)
File "/home/user/.virtualenvs/global_py3/lib/python3.5/site-packages/staticfg/builder.py", line 264, in visit_Assign
self.generic_visit(node)
File "/usr/lib/python3.5/ast.py", line 255, in generic_visit
self.visit(value)
File "/usr/lib/python3.5/ast.py", line 245, in visit
return visitor(node)
File "/home/user/.virtualenvs/global_py3/lib/python3.5/site-packages/staticfg/builder.py", line 259, in visit_Call
func_name = visit_func(func)
File "/home/user/.virtualenvs/global_py3/lib/python3.5/site-packages/staticfg/builder.py", line 255, in visit_func
func_name += "." + node.attr
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Why doesn't os.path.join() work in this case? - Stack Overflow
On Windows, the drive letter is not reset when an absolute path component (e.g., r'\foo' ) is encountered. If a component contains a...
Read more >os.path — Common pathname manipulations — Python 3.11 ...
In all cases, join(head, tail) returns a path to the same location as path (but the strings may differ). Also see the functions...
Read more >Python 3's pathlib Module: Taming the File System
For instance, instead of joining two paths with + like regular strings, you should use os.path.join() , which joins paths using the correct...
Read more >Python Files and os.path - 2021 - BogoToBogo
The os.path.join() function constructs a pathname out of one or more partial pathnames. In this case, it simply concatenates strings.
Read more >I am looking for a library of built in functions for ... - Codecademy
I can't find .join function on http://docs.python.org/ ... what you wanted was str.join, not string.join.. wasn't even aware they both existed until now...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @azzamsa I found the origin of my problem, I reported in #8
@JJK96 Since I just have a small code. I tried to compile them incrementally, till I find the error. (not effective for a big chunk of code)