Remove API.compression
authorHarmon <Harmon758@gmail.com>
Thu, 28 Jan 2021 17:56:12 +0000 (11:56 -0600)
committerHarmon <Harmon758@gmail.com>
Thu, 28 Jan 2021 17:56:12 +0000 (11:56 -0600)
tweepy/api.py
tweepy/binder.py

index 4751464a1b13b0b98d2f3a1a82fab40d30677abc..41ccea5b1eedae3e22e9f3fa6ff24543dce76cca 100644 (file)
@@ -19,7 +19,7 @@ class API:
                  host='api.twitter.com', upload_host='upload.twitter.com',
                  cache=None, api_root='/1.1', upload_root='/1.1',
                  retry_count=0, retry_delay=0, retry_errors=None, timeout=60,
-                 parser=None, compression=False, wait_on_rate_limit=False,
+                 parser=None, wait_on_rate_limit=False,
                  wait_on_rate_limit_notify=False, proxy=''):
         """
         API instance constructor
@@ -39,7 +39,6 @@ class API:
                         seconds, default: 60
         :param parser: ModelParser instance to parse the responses,
                        default: None
-        :param compression: If the response is compressed, default: False
         :param wait_on_rate_limit: If the api wait when it hits the rate limit,
                                    default: False
         :param wait_on_rate_limit_notify: If the api print a notification when
@@ -54,7 +53,6 @@ class API:
         self.api_root = api_root
         self.upload_root = upload_root
         self.cache = cache
-        self.compression = compression
         self.retry_count = retry_count
         self.retry_delay = retry_delay
         self.retry_errors = retry_errors
index 2452433e591bb368a7b786e6710d03dc41124fe6..96a276f5a5541f6168348c78508f705e1aff2639 100644 (file)
@@ -154,10 +154,6 @@ def bind_api(**config):
                 if self.api.auth:
                     auth = self.api.auth.apply_auth()
 
-                # Request compression if configured
-                if self.api.compression:
-                    self.headers['Accept-encoding'] = 'gzip'
-
                 # Execute request
                 try:
                     resp = self.session.request(self.method,