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

Replace deprecated method in csv2rdf #2901

Merged
merged 2 commits into from
Sep 1, 2024
Merged

Conversation

ageorgou
Copy link
Contributor

@ageorgou ageorgou commented Sep 1, 2024

Summary of changes

Fixes #2618.

The code for tne csv2rdf command-line tool calls ConfigParser.readfp, which has been deprecated for a while and has been removed in Python 3.12. The read_file method is a straightforward replacement.

I have checked manually that the old and new version give the same result for a sample config file.

I've also taken the opportunity to add another small test, since the coverage for that tool is quite low. The new test doesn't check that the contents of the config file are processed correctly, only that it is opened.

Checklist

  • Checked that there aren't other open pull requests for
    the same change.
  • Checked that all tests and type checking passes.
  • If the change has a potential impact on users of this project:
    • No change besides future-proofing.
  • Considered granting push permissions to the PR branch,
    so maintainers can fix minor issues and keep your PR up to date.

ConfigParser.readfp has been deprecated since Python 3.2 and is
removed in 3.12.
@coveralls
Copy link

Coverage Status

coverage: 90.651% (+0.02%) from 90.628%
when pulling 290d766 on ageorgou:csv2rdf-fix
into 0a0d4b6 on RDFLib:main.

@ashleysommer
Copy link
Contributor

@ageorgou
Thank you for this fix.

@ashleysommer ashleysommer merged commit 65cd211 into RDFLib:main Sep 1, 2024
22 checks passed
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

Successfully merging this pull request may close these issues.

csv2rdf cannot parse config file
3 participants