Package install omits required package data file 'irc/codes.txt'

Open Beginner friendly
#245 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
build-system

Research direction

The crash starts in irc/events.py at line 68, where _codes is read via lines_from, and irc/tests/test_bot.py reproduces it. Check how the build declares package data in the project's packaging configuration, so that irc/codes.txt ends up in the built package. Done when a freshly built wheel contains irc/codes.txt and the test module imports and runs.

Written by the indexing model from the issue text.

Description

The 'irc/codes.txt' file is not installed to the package. This results in a crash when the library attempts to read this package data file.

For example, the test suite fails:

$ python3 -m pytest irc/tests/test_bot.py
============================= test session starts ==============================
[…]
==================================== ERRORS ====================================
_________________________ ERROR collecting irc/bot.py __________________________
irc/bot.py:16: in <module>
    import irc.client
irc/client.py:72: in <module>
    from . import connection, ctcp, events, features, message, schedule
irc/events.py:68: in <module>
    numeric = {code.code: code for code in _codes}
                                           ^^^^^^
/usr/lib/python3/dist-packages/jaraco/text/__init__.py:643: in lines_from
    with input.open(encoding='utf-8') as stream:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.14/pathlib/__init__.py:772: in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   FileNotFoundError: [Errno 2] No such file or directory: '/build/reproducible-path/python-irc-20.5.0+dfsg1/.pybuild/cpython3_3.14_irc/build/irc/codes.txt'
[…]
Dominant language
Python
Stars
422
Forks
91
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jaraco/irc

All issues in jaraco/irc

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.