[Xapian-tickets] [Xapian] #346: Python 3 support
Xapian
nobody at xapian.org
Mon May 25 13:30:47 BST 2009
#346: Python 3 support
-----------------------------+----------------------------------------------
Reporter: olly | Owner: richard
Type: defect | Status: new
Priority: normal | Milestone: 1.1.2
Component: Xapian-bindings | Version: SVN trunk
Severity: normal | Keywords:
Blockedby: | Platform: All
Blocking: |
-----------------------------+----------------------------------------------
Comment(by kelm):
With the attached patch I am able to run (most of) the testsuite
successfully. This is the output from running it on Windows, MSVC 9.0:
{{{
------ Build started: Project: xapian_python.mak, Configuration: Debug
Win32 ------
Performing Makefile project actions
...snip...
"c:\Program Files\Python30\python_d.exe" smoketest.py
Running test: all... ok
c:\Users\kelmpte\My Documents\projects\dev\xapian-12765\xapian-
core\win32\Debug\Python30\testsuite3.py:115: DeprecationWarning:
object.__new__() takes no parameters
callable(*args)
1 tests passed, no failures
[50288 refs]
"c:\Program Files\Python30\python_d.exe" pythontest.py
Running test: allterms_iter... ok
Running test: dbdocument_iter... ok
Running test: director_exception... ok
Running test: eset_iter... ok
Running test: exception_base... ok
Running test: get_uuid... ok
Running test: matchingterms_iter... ok
Running test: metadata_keys_iter... ok
Running test: mset_iter... ok
Running test: newdocument_iter... ok
Running test: position_iter... ok
Running test: postinglist_iter... ok
Running test: postingsource... FAILED
pythontest3.py:981:<class 'TypeError'>: Swig director type mismatch in
output value of type 'Xapian::doccount'
979
980 enquire = mkenq(db)
-> 981 mset = enquire.get_mset(0, 10)
982
983 expect([item.docid for item in mset], [1, 3, 5, 7, 9])
Traceback (most recent call last):
File "c:\Users\kelmpte\My Documents\projects\dev\xapian-12765\xapian-
core\win32\Debug\Python30\testsuite3.py", line 202, in runtest
test_fn()
File "c:\Users\kelmpte\My Documents\projects\dev\xapian-12765\xapian-
core\win32\Debug\Python30\pythontest3.py", line 981, in test_postingsource
mset = enquire.get_mset(0, 10)
Xapian version: 1.1.0
Platform: Windows XP (5.1.2600)
When reporting this problem, please quote all the preceding lines from
"pythontest3.py:981" onwards.
Running test: postingsource2... FAILED
pythontest3.py:997:<class 'UnicodeDecodeError'>: 'utf8' codec can't decode
byte 0xaa in position 0: unexpected code byte
995 for id in range(10):
996 doc = xapian.Document()
-> 997 doc.add_value(1, xapian.sortable_serialise(vals[id]))
998 db.add_document(doc)
999
Traceback (most recent call last):
File "c:\Users\kelmpte\My Documents\projects\dev\xapian-12765\xapian-
core\win32\Debug\Python30\testsuite3.py", line 202, in runtest
test_fn()
File "c:\Users\kelmpte\My Documents\projects\dev\xapian-12765\xapian-
core\win32\Debug\Python30\pythontest3.py", line 997, in
test_postingsource2
doc.add_value(1, xapian.sortable_serialise(vals[id]))
Xapian version: 1.1.0
Platform: Windows XP (5.1.2600)
When reporting this problem, please quote all the preceding lines from
"pythontest3.py:997" onwards.
Running test: preserve_enquire_sorter... ok
Running test: preserve_query_parser_stopper... ok
Running test: preserve_term_generator_stopper... ok
Running test: queryparser_custom_vrp... ok
Running test: queryparser_custom_vrp_deallocation... ok
Running test: queryparser_stoplist_iter... ok
Running test: queryparser_unstem_iter... ok
Running test: queryterms_iter... ok
Running test: scale_weight... ok
Running test: serialise_document... ok
Running test: serialise_query... ok
Running test: spell... ok
Running test: synonyms_iter... ok
Running test: termlist_iter... ok
Running test: value_iter... ok
Running test: value_mods... ok
Running test: value_stats... FAILED
pythontest3.py:1023:<class 'UnicodeDecodeError'>: 'utf8' codec can't
decode byte 0xaa in position 0: unexpected code byte
1021 for id in range(10):
1022 doc = xapian.Document()
->1023 doc.add_value(1, xapian.sortable_serialise(vals[id]))
1024 db.add_document(doc)
1025
Traceback (most recent call last):
File "c:\Users\kelmpte\My Documents\projects\dev\xapian-12765\xapian-
core\win32\Debug\Python30\testsuite3.py", line 202, in runtest
test_fn()
File "c:\Users\kelmpte\My Documents\projects\dev\xapian-12765\xapian-
core\win32\Debug\Python30\pythontest3.py", line 1023, in test_value_stats
doc.add_value(1, xapian.sortable_serialise(vals[id]))
Xapian version: 1.1.0
Platform: Windows XP (5.1.2600)
When reporting this problem, please quote all the preceding lines from
"pythontest3.py:1023" onwards.
Running test: valuesetmatchdecider... ok
Running test: weight_normalise... ok
c:\Users\kelmpte\My Documents\projects\dev\xapian-12765\xapian-
core\win32\Debug\Python30\xapian.py:4879: DeprecationWarning:
object.__new__() takes no parameters
self._termfreq = self._iter._iter.get_termfreq()
c:\Users\kelmpte\My Documents\projects\dev\xapian-12765\xapian-
core\win32\Debug\Python30\xapian.py:3414: DeprecationWarning:
object.__new__() takes no parameters
_xapian.Query_swiginit(self,_xapian.new_Query(*args))
c:\Users\kelmpte\My Documents\projects\dev\xapian-12765\xapian-
core\win32\Debug\Python30\pythontest3.py:1097: DeprecationWarning:
object.__new__() takes no parameters
val = db.get_document(docid).get_value(1)
30 tests passed, 3 tests failed
[54773 refs]
NMAKE : fatal error U1077: '"c:\Program Files\Python30\python_d.exe"' :
return code '0x1'
Stop.
Project : error PRJ0019: A tool returned an error code from "Performing
Makefile project actions"
Build log was saved at "file://C:\Users\kelmpte\My
Documents\projects\dev\xapian-12765\xapian-
core\win32\Debug\Python30\BuildLog.htm"
xapian_python.mak - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========
}}}
Unfortunately I haven't had a chance to look into the remaining errors.
The sortable_serialise related error seems to stem from improper unicode
handling. Patch against svn trunk 12765.
--
Ticket URL: <http://trac.xapian.org/ticket/346#comment:6>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list