Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Transactions crash when there are transactions in progress #37

Closed
4 tasks done
mkhazhinsky opened this issue Feb 13, 2025 · 1 comment
Closed
4 tasks done

Transactions crash when there are transactions in progress #37

mkhazhinsky opened this issue Feb 13, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@mkhazhinsky
Copy link

Acknowledgements

  • I have written a descriptive issue title
  • I have searched Issues to see if the bug has already been reported
  • I have searched Stack Overflow to ensure the issue I'm experiencing has not already been discussed
  • If possible, I have enabled debug mode and am attaching relevant console logs and HTML files

Operating System

Linux

Python Version

3.10.12

amazon-orders Version

3.2.5

Describe the Bug

Crash for amazon_transactions.get_transactions command when there are transactions in progress

transactions = amazon_transactions.get_transactions(days=1)    

File "/usr/local/lib/python3.10/dist-packages/amazonorders/transactions.py", line 109, in get_transactions
_parse_transaction_form_tag(form_tag, self.config)
File "/usr/local/lib/python3.10/dist-packages/amazonorders/transactions.py", line 42, in _parse_transaction_form_tag
transaction = Transaction(transaction_tag, config, date)
File "/usr/local/lib/python3.10/dist-packages/amazonorders/entity/transaction.py", line 38, in init
self.order_number: str = self.safe_parse(self._parse_order_number)
File "/usr/local/lib/python3.10/dist-packages/amazonorders/entity/parsable.py", line 54, in safe_parse
return parse_function(**kwargs)
File "/usr/local/lib/python3.10/dist-packages/amazonorders/entity/transaction.py", line 63, in _parse_order_number
match = re.match(".*#([0-9-]+)$", value)
File "/usr/lib/python3.10/re.py", line 190, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object

Steps to Reproduce

see attached transactions.html file

transactions_0.zip

Expected Behavior

No response

@mkhazhinsky mkhazhinsky added the bug Something isn't working label Feb 13, 2025
@alexdlaird
Copy link
Owner

Thanks for raising this. This bug has been resolved, and I've added a generic integration test for Transactions that has been added to the weekly runs, which should help surface things like this sooner. You should see the fix in 3.2.6.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants