diff --git a/luxon/utils/http.py b/luxon/utils/http.py index b257d96..e3c0aaa 100644 --- a/luxon/utils/http.py +++ b/luxon/utils/http.py @@ -568,7 +568,7 @@ def request(client, method, url, params={}, _cache_engine = None for kwarg in kwargs: - headers[kwarg] = kwargs + headers[kwarg] = kwargs[kwarg] if data is not None: if hasattr(data, 'json'): diff --git a/luxon/utils/sharding.py b/luxon/utils/sharding.py index d0e7630..1c937cc 100644 --- a/luxon/utils/sharding.py +++ b/luxon/utils/sharding.py @@ -39,6 +39,7 @@ def shard(string): hashed = 0 + string = if_unicode_to_bytes(string) for h in hashlib.md5(string).digest(): hashed += h @@ -80,3 +81,8 @@ def __str__(self): def __repr__(self): return repr(self._partitions) + def __getitem__(self, item): + try: + return self._partitions[item] + except IndexError: + return []