/usr/share/go/src/pkg/runtime/runtime-gdb.py is not valiad python3

Bug #1283626 reported by Geoff Teale
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
golang (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

On trusty the file /usr/share/go/src/pkg/runtime/runtime-gdb.py is evaluated in python 3 when it is sourced by gdb. Unfortunately this file uses python 2 syntax.

To reproduce this error:

  $ mkdir -p ~/go/src/foo
  $ cd ~/go/src/foo
  $ echo -e "package main\n\nimport \"fmt\"\n\nfunc main(){\n fmt.Printf(\"Foo\")\n}\n" > foo.go
  $ export GOPATH=~/go/src
  $ go build
  $ gdb foo
  (gdb) source /usr/share/go/src/pkg/runtime/runtime-gdb.py

The error can be trivially resolved by running the following command:

  $ sudo 2to3 -w /usr/share/go/src/pkg/runtime/runtime-gdb.py

Note also, if bug #1076454 is resolved then the "source.." line in gdb, used above, will happen automatically.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

This has been fixed upstream.

Changed in golang (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.