You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toml decoder is trying to convert IP address string to float. It should detect first if it's a number or not.
This is a conf file
#
# Use this configuration with WireGuard client
#
[Interface]
Address = 10.14.0.2/16
PrivateKey = <insert_your_private_key_here>
DNS = 100.252.123.123, 100.124.123.92
[Peer]
PublicKey = <insert_your_public_key_here>
AllowedIPs = 0.0.0.0/0
Endpoint = 100.90.123.123:51820
Code
import toml
data = toml.load("my-kul.prod.company.com.conf")
Exception
Traceback (most recent call last):
File "C:\Users\gx\AppData\Roaming\Python\Python38\site-packages\toml\decoder.py", line 511, in loads
ret = decoder.load_line(line, currentlevel, multikey,
File "C:\Users\gx\AppData\Roaming\Python\Python38\site-packages\toml\decoder.py", line 778, in load_line
value, vtype = self.load_value(pair[1], strictly_valid)
File "C:\Users\gx\AppData\Roaming\Python\Python38\site-packages\toml\decoder.py", line 912, in load_value
v = float(v)
ValueError: could not convert string to float: '10.14.0.2/16'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "addpvkey.py", line 2, in <module>
data = toml.load("my-kul.prod.surfshark.com.conf")
File "C:\Users\gx\AppData\Roaming\Python\Python38\site-packages\toml\decoder.py", line 134, in load
return loads(ffile.read(), _dict, decoder)
File "C:\Users\gx\AppData\Roaming\Python\Python38\site-packages\toml\decoder.py", line 514, in loads
raise TomlDecodeError(str(err), original, pos)
toml.decoder.TomlDecodeError: could not convert string to float: '10.14.0.2/16' (line 5 column 1 char 63)
The text was updated successfully, but these errors were encountered:
Can't do that it will break wireguard config file.
My python script will read the file and add user chosen private key programmatically.
Does any toml library support string format only decoder?
Toml decoder is trying to convert IP address string to float. It should detect first if it's a number or not.
This is a conf file
Code
Exception
The text was updated successfully, but these errors were encountered: