Subject: Re: bug#36518: [core-updates] python-boot0 fails to build on armhf and aarch64

From: Ricardo Wurmus <[email-masked]>
Date: Sat, 06 Jul 2019 11:35:57 +0200

Hi Marius,

> But the interpreter fails with 'unbound variable: this' upon running
> glibcs Python scripts.

This means it fell through to the case where “python” is called with
more than one argument:

--8<---------------cut here---------------start------------->8---
(define* (main #:optional (args (command-line)))
  (match args
    ((_ file)
     (let ((compiled (string-append file ".go")))
       (compile-file file
                     #:from python
                     #:output-file compiled)
       (load-compiled compiled)))
    ((_)
     (repl-default-option-set! 'prompt ">>> ")
     (set! (@@ (system repl common) repl-welcome)
           (const (display "\
Python on Guile, version 0.1.0
(Hit Ctrl-D to exit.)
")))
     (start-repl python)
     #t)
    (_ (format (current-error-port)
               "usage: ~a file.py~%" this))))
--8<---------------cut here---------------end--------------->8---

“this” was supposed to be the first match, i.e. the “python” executable
itself.  Anyway, the problem is that “python” doesn’t handle any flags
at all.  I’ll implement option “handling” soon (maybe we can ignore most
options to “python”).

--
Ricardo