\idxcode -> \py@idxcode (mimics index stuff in python.sty - problem only
revealed itself when i added index generating lines to doc/doc.tex)
diff --git a/Doc/texinputs/ltxmarkup.sty b/Doc/texinputs/ltxmarkup.sty
index d461d70..ace08cc 100644
--- a/Doc/texinputs/ltxmarkup.sty
+++ b/Doc/texinputs/ltxmarkup.sty
@@ -21,8 +21,8 @@
       \let\moreargs=\py@moreargs%
          #2}}]
     \item[\code{\e end\{{\bfseries #1}\}}]
-    \index{#1 environment@\idxcode{#1} environment}
-    \index{environments!#1@\idxcode{#1}}
+    \index{#1 environment@\py@idxcode{#1} environment}
+    \index{environments!#1@\py@idxcode{#1}}
 }{\end{fulllineitems}}
 
 \newenvironment{macrodesc}[2]{
@@ -33,7 +33,7 @@
       \let\unspecified=\py@unspecified%
       \let\moreargs=\py@moreargs%
       #2}}]
-    \index{#1@\idxcode{\e #1}}
+    \index{#1@\py@idxcode{#1}}
 }{\end{fulllineitems}}
 
 \newcommand{\env}[1]{\code{#1}}