Skip to content
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

ValueError: invalid literal for int() with base 10: '' #769

Closed
wants to merge 1 commit into from
Closed

ValueError: invalid literal for int() with base 10: '' #769

wants to merge 1 commit into from

Conversation

21e06
Copy link

@21e06 21e06 commented Apr 8, 2021

This PR is a fix to ValueError: invalid literal for int() with base 10: ''

@jml3on
Copy link

jml3on commented Apr 8, 2021

yup. got the same issue today.

@Chris-Tophski
Copy link

According to my recordings this issue started at or shortly after 2021-04-07 23:53 CEST (must be 21:53 UTC). It seems there is an empty string in server_config['ignoreids'] in the get_config function and a cast to int after splitting it fails.

@paulv888
Copy link

paulv888 commented Apr 8, 2021

+1, same for me

@nploi
Copy link

nploi commented Apr 8, 2021

Same issue today +1

@uajith
Copy link

uajith commented Apr 8, 2021

+1, same for me

@PtrckM
Copy link

PtrckM commented Apr 8, 2021

im getting the same error, this PR fix it.

@DavidCain
Copy link

Similar PR out which targets this same issue: #768

@DuschdrBabbe
Copy link

same here

@negulescus
Copy link

negulescus commented Apr 8, 2021

Hello,

I was also coming up with a solution:

        ignore_servers = list(
            map(int, [server_no for server_no in server_config['ignoreids'].split(',') if server_no])
        )

But, what was changed? I mean why this error appears only now?

@lafdez
Copy link

lafdez commented Apr 8, 2021

Hello,

It seems that something has changed in the speednet side. I do not know what value had ignoreids before but now it is an empty string.

I had changed the code to check if server_config['ignoreids'] was empty before doing the mapping, but I like it more the solution from @negulescus

@algo7
Copy link

algo7 commented Apr 8, 2021

Same issue today +1

@nelwa
Copy link

nelwa commented Apr 8, 2021

Same issue here today +1

Is this package still maintained? Last commit was in 2019.

@Home-Control9000
Copy link

The solution from @negulescus fixed my problem.
Change:
map(int, server_config['ignoreids'].split(','))
V
map(int, [server_no for server_no in server_config['ignoreids'].split(',') if server_no])

@simon3270
Copy link

simon3270 commented Apr 8, 2021

I went for the pythonic slash and burn:

        try:
            ignore_servers = list(map(int, server_config['ignoreids'].split(',')))
        except:
            ignore_servers = []

plageat pushed a commit to serverscope/serverscope-tools that referenced this pull request Apr 8, 2021
@paeore
Copy link

paeore commented Apr 8, 2021

The solution from @negulescus fixed my problem.
Change:
map(int, server_config['ignoreids'].split(','))
V
map(int, [server_no for server_no in server_config['ignoreids'].split(',') if server_no])

This edit worked for me 👍

@zslukacsik
Copy link

Hello,

I was also coming up with a solution:

        ignore_servers = list(
            map(int, [server_no for server_no in server_config['ignoreids'].split(',') if server_no])
        )

But, what was changed? I mean why this error appears only now?

Okay. But where do you put this code? What is the file location and name?

@paeore
Copy link

paeore commented Apr 8, 2021

Hello,
I was also coming up with a solution:

        ignore_servers = list(
            map(int, [server_no for server_no in server_config['ignoreids'].split(',') if server_no])
        )

But, what was changed? I mean why this error appears only now?

Okay. But where do you put this code? What is the file location and name?

Go to your teminal and run sudo find / -name speedtest.py that will give you the location of the file you need to edit.

Mine was located in /usr/lib/python3/dist-packages/speedtest.py then you need to use your favourite text editor to amend the code. I use nano so, after I made a quick backup of the file, I ran the following command sudo nano /usr/lib/python3/dist-packages/speedtest.py I then hit 'Ctrl + W' to initiate the find function and searched for the line that contained "map(int, server_config['ignoreids'].split(','))", deleted that line and replaced with @negulescus map(int, [server_no for server_no in server_config['ignoreids'].split(',') if server_no]) Save and close and the speedtest command will now now allow the program to run.
Hope that helps

