Ticket #195 (closed defect: fixed)

Opened 2 months ago

Last modified 8 weeks ago

Error when using ptrepack on other leaves than Table

Reported by: faltet Owned by: somebody
Priority: major Component: PyTables
Version: trunk Keywords:
Cc:

Description

Here it is the error that appears when copying an EArray, for example:

$ PYTHONPATH=. python utils/ptrepack /tmp/test.h5:/a /tmp/test4.h5:/b
Problems doing the copy from '/tmp/test.h5:/a' to '/tmp/test4.h5:/b'
The error was --> <type 'exceptions.TypeError'>: _g_copyWithStats() got an unexpected keyword argument 'propindexes'

This reveals how weak is the testing procedure of the ptrepack utility. I should improve this aspect.

Change History

Changed 2 months ago by faltet

  • status changed from new to closed
  • resolution set to fixed

This has been fixed in r3893. I don't like the fix too much because trusting in Leaf.__class__.__name__ == "Table" is not safe, for example, for Table class descendants. But as it is highly unlikely that such a descendent would be included soon, that will be enough for now.

Changed 2 months ago by ivilata

I don't like it either, since it gives a superclass (Leaf) knowledge about a subclass (Table). Since Leaf._g_copy() accepts **kwargs and in the original code they were passed to _g_copyWithStats() right away, it may be better to actually include a **kwargs argument to all definitions of the method. This would imply that unknown parameters would be simply ignored by leaves (and propagated by groups), which should be documented.

Changed 8 weeks ago by faltet

Well, I think you are right. Fixed in r3905 (std-trunk) and r3906 (pro-trunk).

Note: See TracTickets for help on using tickets.