New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qubes-manager: UnicodeEncodeError if there are cyrillic letters in "Run command in VM" query. #2040

Closed
rashchedrin opened this Issue May 29, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@rashchedrin

Qubes OS version:

R3.0

Affected: Qubes VM Manager

If in Qubes Manager use item "Run command in VM" then enter anything with Cyrillic letters and hit enter, appears message that says "Whoops. A critical error has occured...".


Expected behavior:

Send command to VM with Cyrillic letters, or warn with something not as scary as critical error.

Actual behavior:

Appears message with text

Whoops. A critical error has occured.
This is most likely a bug in Qubes Manager.

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)
at line 1418
of file main.py

Steps to reproduce the behavior:

Right click on any vm in Qubes Manager, click "run command in VM", type привет , hit enter.

@andrewdavidwong

This comment has been minimized.

Show comment
Hide comment
@andrewdavidwong

andrewdavidwong May 29, 2016

Member

Should be taken into account in #1870.

Member

andrewdavidwong commented May 29, 2016

Should be taken into account in #1870.

@andrewdavidwong

This comment has been minimized.

Show comment
Hide comment
@andrewdavidwong

andrewdavidwong Oct 1, 2016

Member

Another user report:

On 2016-10-01 12:13, ( - wrote:

Hello !

When using "Run command in VM" I found this little bug with unicode chars.

UnicodeEncodeError: 'ascii' codec can't encode characters in position 
27-30: ordinal not in range(128)

This is most likely a bug in the Qubes Manager

line: vm, str(command_to_run), thread_monitor))
func: action_run_command_in_vm_triggered
line no.: 1407
file: /usr/lib64/python2.7/site-packages/qubesmanager/main.py

So I try to make a one-line patch and test it with non-ascii string.

xterm -hold -e 'echo "test-тест"'

I guess this behavior exist in ver. 3.2 too.

See attached diff and screenshots.

-            vm, str(command_to_run), thread_monitor))
+            vm, unicode(command_to_run), thread_monitor))

Member

andrewdavidwong commented Oct 1, 2016

Another user report:

On 2016-10-01 12:13, ( - wrote:

Hello !

When using "Run command in VM" I found this little bug with unicode chars.

UnicodeEncodeError: 'ascii' codec can't encode characters in position 
27-30: ordinal not in range(128)

This is most likely a bug in the Qubes Manager

line: vm, str(command_to_run), thread_monitor))
func: action_run_command_in_vm_triggered
line no.: 1407
file: /usr/lib64/python2.7/site-packages/qubesmanager/main.py

So I try to make a one-line patch and test it with non-ascii string.

xterm -hold -e 'echo "test-тест"'

I guess this behavior exist in ver. 3.2 too.

See attached diff and screenshots.

-            vm, str(command_to_run), thread_monitor))
+            vm, unicode(command_to_run), thread_monitor))

@igilik

This comment has been minimized.

Show comment
Hide comment
@igilik

igilik Oct 2, 2016

--- /usr/lib64/python2.7/site-packages/qubesmanager/main.py.orig 2016-09-29 23:18:15.732999994 +0600
+++ /usr/lib64/python2.7/site-packages/qubesmanager/main.py 2016-10-01 21:06:54.464999973 +0600
@@ -1404,7 +1404,7 @@
return
thread_monitor = ThreadMonitor()
thread = threading.Thread(target=self.do_run_command_in_vm, args=(

  •        vm, str(command_to_run), thread_monitor))
    
  •        vm, unicode(command_to_run), thread_monitor))
     thread.daemon = True
     thread.start()
    

igilik commented Oct 2, 2016

--- /usr/lib64/python2.7/site-packages/qubesmanager/main.py.orig 2016-09-29 23:18:15.732999994 +0600
+++ /usr/lib64/python2.7/site-packages/qubesmanager/main.py 2016-10-01 21:06:54.464999973 +0600
@@ -1404,7 +1404,7 @@
return
thread_monitor = ThreadMonitor()
thread = threading.Thread(target=self.do_run_command_in_vm, args=(

  •        vm, str(command_to_run), thread_monitor))
    
  •        vm, unicode(command_to_run), thread_monitor))
     thread.daemon = True
     thread.start()
    

@marmarek marmarek closed this Oct 5, 2016

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Oct 5, 2016

Member

Automated announcement from builder-github

The package qubes-manager-3.2.4-1.fc23 has been pushed to the r3.2 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

Member

marmarek commented Oct 5, 2016

Automated announcement from builder-github

The package qubes-manager-3.2.4-1.fc23 has been pushed to the r3.2 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Oct 17, 2016

Member

Automated announcement from builder-github

The package qubes-manager-3.2.4-1.fc23 has been pushed to the r3.2 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

Member

marmarek commented Oct 17, 2016

Automated announcement from builder-github

The package qubes-manager-3.2.4-1.fc23 has been pushed to the r3.2 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment