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: too many values to unpack (expected 2) #283

Open
mccnash opened this issue Mar 22, 2023 · 1 comment
Open

ValueError: too many values to unpack (expected 2) #283

mccnash opened this issue Mar 22, 2023 · 1 comment

Comments

@mccnash
Copy link

mccnash commented Mar 22, 2023

Description

This message came up after installing the latest wallet on Windows 10. It might be related to using Trezor device. I had an old version (4.x) installed and uninstalled that one before installing the latest version. Once I opened the new app this message comes up. I deleted my wallet so it would start with creating a new wallet. Everything worked until I selected my terzor device. Thats when everything goes haywire again. The window with the error message below just keeps poping up over and over. No matter if you do anything or not. I cant use the app right now at all.

Traceback

Traceback (most recent call last):
  File "electrumabc_gui\qt\main_window.py", line 1132, in timer_actions
  File "electrumabc_gui\qt\main_window.py", line 1319, in _update_wallet
  File "electrumabc_gui\qt\main_window.py", line 1255, in update_status
  File "electrumabc_gui\qt\main_window.py", line 1160, in format_amount_and_units
  File "electrumabc_gui\qt\main_window.py", line 1151, in format_amount
  File "electrumabc\util.py", line 534, in format_satoshis
ValueError: too many values to unpack (expected 2)

System information

  • Electrum ABC version: 5.2.2
  • Python version: 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:24:45) [MSC v.1929 32 bit (Intel)]
  • Operating system: Windows-10-10.0.19044-SP0
  • Wallet type: standard
  • Locale: en_US
PiRK added a commit to PiRK/ElectrumABC that referenced this issue Mar 28, 2023
This hopefully addresses Bitcoin-ABC#283, but I'm not sure because I don't know how to reproduce the issue.

The `try: except...` clause previously used was nonsense that did not catch any error. Replace it with a simple check to find out if the amount string contains a decimal point. If not, assume it only contains an integer. I'm not sure what could cause the string not to have a decimal point, but then I 'm not entirely in control of what `locale.format_string` produces. Maybe their is an exotic/buggy locale setting that produces values without a dp.
PiRK added a commit that referenced this issue May 2, 2023
This hopefully addresses #283, but I'm not sure because I don't know how to reproduce the issue.

The `try: except...` clause previously used was nonsense that did not catch any error. Replace it with a simple check to find out if the amount string contains a decimal point. If not, assume it only contains an integer. I'm not sure what could cause the string not to have a decimal point, but then I 'm not entirely in control of what `locale.format_string` produces. Maybe their is an exotic/buggy locale setting that produces values without a dp.
@PiRK
Copy link
Collaborator

PiRK commented May 12, 2023

Does your computer by any chance use a numeric locale that prints number using a . as thousands separator?

e.g. 10.000.123,45

The only way I can see this happening is if the software gets confused because the . is used both for thousands separator and for decimal point (which could happen if for some reason my code is not able to detect the actual character used for decimal point and falls back to .)
https://github.com/PiRK/ElectrumABC/blob/b78e96bb39b64496b94ddce789cdd00769c00021/electrumabc/util.py#LL496C24-L496C24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants