pattern3 / pattern

Goal: make Pattern compatible with Python 3.
http://www.clips.ua.ac.be/pages/pattern
BSD 3-Clause "New" or "Revised" License
59 stars 35 forks source link

Fix py3 imports and reduce vendorizing #6

Closed hayd closed 9 years ago

hayd commented 9 years ago

As discussed in #5 this (on the top of stage1):

For a taster of the most common remaining py3 errors:

 50 ValueError: dictionary update sequence element #0 has length 1; 2 is required
 36 TypeError: startswith first arg must be str or a tuple of str, not bytes
 18 RuntimeError: maximum recursion depth exceeded while getting the str of an object
 11 pattern.db.TableError: table 'pattern_unittest_db.persons' already exists
 11 AssertionError: False is not true
  9 TypeError: strip arg must be None or str
  8 TypeError: unhashable type: 'Node'
  8 ValueError: need more than 0 values to unpack
  8 RuntimeError: maximum recursion depth exceeded while calling a Python object
  5 IndexError: list index out of range
  5 AttributeError: type object 'str' has no attribute 'atoi'
  5 RuntimeError: maximum recursion depth exceeded
  4 ValueError: level must be >= 0
  3 TypeError: 'cmp' is an invalid keyword argument for this function
  3 TypeError: expected bytes, bytearray or buffer compatible object
  2 TypeError: Unicode-objects must be encoded before hashing
  2 TypeError: 'str' does not support the buffer interface
  2 TypeError: must use keyword argument for key function

All tests running seems like a rather large milestone.

hayd commented 9 years ago

Note: need to remove dependancies from setup.py packages (and clean up).

Edit: actually that's not the case, apparently I already removed them. I had another look at this and cleaned up setup - it's much simpler now - coming soon (once this is merged).

hayd commented 9 years ago

@waylonflinn I think I might merge this myself tomorrow, if you don't get a chance to look, so I can do some more fixes (if I have some time in the day).

hayd commented 9 years ago

If it does turn out this broke anything, I'm happy to look back at this myself.

The tests still pass (unchanged) so I'm fairly confident.