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

"Unexplained problem" while patching #3

Open
JoeyGH opened this issue Apr 13, 2014 · 1 comment
Open

"Unexplained problem" while patching #3

JoeyGH opened this issue Apr 13, 2014 · 1 comment

Comments

@JoeyGH
Copy link

JoeyGH commented Apr 13, 2014

I have two files:

OldFile.txt with content:

Text.

NewFile.txt with content:

New text.
Text.

Then I run the example provided in readme:

import librsync

dst = file('OldFile.txt', 'rb')
src = file('NewFile.txt', 'rb')
synced = file('Synced.txt', 'wb')

signature = librsync.signature(dst)
delta = librsync.delta(src, signature)
librsync.patch(dst, delta, synced)

And get the following error:

Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 314, in 'calling callback function'
TypeError: read_cb() takes exactly 3 arguments (4 given)
python: ERROR: (rs_job_complete) patch job failed: unexplained problem
Traceback (most recent call last):
  File "RsyncTest.py", line 12, in <module>
    librsync.patch(dst, delta, synced)
  File "/usr/local/lib/python2.7/dist-packages/librsync/__init__.py", line 113, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/librsync/__init__.py", line 228, in patch
    _execute(job, d, o)
  File "/usr/local/lib/python2.7/dist-packages/librsync/__init__.py", line 141, in _execute
    raise LibrsyncError(r)
librsync.LibrsyncError: unexplained problem

I tried syncing many different files and all went well, but this one case just won't work.

btimby added a commit that referenced this issue Apr 15, 2014
@btimby
Copy link
Contributor

btimby commented Apr 15, 2014

I added a unit test with your data files. I fixed the unexplained problem which was that the read callback did not match the expected function signature. The first opaque parameter was missing.

The test case still fails as the data being read by the callback is not properly returned. There is a stray pointer, the buffer is the correct length, but is seemingly random data.

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