PyFunceble icon indicating copy to clipboard operation
PyFunceble copied to clipboard

BUG | target="_blank Bug

Open ryanbr opened this issue 10 months ago • 2 comments

What is the problem you are experiencing?

Exits when scanning

How can we reproduce the problem?

To reproduce the problem:

  1. docker run -it pyfunceble/pyfunceble --cooldown 3 --color --aggressive --adblock -f https://raw.githubusercontent.com/easylist/easylist/refs/heads/master/easylist/easylist_specific_hide.txt > el-specic-hide.txt > somefile.txt
  2. nea

Do you have a screenshot?

Fatal Error: 'target="_blank' does not appear to be an IPv4 or IPv6 address
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/PyFunceble/cli/system/launcher.py", line 1118, in start
    self.fill_to_test_queue_from_protocol()
  File "/usr/local/lib/python3.12/site-packages/PyFunceble/cli/system/launcher.py", line 719, in fill_to_test_queue_from_protocol
    handle_file(protocol)
  File "/usr/local/lib/python3.12/site-packages/PyFunceble/cli/system/launcher.py", line 594, in handle_file
    for subject in get_subjects_from_line(
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyFunceble/cli/utils/testing.py", line 284, in get_subjects_from_line
    netloc = url2netloc.set_data_to_convert(subject).get_converted()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyFunceble/converter/url2netloc.py", line 120, in get_converted
    self.parse_url()
  File "/usr/local/lib/python3.12/site-packages/PyFunceble/converter/url2netloc.py", line 110, in parse_url
    self.parsed_url = self.parse_single_url(self.data_to_convert)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/PyFunceble/converter/url2netloc.py", line 102, in parse_single_url
    return urllib.parse.urlparse(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/parse.py", line 395, in urlparse
    splitresult = urlsplit(url, scheme, allow_fragments)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/parse.py", line 500, in urlsplit
    _check_bracketed_host(bracketed_host)
  File "/usr/local/lib/python3.12/urllib/parse.py", line 446, in _check_bracketed_host
    ip = ipaddress.ip_address(hostname) # Throws Value Error if not IPv6 or IPv4
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/ipaddress.py", line 54, in ip_address
    raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6 address')
ValueError: 'target="_blank' does not appear to be an IPv4 or IPv6 address

What did you expect to happen?

I expected that... let me scan

Is there a workaround?

I found a workaround... not yet

How did you configure PyFunceble?

.PyFunceble.overwrite.yaml

# Your configuration here

Which Operating System did you use?

Windows 11

Which Python Version did you use?

No response

Which PyFunceble Version did you use?

No response

Additional context

I would like to add...

ryanbr avatar Mar 12 '25 00:03 ryanbr

@ryanbr , thank you for your patience. Q1 ist kinda crazy - professionally.

I'm reopening this because it has not been deployed in your usage scope yet.

I'm deploying the patch in pyfunceble-dev (pyfunceble/pyfunceble-dev for you). In a few days, I plan to merge this (among others) into the master (pyfunceble/pyfunceble for you) branch.

funilrys avatar Mar 19 '25 22:03 funilrys

Fixed, Thanks

Though using the same syntax using -dev exits when processing easylist_specific_hide.txt. Ran twice and both exits around the same place.

^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0mkayak.                                                                                               INVALID     SYNTAX    ^[[0m
^[[0m

Status      Percentage   Amount
----------- ------------ ------------^[[0m
^[[0mACTIVE      99%          12849       ^[[0m
^[[0mINACTIVE    0%           24          ^[[0m
^[[0mINVALID     1%           152         ^[[0m
^[[0m
    ██████╗ ██╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗███████╗██████╗ ██╗     ███████╗
    ██╔══██╗╚██╗ ██╔╝██╔════╝██║   ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██║     ██╔════╝
    ██████╔╝ ╚████╔╝ █████╗  ██║   ██║██╔██╗ ██║██║     █████╗  ██████╔╝██║     █████╗
    ██╔═══╝   ╚██╔╝  ██╔══╝  ██║   ██║██║╚██╗██║██║     ██╔══╝  ██╔══██╗██║     ██╔══╝
    ██║        ██║   ██║     ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
    ╚═╝        ╚═╝   ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
    ^[[0m
^[[0m
Thank you for using PyFunceble!^[[0m
^[[0m^[[0m

ryanbr avatar Mar 29 '25 00:03 ryanbr

Hey @ryanbr,

Can you confirm that this issue is gone? I couldn't reproduce with both pyfunceble/pyfunceble and pyfunceble/pyfunceble-dev.

funilrys avatar Aug 18 '25 19:08 funilrys