Skip to content

"Unexplained problem" while patching #3

Open

Description

@JoeyGH

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.

Activity

  1. added a commit that references this issue on Apr 15, 2014
  2. btimby commented on Apr 15, 2014

    @btimby
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions