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

Python bindings: various segfaults, should raise exception instead #5989

Open
19 tasks done
AllSeeingEyeTolledEweSew opened this issue Feb 18, 2021 · 0 comments
Open
19 tasks done
Milestone

Comments

@AllSeeingEyeTolledEweSew
Copy link
Contributor

AllSeeingEyeTolledEweSew commented Feb 18, 2021

The following code snippets cause segfaults. Segfaults shouldn't ever happen in python.

  • fs = file_storage(); fs.at(0): should raise IndexError
  • fs = file_storage(); fs.at(-1): should raise IndexError
  • fs = file_storage(); fs.symlink(0): should raise IndexError
  • fs = file_storage(); fs.symlink(-1): should raise IndexError
  • fs = file_storage(); fs.file_path(0): should raise IndexError
  • fs = file_storage(); fs.file_path(-1): should raise IndexError
  • fs = file_storage(); fs.file_name(0): should raise IndexError
  • fs = file_storage(); fs.file_name(-1): should raise IndexError
  • fs = file_storage(); fs.file_offset(0): should raise IndexError
  • fs = file_storage(); fs.file_offset(-1): should raise IndexError
  • fs = file_storage(); fs.file_flags(0): should raise IndexError
  • fs = file_storage(); fs.file_flags(-1): should raise IndexError
  • fs = file_storage(); fs.rename_file(0, "file.txt"): should raise IndexError
  • fs = file_storage(); fs.rename_file(-1, "file.txt"): should raise IndexError
  • fs = file_storage(); ct = create_torrent(fs); ct.set_hash(0, b"a" * 20): should raise IndexError
  • fs = file_storage(); ct = create_torrent(fs); ct.set_hash(-1, b"a" * 20): should raise IndexError
  • fs = file_storage(); ct = create_torrent(fs); ct.set_file_hash(0, b"a" * 20): should raise IndexError
  • fs = file_storage(); ct = create_torrent(fs); ct.set_file_hash(-1, b"a" * 20): should raise IndexError
  • session.add_torrent(torrent_info, any_arg=1): should raise TypeError
    • (for some reason it seems possible to invoke the deprecated form add_torrent(torrent_info, str, resume_data=..., storage_mode=..., paused=...), without the str positional arg)

I'm finished writing new unit tests and won't add any more items to this issue.

@arvidn arvidn added this to the 1.2.14 milestone Apr 8, 2021
@arvidn arvidn modified the milestones: 1.2.14, 1.2.15 Jun 7, 2021
@arvidn arvidn modified the milestones: 1.2.15, 1.2.16 Dec 27, 2021
@arvidn arvidn modified the milestones: 1.2.16, 1.2.17 Apr 17, 2022
@arvidn arvidn modified the milestones: 1.2.17, 1.2.19 Apr 10, 2023
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

2 participants