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

module 'collections' has no attribute 'Mapping' #104

Open
freedom1b2830 opened this issue May 27, 2022 · 8 comments
Open

module 'collections' has no attribute 'Mapping' #104

freedom1b2830 opened this issue May 27, 2022 · 8 comments

Comments

@freedom1b2830
Copy link

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

@0xSysR3ll
Copy link

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

0xSysR3ll added a commit to 0xSysR3ll/tplmap that referenced this issue Jul 25, 2022
@ndsecc
Copy link

ndsecc commented Nov 26, 2022

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

@ndsecc
Copy link

ndsecc commented Nov 26, 2022

For python 3.10 it's:
from collections import Mapping

@man3kin3ko
Copy link

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

@abdulx01
Copy link

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;

@inzel
Copy link

inzel commented Sep 27, 2023

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

@r-erd
Copy link

r-erd commented Nov 28, 2023

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.

@hhhhhhhds6
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants