Opened 15 years ago
Closed 15 years ago
#1637 closed bug (Fixed)
deluge-console "pause --help" fails for non latin locale
| Reported by: | Vladimir Berezhnoy | Owned by: | Calum |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.3.3 |
| Component: | Console UI | Version: | 1.3.2 |
| Keywords: | Cc: |
Description
non7top@s ~/bin $ LC_ALL=C deluge-console "pause --help" Usage: pause [ * | <torrent-id> [<torrent-id> ...] ] Options: -h, --help show this help message and exit Pause a torrent non7top@s ~/bin $ deluge-console "pause --help" Error parsing options: 'ascii' codec can't decode byte 0xd0 in position 54: ordinal not in range(128) non7top@s ~/bin $ locale LANG=ru_RU.UTF-8 LC_CTYPE="ru_RU.UTF-8" LC_NUMERIC="ru_RU.UTF-8" LC_TIME="ru_RU.UTF-8" LC_COLLATE="ru_RU.UTF-8" LC_MONETARY="ru_RU.UTF-8" LC_MESSAGES="ru_RU.UTF-8" LC_PAPER="ru_RU.UTF-8" LC_NAME="ru_RU.UTF-8" LC_ADDRESS="ru_RU.UTF-8" LC_TELEPHONE="ru_RU.UTF-8" LC_MEASUREMENT="ru_RU.UTF-8" LC_IDENTIFICATION="ru_RU.UTF-8" LC_ALL= non7top@s ~/bin $ python --version Python 2.7.1
Other commands show same error with --help option
Change History (9)
comment:1 by , 15 years ago
| Component: | other → console |
|---|---|
| Priority: | major → minor |
| Type: | defect → bug |
comment:3 by , 15 years ago
| Milestone: | Future → 1.4.0 |
|---|---|
| Owner: | set to |
| Status: | new → assigned |
comment:4 by , 15 years ago
| Status: | assigned → pending |
|---|
This doesn't happen with the new console code for me, only with the older version. Are you sure you're running the newest version? (
Also, if you just run:
deluge-console --help
You should get the bug and a full stack trace which would be useful to have. I believe this isn't a problem with deluge but rather something wrong in optparse.
comment:5 by , 15 years ago
| Status: | pending → new |
|---|
$ deluge-console --help
Traceback (most recent call last):
File "/usr/bin/deluge-console", line 9, in <module>
load_entry_point('deluge==1.3.900-dev', 'console_scripts', 'deluge-console')()
File "/usr/lib/python2.7/site-packages/deluge/ui/console/main.py", line 124, in start
Console().start()
File "/usr/lib/python2.7/site-packages/deluge/ui/console/main.py", line 118, in start
super(Console, self).start()
File "/usr/lib/python2.7/site-packages/deluge/ui/ui.py", line 90, in start
(self.__options, self.__args) = self.__parser.parse_args()
File "/usr/lib/python2.7/optparse.py", line 1394, in parse_args
stop = self._process_args(largs, rargs, values)
File "/usr/lib/python2.7/optparse.py", line 1434, in _process_args
self._process_long_opt(rargs, values)
File "/usr/lib/python2.7/optparse.py", line 1509, in _process_long_opt
option.process(opt, value, values, self)
File "/usr/lib/python2.7/optparse.py", line 788, in process
self.action, self.dest, opt, value, values, parser)
File "/usr/lib/python2.7/optparse.py", line 810, in take_action
parser.print_help()
File "/usr/lib/python2.7/optparse.py", line 1664, in print_help
file.write(self.format_help().encode(encoding, "replace"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 33: ordinal not in range(128)
comment:6 by , 15 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
Your OS is trying to convert non-ascii characters to ascii. This is normally due to not having LANG or LC_ALL setup properly.
This is an example of how to fix this:
export LANG='en_US.UTF-8' export LC_ALL='en_US.UTF-8'
comment:7 by , 15 years ago
| Resolution: | invalid |
|---|---|
| Status: | closed → reopened |
As I've said my locale is not en_US.UTF-8 isn't deluge supposed to be only run on different locales other than en_US.UTF-8?
comment:8 by , 15 years ago
| Milestone: | 1.4.0 → 1.3.3 |
|---|---|
| Owner: | changed from to |
| Status: | reopened → accepted |
| Version: | 1.3.0_dev → 1.3.2 |
Sorry did not see that it was an optparse issue but I can now reproduce with that same commit 63d0d0 and 1.3.2
I have a fix for 1.3-stable here but needs verified that it is correct.
We have broken translations in master gtk ui due to lots of changes so will have to wait to test the fix there.
comment:9 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |



What version of Deluge are you using?