https://issues.apache.org/ooo/show_bug.cgi?id=121496

--- Comment #1 from hanya <[email protected]> ---
Created attachment 80033
  --> https://issues.apache.org/ooo/attachment.cgi?id=80033&action=edit
Patch to add Python3 support

This patch contains modifications from my fork[1] for Python3 except for 
hasModule function.
Summary of patch: 
- Use unicode as string but bytes is not allowed for method argument anymore. 
  For example, uno.getTypeByName(b"long") is not allowed, it should be 
  uno.getTypeByName("long") (for 3.0-) or u"long" (3.3-).
  In my opinion, bytes is no longer string but it is for IO byte sequence.
- getPyUnoClass method does not have any parameters. I met the problem with it 
  in module initialization. When I use Runtime class in the PyInit_pyuno
function, 
  pyuno crashes that build as standalone. I simply removed it because of the 
  parameter is not used.
- int type is gone, but bool type should be treated as different type in
pyObject2Any function.
- getattrfunc and setattrfunc are deprecated to use in custom type definition. 
  They should be replaced with getattrofunc and setattrofunc.
- cmpfunc is also deprecated, should be replaced with richcompare.
- no __members__ and __methods__ attributes, they should be replaced with
__dir__.
- uno.ByteSequence class should allow bytes and bytearray on Python3 but not
unicode.

Just in my opinion, uno.ByteSequence should be replaced with bytes and
bytearray. 
It was implemented to separate string and byte sequence but we have them as 
separated in Python3.
And uno.Bool should be removed now, it has been deprecated several years.


[1]
https://github.com/hanya/pyuno3/commit/801ad6c9e1ee6b059a50e602bfe8b7a453f61a84

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

Reply via email to