FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add MapScript support for Python 3.x by klassenjs · Pull Request #5290 · MapServer/MapServer · GitHub

Add MapScript support for Python 3.x - #5290

Closed
klassenjs wants to merge 1 commit into
MapServer:branch-7-0from
klassenjs:python-3.x
Closed

Add MapScript support for Python 3.x#5290
klassenjs wants to merge 1 commit into
MapServer:branch-7-0from
klassenjs:python-3.x

Conversation

Copy link
Copy Markdown
Contributor

I haven't had time to test this much, but this allows MapScript to
build and run against Python 3.4. The changes appear to continue to
work with Python 2.7. I kind of accidentally figured this out while playing
around so it may be incomplete, but I figured I'd share it as it is at least a
good start.

If there are multiple Python versions installed on your machine,
the Python version that is selected is whatever CMake finds first
or the path set with -DPYTHON_EXECUTABLE=

Changes include:

  • print "" ---> print("")
  • raise E, "text" ---> raise E("text")
  • PyString_FromStringAndSize() ---> PyBytes_FromStringAndSize()
  • Remove references to PyFile*

I haven't had time to test this much, but this allows MapScript to
build and run against Python 3.4. The changes appear to continue to
work with Python 2.7.

If there are multiple Python versions installed on your machine,
the Python version that is selected is whatever CMake finds first
or the path set with -DPYTHON_EXECUTABLE=

Changes include:
* print ""                     ---> print("")
* raise E, "text"              ---> raise E("text")
* PyString_FromStringAndSize() ---> PyBytes_FromStringAndSize()
* Remove references to PyFile*

jmckenna commented Jun 7, 2016

Copy link
Copy Markdown
Member

There is also an open ticket for Python3 support: ticket #4748

jmckenna commented Jun 7, 2016

Copy link
Copy Markdown
Member

I tried this, but I also needed the other setup.py changes made in #4748 (dict, readme)

jmckenna modified the milestones: 7.0.2 Release, 7.2 Release Sep 15, 2016

solebox commented Oct 13, 2016
edited
Loading

Copy link
Copy Markdown

when i try it out with python3 i get the usual
ImportError: dynamic module does not define init function (PyInit__mapscript)

... even tried to manually edit all the hex_version>= 0x03000 conditions to always be true in mapscriptPYTHON_wrap.c

(linux) ImportError: dynamic module does not define init function (PyInit__mapscript)

sdlime commented Aug 23, 2017

Copy link
Copy Markdown
Member

So where are we at with this pull request? It's a little dated and should be based against master and not the 7.0 branch. --Steve

claudep commented Mar 15, 2018

Copy link
Copy Markdown
Contributor

I recreated this pull request against master in #5561, also including some setup.py changes from #4748.

sdlime commented Mar 15, 2018

Copy link
Copy Markdown
Member

Beautiful - anyone else want to comment or test? Otherwise I say we merge it and deal with issues as part of the release process. --Steve

Copy link
Copy Markdown
Contributor Author

I didn't actually end up using this, so I don't have any specific comments/test cases. Glad to see @claudep pick it up.

(This PR was fallout of experimenting with options for moving beyond MapScript/PHP 5 for GeoMoose 3, but the final decision was to use a combination of standard WFS calls and client side processing rather than MapScript.)

sdlime commented Mar 20, 2018

Copy link
Copy Markdown
Member

I'm going to close with with the newer pull request in play. --Steve

sdlime closed this Mar 20, 2018
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL