Skip to content

Commit e2a9ea4

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 08913aa + 83022bd commit e2a9ea4

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

docs/config_file.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Config File
66
An example config file is provided in this repository, it supports multiple accounts.
77
The programm looks for a file called `credentials.yml`_
88

9-
The config is parsed by `confused`_, see their docs for more in depth information.
9+
The config is parsed by `confuse`_, see their docs for more in depth information.
1010
Search paths are:
1111

1212
.. code-block:: bash
@@ -72,6 +72,6 @@ References
7272
.. target-notes::
7373
7474
.. _`credentials.yml`: https://github.com/saleweaver/python-amazon-sp-api/blob/master/credentials.yml
75-
.. _`confused`: https://confuse.readthedocs.io/en/latest/usage.html#search-paths
75+
.. _`confuse`: https://confuse.readthedocs.io/en/latest/usage.html#search-paths
7676
7777

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
pytest
22
requests~=2.28.2
33

4-
boto3~=1.26.51
4+
boto3~=1.26.83
55

6-
cachetools~=5.2.1
7-
setuptools~=66.0.0
6+
cachetools~=5.3.0
7+
setuptools~=67.4.0
88
pytz~=2022.7
99
confuse~=2.0.0
1010
jinja2

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
install_requires=[
99
"requests",
1010
"boto3>=1.16.39,<2",
11-
"cachetools>=4.2,<5.3",
12-
"pytz",
11+
"cachetools>=4.2,<5.4",
1312
"confuse>=1.4,<2.1"
1413
],
1514
extras_require={

sp_api/.DS_Store

-6 KB
Binary file not shown.

sp_api/api/feeds/feeds.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def create_feed_document(self, file, content_type, **kwargs) -> ApiResponse:
156156
For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
157157
158158
Args:
159-
file: File or File like object
159+
file: File or File like object. Setting this to None will skip the upload.
160160
content_type: str
161161
body: | * REQUIRED {'description': 'Specifies the content type for the createFeedDocument operation.', 'properties': {'contentType': {'description': 'The content type of the feed.', 'type': 'string'}}, 'required': ['contentType'], 'type': 'object'}
162162
@@ -168,6 +168,10 @@ def create_feed_document(self, file, content_type, **kwargs) -> ApiResponse:
168168
'contentType': kwargs.get('contentType', content_type)
169169
}
170170
response = self._request(kwargs.get('path'), data={**data, **kwargs})
171+
172+
if(file is None):
173+
return response
174+
171175
upload_data = file.read()
172176
try:
173177
upload_data = upload_data.decode('iso-8859-1')

sp_api/api/sales/sales.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def get_order_metrics(self, interval: tuple, granularity: Granularity, granulari
6262
if granularityTimeZone:
6363
kwargs.update({'granularityTimeZone': granularityTimeZone})
6464
if 'sku' in kwargs:
65-
kwargs.update({'sku': urllib.parse.quote_plus(kwargs.pop('sku'))})
65+
kwargs.update({'sku': urllib.parse.quote(kwargs.pop('sku'), safe='')})
6666
return self._request(kwargs.pop('path'), params=kwargs)
6767

6868
@staticmethod

sp_api/base/helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
import base64
44
import warnings
55
import functools
6+
from urllib import parse
67

78

89
def fill_query_params(query, *args):
9-
return query.format(*args)
10+
return query.format(*[parse.quote(arg, safe='') for arg in args])
1011

1112

1213
def sp_endpoint(path, method='GET'):

0 commit comments

Comments
 (0)