robinhood-unofficial / pyrh

Python Framework to make trades with the unofficial Robinhood API
https://pyrh.readthedocs.io/en/latest/
MIT License
1.79k stars 605 forks source link

pyrh fails to cancel order #280

Closed marcusdaly closed 3 years ago

marcusdaly commented 4 years ago

Checklist

Description

Steps/Code to Reproduce

A simple cancel order fails:

rh = Robinhood(username=my_email, password=my_password, challenge_type="sms" )
# ...
# more login stuff...
# ...

# get an open order to cancel:
orders = rh.get_open_orders()
order_id = orders[0]["id"]

# attempt to cancel the order
rh.cancel_order(order_id)

Results

I expect to get any valid response form cancel_order, but instead, get the following error:

File "....../pyrh/robinhood.py", line 1475, in cancel_order
    order = self.get(urls.build_orders() + order_id)
TypeError: unsupported operand type(s) for +: 'URL' and 'str'

I believe a prior commit fixed this for a different function, just need the same fix here too.

Versions

Python 3.6.8 |Anaconda custom (64-bit)| (default, Dec 29 2018, 19:04:46) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform; print(platform.platform())
Darwin-18.5.0-x86_64-i386-64bit
>>> import sys; print("Python", sys.version)
Python 3.6.8 |Anaconda custom (64-bit)| (default, Dec 29 2018, 19:04:46) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
>>> import pyrh; print("pyrh", pyrh.__version__)
pyrh 2.0
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.