Skip to contentSkip to conversation

sandbox/sandbox: fix saving file changes

PATCH In review Robert Frohl 3 participants 3 messages Jun 9 – Jun 10 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sandbox/sandbox: fix saving file changes

Fixes the following backtrace on saving files:

  $ sandbox -M -H sandbox_home/ -T sandbox_tmp/ /usr/bin/vim sandbox_home/cmd
  [edit file and save]
  Traceback (most recent call last):
    File "/usr/bin/sandbox", line 565, in <module>
      rc = sandbox.main()
    File "/usr/bin/sandbox", line 553, in main
      return self.__execute()
             ~~~~~~~~~~~~~~^^
    File "/usr/bin/sandbox", line 530, in __execute
      savefile(dest, i, self.__options.X_ind)
      ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/bin/sandbox", line 133, in savefile
      ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig)
            ^^^^^
  UnboundLocalError: cannot access local variable 'input' where it is not associated with a value
---
 sandbox/sandbox | 4 ----
 1 file changed, 4 deletions(-)
sandbox/sandbox +0 -4
index e3fd6119..4e7d56fd 100644
@@ -126,10 +126,6 @@ def savefile(new, orig, X_ind):
         if rc == Gtk.ResponseType.YES:
             copy = True
     else:
-        try:
-            input = raw_input
-        except NameError:
-            pass
         ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig)
         if re.match(_("[yY]"), ans):
             copy = True
Signature · 1 line
2.53.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines · Robert Frohl

Fixes the following backtrace on saving files:

  $ sandbox -M -H sandbox_home/ -T sandbox_tmp/ /usr/bin/vim sandbox_home/cmd
  [edit file and save]
  Traceback (most recent call last):
    File "/usr/bin/sandbox", line 565, in <module>
      rc = sandbox.main()
    File "/usr/bin/sandbox", line 553, in main
      return self.__execute()
             ~~~~~~~~~~~~~~^^
    File "/usr/bin/sandbox", line 530, in __execute
      savefile(dest, i, self.__options.X_ind)
      ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/bin/sandbox", line 133, in savefile
      ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig)
            ^^^^^
  UnboundLocalError: cannot access local variable 'input' where it is not associated with a value
Quoted 1 line
Quoted 23 lines
---
 sandbox/sandbox | 4 ----
 1 file changed, 4 deletions(-)
sandbox/sandbox +0 -5
index e3fd6119..4e7d56fd 100644
@@ -126,10 +126,6 @@ def savefile(new, orig, X_ind):
         if rc == Gtk.ResponseType.YES:
             copy = True
     else:
-        try:
-            input = raw_input
-        except NameError:
-            pass
         ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig)
         if re.match(_("[yY]"), ans):
             copy = True
--

2.53.0

#2 lore raw
Quoted 21 lines · Stephen Smalley
Quoted 19 lines · Robert Frohl

Fixes the following backtrace on saving files:

  $ sandbox -M -H sandbox_home/ -T sandbox_tmp/ /usr/bin/vim sandbox_home/cmd
  [edit file and save]
  Traceback (most recent call last):
    File "/usr/bin/sandbox", line 565, in <module>
      rc = sandbox.main()
    File "/usr/bin/sandbox", line 553, in main
      return self.__execute()
             ~~~~~~~~~~~~~~^^
    File "/usr/bin/sandbox", line 530, in __execute
      savefile(dest, i, self.__options.X_ind)
      ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/bin/sandbox", line 133, in savefile
      ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig)
            ^^^^^
  UnboundLocalError: cannot access local variable 'input' where it is not associated with a value
Quoted 4 lines
Quoted 1 line

Merged.
Thanks,
Jim

Quoted 24 lines
Quoted 23 lines
---
 sandbox/sandbox | 4 ----
 1 file changed, 4 deletions(-)
sandbox/sandbox +0 -5
index e3fd6119..4e7d56fd 100644
@@ -126,10 +126,6 @@ def savefile(new, orig, X_ind):
         if rc == Gtk.ResponseType.YES:
             copy = True
     else:
-        try:
-            input = raw_input
-        except NameError:
-            pass
         ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig)
         if re.match(_("[yY]"), ans):
             copy = True
--

2.53.0