Opened 15 years ago

Closed 15 years ago

#23009 closed defect (wontfix)

rst plugin doesn't work

Reported by: weakish@… Owned by: tommyd@…
Priority: Normal Milestone:
Component: ports Version: 1.8.1
Keywords: haspatch Cc:
Port: ikiwiki

Description

rst plugin doesn't work on Mac OS X 10.4.11

Error log:

File "/opt/local/lib/ikiwiki/plugins/rst", line 33

return dict((k, v) for k, v in zip(*[iter(args)]*2))

SyntaxError: invalid syntax

I guess this is because the rst plugin uses hard-coded shebang line (#!/usr/bin/python) but Mac OS X 10.4 ships Python 2.3.5 which doesn't understand Python's iterator comprehension syntax.

Attachments (1)

portfile.patch (584 bytes) - added by weakish@… 15 years ago.
I believe this patch will fix this bug

Download all attachments as: .zip

Change History (7)

Changed 15 years ago by weakish@…

Attachment: portfile.patch added

I believe this patch will fix this bug

comment:1 Changed 15 years ago by jmroot (Joshua Root)

Keywords: haspatch added
Owner: changed from macports-tickets@… to tommyd@…

comment:2 Changed 15 years ago by jmroot (Joshua Root)

Please don't patch the Id line. This patch won't work, because ${prefix}/bin/python may not even exist, and it may just be a link to the system python anyway. It looks like you actually need to add a dep on one of the python ports and change the shebang to use the pythonX.Y binary it provides.

comment:3 in reply to:  2 Changed 15 years ago by tommyd@…

Status: newassigned

Replying to jmr@…:

Please don't patch the Id line. This patch won't work, because ${prefix}/bin/python may not even exist, and it may just be a link to the system python anyway. It looks like you actually need to add a dep on one of the python ports and change the shebang to use the pythonX.Y binary it provides.

I never used the rst plugin (I don't even know what it does), but adding a dependency on python on a perl port seems awkward to me. I'd rather add a variant which pulls in the python dependency if the user requests the usage of rst, or remove rst from the distro, or give him the hint that rst is probably not working or something else. Comments?

comment:4 Changed 15 years ago by tommyd@…

rst is short for reStructuredText, a special wiki syntax which ikiwiki apparently supports through this plugin.

The thing with the plugins is that there are dozens of them for various purposes and adding support for them all would pull in just too many dependencies (f.e. it has a plugin for just every version control system, which would probably require a variant to work correctly with). Adding variants for them all would be counter-productive, since I'm pretty sure I'm unable to maintain all of these.

So I see two other options here: Patch rst(.py) so that it works with the Python it finds somewhere in the path or leave it as is (WONTFIX), because I'd open pandoras box if I enable support for each and every plugin.

comment:5 Changed 15 years ago by weakish@…

I suggest use the shebang line: (simple and not counter-productive)

#!/usr/bin/env python

Maybe it's a good idea to request the upstream to make this change instead of patching in Macports?

I filed the bug at ikiwiki.info:

http://ikiwiki.info/bugs/rst_plugin_has_python_hardcode_in_shebang_line/

comment:6 Changed 15 years ago by tommyd@…

Resolution: wontfix
Status: assignedclosed

Ok, I guess this is indeed the best way to go. Since new versions of ikiwiki pop up every few days, MP should have it soon.

Note: See TracTickets for help on using tickets.