Skip to content

Script error #4

Description

@ViperelB

while parsing a wiki i get this error in the terminal:

Traceback (most recent call last):
File "/home/kali/wikiraider/wikiraider.py", line 143, in
main()
File "/home/kali/wikiraider/wikiraider.py", line 139, in main
ActionParse(args).run()
File "/home/kali/wikiraider/wikiraider/actions/ActionParse.py", line 105, in run
self.on_finish()
File "/home/kali/wikiraider/wikiraider/actions/ActionParse.py", line 124, in on_finish
colorlog.getLogger().info('Here are 10 of them {}.'.format(random.sample(self.queue.results, 10)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/random.py", line 439, in sample
raise TypeError("Population must be a sequence. "
TypeError: Population must be a sequence. For dicts or sets, use sorted(d).

I fixed it myself by changing that line 124
original:
colorlog.getLogger().info('Here are 10 of them {}.'.format(random.sample(self.queue.results, 10)))
edited:
colorlog.getLogger().info('Here are 10 of them {}.'.format(random.sample(list(self.queue.results), 10)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions