tplmap
tplmap copied to clipboard
module 'collections' has no attribute 'Mapping'
any pages
error msg:
Testing if GET parameter 'id' is injectable
Exiting: module 'collections' has no attribute 'Mapping'
versions:
Tplmap 0.5 616b0e5
#!/usr/bin/env python
->Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] on linux
os distr: ArchLinux
Hello,
The error comes from this import in core/plugin.py
:
import collections
In fact, since python3.3, this method to import Mapping
is deprecated.
It should be :
from collections.abc import Mapping
I will make a pull request to fix this but you can fix this issue 😄
Br,
0xSysr3ll
After your defined change it says:
Tplmap 0.5 Automatic Server-Side Template Injection Detection and Exploitation Tool
Testing if GET parameter 'name' is injectable Exiting: name 'collections' is not defined
For python 3.10 it's:
from collections import Mapping
For those who is little confused like me, you should not just add from collections import Mapping
, but replace collections.Mapping
with Mapping
at lines 21 and 22 in the core/plugin.py
Hello,
The error comes from this import in
core/plugin.py
:import collections
In fact, since python3.3, this method to import
Mapping
is deprecated.It should be :
from collections.abc import Mapping
I will make a pull request to fix this but you can fix this issue 😄
Br,
0xSysr3ll
After changing the collection library to: from collections import Mapping
there is another issue is arising.
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
Help me;
Hello, The error comes from this import in
core/plugin.py
:import collections
In fact, since python3.3, this method to import
Mapping
is deprecated. It should be :from collections.abc import Mapping
I will make a pull request to fix this but you can fix this issue 😄 Br, 0xSysr3ll
After changing the collection library to:
from collections import Mapping
there is another issue is arising.ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
Help me;
You probably need to change it from from collections import Mapping
to from collections.abc import Mapping
I just encountered this issue and resolved it by replacing the import with import collections.abc
and also replacing the references in lines 21 and 22 in core/plugin.py
with collections.abc.Mapping
instead of collections.Mapping
.
hello the solution is go to core/plugin.py and change "import collections" to "import collections.abc" then down in line 21 22 change collections.abc.Mapping instead of collections.Mapping.