Bitcoin Forum
May 13, 2024, 09:41:33 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Electrum dumpprivkeys() fails with TypeError and parameter count confusion  (Read 412 times)
edsger (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 29, 2017, 11:28:39 PM
 #1

I always get this error in Electrum's python console on both my Ubuntu and Windows machines.  Here it is:

>> dumpprivkeys(map(lambda x:x.get('address'), listunspent()))
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\gui\qt\main_window.py", line 1675, in <lambda>
    return lambda *args: apply( f, (method, args, self.password_dialog ))
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\lib\commands.py", line 105, in _run
    result = f(*args)
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\lib\commands.py", line 83, in func_wrapper
    return func(*args, **kwargs)
TypeError: dumpprivkeys() takes exactly 1 argument (2 given)

I am using dumpprivkeys() exactly as specified in the documentation at https://electrum.readthedocs.io/en/latest/console.html.

Does anyone know what is going wrong here?

Here is supporting info:

>> print(sys.version)
2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)]

The problem is not the map() or listunspent() functions, it is dumpprivkeys():

>> dumpprivkeys(["17N9XSNwqzdYVug59LbPM5GfbPT5eJ24CB"])
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\gui\qt\main_window.py", line 1675, in <lambda>
    return lambda *args: apply( f, (method, args, self.password_dialog ))
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\lib\commands.py", line 105, in _run
    result = f(*args)
  File "C:\Users\User\AppData\Local\Temp\_MEI70962\lib\commands.py", line 83, in func_wrapper
    return func(*args, **kwargs)
TypeError: dumpprivkeys() takes exactly 1 argument (2 given)
>>

where:

>> listunspent()
[
    {
        "address": "17N9XSNwqzdYVug59LbPM5GfbPT5eJ24CB",
...redacted...
    }
]
1715593293
Hero Member
*
Offline Offline

Posts: 1715593293

View Profile Personal Message (Offline)

Ignore
1715593293
Reply with quote  #2

1715593293
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715593293
Hero Member
*
Offline Offline

Posts: 1715593293

View Profile Personal Message (Offline)

Ignore
1715593293
Reply with quote  #2

1715593293
Report to moderator
1715593293
Hero Member
*
Offline Offline

Posts: 1715593293

View Profile Personal Message (Offline)

Ignore
1715593293
Reply with quote  #2

1715593293
Report to moderator
edsger (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 29, 2017, 11:40:48 PM
 #2

I see on GitHub that dumpprivkeys() is deprecated.  Use getprivatekeys() instead.  I succeeded with that.

I tried to delete my earlier post but don't have the permissions.
platowright
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
October 03, 2017, 02:33:32 PM
 #3

I have the same problem with the python console. I am unable to run any of the functioins by passing an argument.
I always get the same error.

For instance if i wirte:
>> version()
´2.9.2´

This works fine, but, if I want to pass an argument to the function
i.e. to get help of the function...
>> version(`-h´)
TypeError: version() takes exactly 1 argument (2give)

in Linux, I just can pass the argument and it works fine
$ version -h
'2.9.2'

but I do not know how to di it with the python console
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!