@ashemsay
Copy link

ashemsay commented Apr 8, 2021

I went for the pythonic slash and burn:

        try:
            ignore_servers = list(map(int, server_config['ignoreids'].split(',')))
        except:
            ignore_servers = []

I went for something similar but targetting the specific error (replacing line 1113):

try:
    ignore_servers = list(
        map(int, server_config['ignoreids'].split(','))
    )
except ValueError:
    ignore_servers = []
@nelwa
Copy link

nelwa commented Apr 8, 2021

Hello,

I was also coming up with a solution:

        ignore_servers = list(
            map(int, [server_no for server_no in server_config['ignoreids'].split(',') if server_no])
        )

But, what was changed? I mean why this error appears only now?

Thank you, this worked for me!

speedtest.py Show resolved Hide resolved
@enricorox
Copy link

Hello,

I was also coming up with a solution:

        ignore_servers = list(
            map(int, [server_no for server_no in server_config['ignoreids'].split(',') if server_no])
        )

But, what was changed? I mean why this error appears only now?

This worked for me on Ubuntu 20.04.2
I edited /usr/lib/python3/dist-packages/speedtest.py line 1174

@winklevos
Copy link

Fix also working on windows speedtest.py

@zslukacsik
Copy link

zslukacsik commented Apr 8, 2021

Go to your teminal and run sudo find / -name speedtest.py that will give you the location of the file you need to edit.

Mine was located in /usr/lib/python3/dist-packages/speedtest.py then you need to use your favourite text editor to amend the code. I use nano so, after I made a quick backup of the file, I ran the following command sudo nano /usr/lib/python3/dist-packages/speedtest.py I then hit 'Ctrl + W' to initiate the find function and searched for the line that contained "map(int, server_config['ignoreids'].split(','))", deleted that line and replaced with @negulescus map(int, [server_no for server_no in server_config['ignoreids'].split(',') if server_no]) Save and close and the speedtest command will now now allow the program to run.
Hope that helps

@paeore
Thank you very much for your detailed answer!
At the first time I thought I need to insert into /usr/bin/speedtest file
...cos i'm a lama.... :D THX!
I found it, replaced it and working for me too! THX THX THX
I don't understand what happened today. Because I yesterday install speedtest and it worked properly. And today has this error ...

@MKappo
Copy link

MKappo commented Apr 8, 2021

Hello,
I was also coming up with a solution:

        ignore_servers = list(
            map(int, [server_no for server_no in server_config['ignoreids'].split(',') if server_no])
        )

But, what was changed? I mean why this error appears only now?

Okay. But where do you put this code? What is the file location and name?

Go to your teminal and run sudo find / -name speedtest.py that will give you the location of the file you need to edit.

Mine was located in /usr/lib/python3/dist-packages/speedtest.py then you need to use your favourite text editor to amend the code. I use nano so, after I made a quick backup of the file, I ran the following command sudo nano /usr/lib/python3/dist-packages/speedtest.py I then hit 'Ctrl + W' to initiate the find function and searched for the line that contained "map(int, server_config['ignoreids'].split(','))", deleted that line and replaced with @negulescus map(int, [server_no for server_no in server_config['ignoreids'].split(',') if server_no]) Save and close and the speedtest command will now now allow the program to run.
Hope that helps

Worked perfectly for me! Thanks

@ORIOLESFan02
Copy link

I have the same issue too

@sivel
Copy link
Owner

sivel commented Apr 8, 2021

Resolved in cadc68b and included in the v2.1.3

@sivel sivel closed this Apr 8, 2021
@MichaelSulzer
Copy link

Same problem here....

@pippo-dev
Copy link

Same problem here with 2021.3.4 from 8 April after restart

@eocula
Copy link

eocula commented Apr 10, 2021

Same issue here. It indeed started at 07-04-2021 around 23:30 CET. I used the solution from @negulescus and now it is working again. Many thanks all !

Copy link

@chrismyers81 chrismyers81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started encountering this error a few days ago, and the change below fixed it.

@pakair
Copy link

pakair commented Apr 12, 2021

made the change as described above, speedtest works now. Thank you.

Repository owner locked and limited conversation to collaborators Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.