[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problem with speedtest-cli



On Thu 01 Jul 2021 at 18:52:42 (+0800), kaye n wrote:
> On Fri, Jun 11, 2021 at 12:28 AM Liam O'Toole wrote:
> > On Fri, 11 Jun, 2021 at 00:08:51 +0800, kaye n wrote:
> > >    kaye@laptop:~$ speedtest-cli
> > >    Retrieving [1]speedtest.net configuration...
> > >    Traceback (most recent call last):
> > >      File "/usr/bin/speedtest-cli", line 11, in <module>
> > >        load_entry_point('speedtest-cli==2.0.2', 'console_scripts',
> > >    'speedtest-cli')()
> > >      File "/usr/lib/python3/dist-packages/speedtest.py", line 1887, in
> > >    main
> > >        shell()
> > >      File "/usr/lib/python3/dist-packages/speedtest.py", line 1783, in
> > >    shell
> > >        secure=args.secure
> > >      File "/usr/lib/python3/dist-packages/speedtest.py", line 1027, in
> > >    __init__
> > >        self.get_config()
> > >      File "/usr/lib/python3/dist-packages/speedtest.py", line 1113, in
> > >    get_config
> > >        map(int, server_config['ignoreids'].split(','))
> > >    ValueError: invalid literal for int() with base 10: ''
> > >    I don't know what's wrong.
> > >    Thank you for your time.
> > >    Kaye
> > >
> >
> > It's a known issue[1]. A workaround is to edit the file
> > /usr/lib/python3/dist-packages/speedtest.py. Remove the following block
> > beginning on line 1112
> >
> >        ignore_servers = list(
> >            map(int, server_config['ignoreids'].split(','))
> >        )
> >
> > and replace it with
> >
> >         ignore_servers = [
> >                     int(i) for i in server_config['ignoreids'].split(',')
> > if i
> >                 ]
> >
> > Hopefully the issue will be fixed in the next stable point release.
> >
> > [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986637
> >
> >
> Hello!
> It did not seem to fix the problem.
> 
> kaye@laptop:~$ speedtest-cli
> Retrieving speedtest.net configuration...
> Traceback (most recent call last):
>   File "/usr/bin/speedtest-cli", line 11, in <module>
>     load_entry_point('speedtest-cli==2.0.2', 'console_scripts',
> 'speedtest-cli')()
>   File "/usr/lib/python3/dist-packages/speedtest.py", line 1887, in main
>     shell()
>   File "/usr/lib/python3/dist-packages/speedtest.py", line 1783, in shell
>     secure=args.secure
>   File "/usr/lib/python3/dist-packages/speedtest.py", line 1027, in __init__
>     self.get_config()
>   File "/usr/lib/python3/dist-packages/speedtest.py", line 1113, in
> get_config
>     map(int, server_config['ignoreids'].split(','))
> ValueError: invalid literal for int() with base 10: ''
> 
> not a big deal, i can tolerate it.  but downloading huge files can be
> frustrating. but really no biggie.
> 
> thank you for your time.

These three sections, containing "map(int, ", from the above …

> > >        map(int, server_config['ignoreids'].split(','))
> > >    ValueError: invalid literal for int() with base 10: ''
> > >    I don't know what's wrong.
> > >    Thank you for your time.
[ … ]
> > /usr/lib/python3/dist-packages/speedtest.py. Remove the following block
> > beginning on line 1112
> >
> >        ignore_servers = list(
> >            map(int, server_config['ignoreids'].split(','))
> >        )
> >
> > and replace it with
[ … ]
>     map(int, server_config['ignoreids'].split(','))
> ValueError: invalid literal for int() with base 10: ''
> 
> not a big deal, i can tolerate it.  but downloading huge files can be
> frustrating. but really no biggie.

… would appear to show that nothing has changed, ie if you did make
the suggested alteration to the code, it wasn't made to the copy
that is actually running.

Looking at my /usr/lib/python3/dist-packages/ (I don't have
speedtest.py installed), I picked a distinctively named file
at random:

$ locate unohelper.py
/usr/lib/python3/dist-packages/unohelper.py
$ 

That's the source code file. You might have edited a file like this.
But now I checked on:

$ locate unohelper
/usr/lib/python3/dist-packages/unohelper.py
/usr/lib/python3/dist-packages/__pycache__/unohelper.cpython-37.pyc
$ 

and you can see that there's a compiled version of this source file.
You might try hiding the file (don't remove it¹), and seeing whether
that forces python to use the source file. That is:

# mv -i /usr/lib/python3/dist-packages/__pycache__/speedtest.cpython-37.pyc /usr/lib/python3/dist-packages/__pycache__/speedtest.cpython-37.pyc-hide

assuming that such a file exists. (37 is buster's python version.)

¹ for a peaceful life, restore the filename so that APT doesn't
  complain about it during future upgrades etc.

Cheers,
David.


Reply to: