Closed
Conversation
1) 2to3 has been used initially 2) string.letter -> string.ascii_letters 3) c_char(char) -> c_char(ord(char)) , similar c_wchar 4) __str__(self) modified in action_base.py and state.py ( #http://stackoverflow.com/questions/6812031/how-to-make-unicode-string-with-python3)
…eat/py3-support I've reverted the Unicode changes in favour of using 2to3 from setuptools to translate for Python 3 with only a few fixes enabled. The same has been done for basestring, str and long->int changes. There are also still a few newer issues to be resolved with 2to3. There are also a few unrelated changes in apps/family and some typo fixes.
- 2to3 was mostly used to unify syntactic differences between
versions. E.g. 'except Exception, e' -> 'except Exception as e'
and 'print "text"' -> 'print("text")'. It was also used for
generator function changes and relative imports.
- The 'six' package has been used for semantic differences between
versions. E.g. unicode -> str conversion. That package has been
added to install_requires in setup.py.
- Not sure if I've done the windows-1252 encoding correctly across
Python versions
drmfinlay
added a commit
that referenced
this pull request
Jun 8, 2018
Closes #10. - Not everything is working yet for Python 3. - There may be still be some issues with Python 2 (a lot of code changes), so this is being merged into 'develop' first. Any issues will probably be related to encoding between windows-1252, utf-8 and/or ascii.
Member
Author
|
This has been merged into The bug with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've selectively merged changes from pull request t4ngo/dragonfly#56 to make dragonfly compatible with both Python 2.7 and 3+, plus fixes for more recent commits. 2to3 and
sixhave been used to do this. I had originally thought to usesetuptoolsand2to3to do this (see #5), but that approach had a few quirks.You should be able to use
2to3to convert grammar modules to work with both Python versions.I've tested this using Python versions 2.7.13 and 3.5.3 on Debian, but not as much on Windows, so more testing is required before merging this.
Some notes/issues:
natlinkdragonfly engine won't work with Python 3 untilnatlinkitself supports Python 3.The(fixed)Keyboardclass is now broken for Python 3, despite commit c48aec9test_int_reftest fordragonfly2jsgfseems to fail only for Python 3. I suspect this is (yet another)pyjsgfissue.I screwed up the merge from @sathishkottravel'sNever mind, it just can't be automatically rebased.masterbranch, so I need to fix that.