Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DISCUSSION] Py3k simple #114

Closed
wants to merge 12 commits into from
Closed

[DISCUSSION] Py3k simple #114

wants to merge 12 commits into from

Conversation

zuphilip
Copy link
Collaborator

@zuphilip zuphilip commented Oct 7, 2016

This contains the commits from https://github.com/QuLogic/ocropy/tree/py3k-simple by @QuLogic. I separate them from the commits for Travis integration and rebase them to current master. Thus, we can discuss this here.

Copy link
Contributor

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I wrote this, but just a couple minor comments on things I noticed.

Also note, this isn't full Python 3 support, but just the simple stuff.

@@ -34,14 +36,14 @@ def create_cairo_font_face_for_file(filename, faceindex=0, loadoptions=0):
cairo_t = PycairoContext.from_address(id(cairo_ctx)).ctx
_cairo_so.cairo_ft_font_face_create_for_ft_face.restype = ctypes.c_void_p
if FT_Err_Ok != _freetype_so.FT_New_Face(_ft_lib, filename, faceindex, ctypes.byref(ft_face)):
raise "Error creating FreeType font face for " + filename
raise Exception("Error creating FreeType font face for " + filename)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should probably make this a more specific error.

@@ -493,7 +493,7 @@ def unpickle_find_global(mname,cname):
if mname=="lstm.lstm":
from . import lstm
return getattr(lstm,cname)
if not mname in sys.modules.keys():
if not mname in sys.modules:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have made this not in.

@stweil
Copy link
Contributor

stweil commented Oct 9, 2016

@zuphilip, I suggest breaking this into smaller PRs. Some of them are trivial (replacing tabs by spaces) or easy to review (print function) and could be applied soon. That would reduce the complexity a little.

@zuphilip zuphilip changed the base branch from master to python3 October 13, 2016 12:30
@zuphilip
Copy link
Collaborator Author

I just created a new "experimental" branch python3 and changed the base in this PR here, because this might need more work and maintenance is currently focused on Python 2.7. I guess some more step-by-step approach might be easier to review. I am open for any PR if someone want to work on that.

@kba
Copy link
Collaborator

kba commented Nov 16, 2016

These are easy to review and can be merged right away:
8cac188 (new style exceptions)
8778915 (remove tabs)

@kba kba mentioned this pull request Nov 16, 2016
@QuLogic
Copy link
Contributor

QuLogic commented Nov 16, 2016

TBH, I felt that all the commits are small enough that they could be reviewed in the commit view of the PR itself (except for the print function one.)

@mittagessen
Copy link

I just want to mention that there is no way you're going to get models pickled using python 2.7 to deserialize on py3k without writing your very own pickle parser. You can work around most issues but ultimately SeqRecognizer is an old-style class which don't exist anymore on 3.x.

@ChillarAnand
Copy link
Contributor

This is meant to be separate branch rather than providing both Py2 & Py3 support. May be we should add a note to readme.

@kba kba closed this Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants