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

AttributeError: 'mpz' object has no attribute 'to_bytes' #6068

Closed
TARS-bot opened this issue Apr 2, 2020 · 1 comment
Closed

AttributeError: 'mpz' object has no attribute 'to_bytes' #6068

TARS-bot opened this issue Apr 2, 2020 · 1 comment

Comments

@TARS-bot
Copy link

TARS-bot commented Apr 2, 2020

Crash Report

This crash report was reported through the automatic crash reporting system 🤖

Traceback

  File "/usr/lib/python3.8/site-packages/electrum/gui/qt/main_window.py", line 553, in new_wallet
    self.gui_object.start_new_window(full_path, None)
  File "/usr/lib/python3.8/site-packages/electrum/gui/qt/__init__.py", line 215, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/electrum/gui/qt/__init__.py", line 239, in start_new_window
    wallet = self._start_wizard_to_select_or_create_wallet(path)
  File "/usr/lib/python3.8/site-packages/electrum/gui/qt/__init__.py", line 282, in _start_wizard_to_select_or_create_wallet
    storage = wizard.create_storage(path)
  File "/usr/lib/python3.8/site-packages/electrum/base_wizard.py", line 589, in create_storage
    storage.write()
  File "/usr/lib/python3.8/site-packages/electrum/util.py", line 356, in <lambda>
    return lambda *args, **kw_args: do_profile(args, kw_args)
  File "/usr/lib/python3.8/site-packages/electrum/util.py", line 352, in do_profile
    o = func(*args, **kw_args)
  File "/usr/lib/python3.8/site-packages/electrum/storage.py", line 89, in write
    self._write()
  File "/usr/lib/python3.8/site-packages/electrum/storage.py", line 98, in _write
    s = self.encrypt_before_writing(self.db.dump())
  File "/usr/lib/python3.8/site-packages/electrum/storage.py", line 196, in encrypt_before_writing
    s = public_key.encrypt_message(c, enc_magic)
  File "/usr/lib/python3.8/site-packages/electrum/ecc.py", line 286, in encrypt_message
    ecdh_key = (self * ephemeral.secret_scalar).get_public_key_bytes(compressed=True)
  File "/usr/lib/python3.8/site-packages/electrum/ecc.py", line 240, in __mul__
    ecdsa_point = self._pubkey.point * other
  File "/usr/lib/python3.8/site-packages/electrum/ecc_fast.py", line 125, in mul
    public_pair_bytes = b'\4' + self.x().to_bytes(32, byteorder="big") + self.y().to_bytes(32, byteorder="big")

AttributeError: 'mpz' object has no attribute 'to_bytes'

Reporter

This issue was reported by 1 user(s):

Electrum Version Python Version Operating System Wallet Type Locale Stack
3.3.8 3.8.2 (default, Feb 26 2020, 22:21:03) [GCC 9.2.1 20200130] Linux-5.5.13-1-MANJARO-x86_64-with-glibc2.2.5 standard ru_RU

Additional Information

The reporting user(s) did not provide additional information.

@SomberNight
Copy link
Member

This is a duplicate of #5927
Already fixed on master.

One workaround is to install older python-ecdsa:

python3 -m pip uninstall ecdsa
python3 -m pip install --user ecdsa<0.15

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

No branches or pull requests

2 participants