mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Windows: Fix calibre-server --manage-users not working correctly
Apparently when running in the windows command prompy raw_input() returns a trailing carriage return
This commit is contained in:
parent
23bc346ce8
commit
78f1896c69
@ -8,7 +8,7 @@ import sys
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from calibre import prints
|
from calibre import prints
|
||||||
from calibre.constants import preferred_encoding
|
from calibre.constants import preferred_encoding, iswindows
|
||||||
from polyglot.builtins import iteritems, raw_input, filter, unicode_type
|
from polyglot.builtins import iteritems, raw_input, filter, unicode_type
|
||||||
|
|
||||||
# Manage users CLI {{{
|
# Manage users CLI {{{
|
||||||
@ -24,6 +24,9 @@ def manage_users_cli(path=None):
|
|||||||
ans = raw_input()
|
ans = raw_input()
|
||||||
if isinstance(ans, bytes):
|
if isinstance(ans, bytes):
|
||||||
ans = ans.decode(enc)
|
ans = ans.decode(enc)
|
||||||
|
if iswindows:
|
||||||
|
# https://bugs.python.org/issue11272
|
||||||
|
ans = ans.rstrip('\r')
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
def choice(
|
def choice(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user