nixprime / cpsm

A CtrlP matcher, specialized for paths.
Apache License 2.0
202 stars 19 forks source link

Fix compilation error #49

Closed ptzz closed 6 years ago

ptzz commented 6 years ago

Fixes #48.

maxnordlund commented 6 years ago

I also encountered this today, and unfortunately the Travis build fails on python 2. It seems like they may have changed the type with 3.7

ptzz commented 6 years ago

Ah, didn’t check CI results 😕. I’m without computer access for a couple of weeks, anyone feel free to push fixes to this PR meanwhile.

ptzz commented 6 years ago

Turns out I forgot to remove the initial hacky cast solution in the PR. But keeping that (line 48) and removing the rest probably makes CI happy. The cast is probably required anyway to stay compatible with Python < 3.7. The return type of PyUnicode_AsUTF8 did indeed change from char* to const char*.

maxnordlund commented 6 years ago

Can I push to your branch? Or could you give me access to your fork; I could take a stab at it.

ptzz commented 6 years ago

@maxnordlund Sure, did you try? Not sure how it works with permissions, some guy pushed to a PR of mine the other day without me giving explicit permissions. Pushed to my fork that is.

maxnordlund commented 6 years ago

I think that only works for members of the original repo, i.e. nixprime.

ptzz commented 6 years ago

@maxnordlund I’ve sent you a collaborator invite.

maxnordlund commented 6 years ago

Thank you, I've accepted and will try some stuff.

If just the cast won't work, I'm going for the full blown PY_MAJOR_VERSION/PY_MINOR_VERSION conditional compilation changing the signature of PyVimString_AsStringAndSize for ≥ 3.7

maxnordlund commented 6 years ago

Well, that went smoothly. Now it's ready I think, if @nixprime agrees. (Also you can just squash away my commit)

ptzz commented 6 years ago

@maxnordlund 🎉💪👍

Shougo commented 6 years ago

@nixprime Ping. I have encountered the problem today..

danarnold commented 6 years ago

This PR fixes the issue for me with nvim and python 3.7.0-3. Thanks @ptzz and @maxnordlund !