com.googler.python 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/package.json +4 -2
  2. package/python3.4.2/lib/python3.4/site-packages/pip/__init__.py +1 -277
  3. package/python3.4.2/lib/python3.4/site-packages/pip/__main__.py +19 -7
  4. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/__init__.py +246 -0
  5. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/basecommand.py +373 -0
  6. package/python3.4.2/lib/python3.4/site-packages/pip/{baseparser.py → _internal/baseparser.py} +240 -224
  7. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/build_env.py +92 -0
  8. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/cache.py +202 -0
  9. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/cmdoptions.py +609 -0
  10. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/__init__.py +79 -0
  11. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/check.py +42 -0
  12. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/completion.py +94 -0
  13. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/configuration.py +227 -0
  14. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/download.py +233 -0
  15. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/freeze.py +96 -0
  16. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/hash.py +57 -0
  17. package/python3.4.2/lib/python3.4/site-packages/pip/{commands → _internal/commands}/help.py +36 -33
  18. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/install.py +477 -0
  19. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/list.py +343 -0
  20. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/search.py +135 -0
  21. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/show.py +164 -0
  22. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/uninstall.py +71 -0
  23. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/wheel.py +179 -0
  24. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/compat.py +235 -0
  25. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/configuration.py +378 -0
  26. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/download.py +922 -0
  27. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/exceptions.py +249 -0
  28. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/index.py +1117 -0
  29. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/locations.py +194 -0
  30. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/models/__init__.py +4 -0
  31. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/models/index.py +15 -0
  32. package/python3.4.2/lib/python3.4/site-packages/pip/{_vendor/requests/packages/urllib3/contrib → _internal/operations}/__init__.py +0 -0
  33. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/check.py +106 -0
  34. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/freeze.py +252 -0
  35. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/prepare.py +378 -0
  36. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/pep425tags.py +317 -0
  37. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/__init__.py +69 -0
  38. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_file.py +338 -0
  39. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_install.py +1115 -0
  40. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_set.py +164 -0
  41. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_uninstall.py +455 -0
  42. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/resolve.py +354 -0
  43. package/python3.4.2/lib/python3.4/site-packages/pip/{status_codes.py → _internal/status_codes.py} +8 -6
  44. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/__init__.py +0 -0
  45. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/appdirs.py +258 -0
  46. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/deprecation.py +77 -0
  47. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/encoding.py +33 -0
  48. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/filesystem.py +28 -0
  49. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/glibc.py +84 -0
  50. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/hashes.py +94 -0
  51. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/logging.py +132 -0
  52. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/misc.py +851 -0
  53. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/outdated.py +163 -0
  54. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/packaging.py +70 -0
  55. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/setuptools_build.py +8 -0
  56. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/temp_dir.py +82 -0
  57. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/typing.py +29 -0
  58. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/ui.py +421 -0
  59. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/__init__.py +471 -0
  60. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/bazaar.py +113 -0
  61. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/git.py +311 -0
  62. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/mercurial.py +105 -0
  63. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/subversion.py +271 -0
  64. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/wheel.py +817 -0
  65. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/__init__.py +109 -8
  66. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/appdirs.py +604 -0
  67. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/__init__.py +11 -0
  68. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/_cmd.py +60 -0
  69. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/adapter.py +134 -0
  70. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/cache.py +39 -0
  71. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +2 -0
  72. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +133 -0
  73. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +43 -0
  74. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/compat.py +29 -0
  75. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/controller.py +373 -0
  76. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/filewrapper.py +78 -0
  77. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/heuristics.py +138 -0
  78. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/serialize.py +194 -0
  79. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/wrapper.py +27 -0
  80. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/__init__.py +3 -0
  81. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/__main__.py +2 -0
  82. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests → certifi}/cacert.pem +1765 -2358
  83. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/core.py +37 -0
  84. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/__init__.py +39 -32
  85. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/big5freq.py +386 -0
  86. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/big5prober.py +47 -42
  87. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/chardistribution.py +233 -231
  88. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/charsetgroupprober.py +106 -0
  89. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/charsetprober.py +145 -0
  90. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/cli/__init__.py +1 -0
  91. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/cli/chardetect.py +85 -0
  92. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/codingstatemachine.py +88 -0
  93. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/compat.py +34 -34
  94. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/cp949prober.py +49 -44
  95. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/enums.py +76 -0
  96. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/escprober.py +101 -0
  97. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/escsm.py +246 -0
  98. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/eucjpprober.py +92 -0
  99. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/euckrfreq.py +195 -0
  100. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euckrprober.py +47 -42
  101. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euctwfreq.py +387 -428
  102. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euctwprober.py +46 -41
  103. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/gb2312freq.py +283 -472
  104. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/gb2312prober.py +46 -41
  105. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/hebrewprober.py +292 -283
  106. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/jisfreq.py +325 -569
  107. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/jpcntx.py +233 -219
  108. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langbulgarianmodel.py +228 -229
  109. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langcyrillicmodel.py +333 -329
  110. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langgreekmodel.py +225 -225
  111. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langhebrewmodel.py +200 -201
  112. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langhungarianmodel.py +225 -225
  113. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langthaimodel.py +199 -200
  114. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/langturkishmodel.py +193 -0
  115. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/latin1prober.py +145 -139
  116. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/mbcharsetprober.py +91 -0
  117. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/mbcsgroupprober.py +54 -54
  118. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/mbcssm.py +572 -0
  119. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/sbcharsetprober.py +132 -0
  120. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/sbcsgroupprober.py +73 -69
  121. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/sjisprober.py +92 -0
  122. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/universaldetector.py +286 -0
  123. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/utf8prober.py +82 -76
  124. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/version.py +9 -0
  125. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/__init__.py +7 -7
  126. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/ansi.py +102 -50
  127. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/ansitowin32.py +236 -190
  128. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/initialise.py +82 -56
  129. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/win32.py +156 -137
  130. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/winterm.py +162 -120
  131. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/__init__.py +23 -23
  132. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/__init__.py +6 -6
  133. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/misc.py +41 -41
  134. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/shutil.py +761 -761
  135. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg +84 -84
  136. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/sysconfig.py +788 -788
  137. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/tarfile.py +2607 -2607
  138. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/compat.py +1117 -1064
  139. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/database.py +1318 -1301
  140. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/index.py +516 -488
  141. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/locators.py +1292 -1194
  142. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/manifest.py +393 -364
  143. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/markers.py +131 -190
  144. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/metadata.py +1068 -1026
  145. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/resources.py +355 -317
  146. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/scripts.py +415 -323
  147. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/t32.exe +0 -0
  148. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/t64.exe +0 -0
  149. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/util.py +1755 -1575
  150. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/version.py +736 -721
  151. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/w32.exe +0 -0
  152. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/w64.exe +0 -0
  153. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/wheel.py +984 -958
  154. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distro.py +1104 -0
  155. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/__init__.py +35 -23
  156. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{ihatexml.py → _ihatexml.py} +288 -285
  157. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{inputstream.py → _inputstream.py} +923 -881
  158. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{tokenizer.py → _tokenizer.py} +1721 -1731
  159. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/__init__.py +14 -12
  160. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/_base.py +37 -37
  161. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/datrie.py +44 -44
  162. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/py.py +67 -67
  163. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{utils.py → _utils.py} +124 -82
  164. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/constants.py +2947 -3104
  165. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py +29 -20
  166. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/{_base.py → base.py} +12 -12
  167. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py +73 -65
  168. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/lint.py +93 -93
  169. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/optionaltags.py +207 -205
  170. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/sanitizer.py +896 -12
  171. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/whitespace.py +38 -38
  172. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/html5parser.py +2791 -2713
  173. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer.py +409 -0
  174. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py +30 -0
  175. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py +54 -0
  176. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/sax.py +50 -44
  177. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py +88 -76
  178. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/{_base.py → base.py} +417 -377
  179. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/dom.py +236 -227
  180. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.py +340 -337
  181. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py +366 -369
  182. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py +154 -57
  183. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{_base.py → base.py} +252 -200
  184. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/dom.py +43 -46
  185. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/etree.py +130 -138
  186. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{lxmletree.py → etree_lxml.py} +213 -208
  187. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{genshistream.py → genshi.py} +69 -69
  188. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/__init__.py +2 -0
  189. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/codec.py +118 -0
  190. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/compat.py +12 -0
  191. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/core.py +387 -0
  192. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/idnadata.py +1585 -0
  193. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/intranges.py +53 -0
  194. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/package_data.py +2 -0
  195. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/uts46data.py +7634 -0
  196. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/ipaddress.py +2419 -0
  197. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/__init__.py +347 -0
  198. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/linklockfile.py +73 -0
  199. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/mkdirlockfile.py +84 -0
  200. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/pidlockfile.py +190 -0
  201. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/sqlitelockfile.py +156 -0
  202. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/symlinklockfile.py +70 -0
  203. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/__init__.py +66 -0
  204. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/_version.py +1 -0
  205. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/exceptions.py +41 -0
  206. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/fallback.py +971 -0
  207. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/__about__.py +21 -0
  208. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/__init__.py +14 -0
  209. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/_compat.py +30 -0
  210. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/_structures.py +70 -0
  211. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/markers.py +301 -0
  212. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/requirements.py +130 -0
  213. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/specifiers.py +774 -0
  214. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/utils.py +63 -0
  215. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/version.py +441 -0
  216. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{pkg_resources.py → pkg_resources/__init__.py} +3125 -2762
  217. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pkg_resources/py31compat.py +22 -0
  218. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/__init__.py +127 -0
  219. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/bar.py +88 -0
  220. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/counter.py +48 -0
  221. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/helpers.py +91 -0
  222. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/spinner.py +44 -0
  223. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pyparsing.py +5720 -0
  224. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/__init__.py +3 -0
  225. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/core.py +13 -0
  226. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/parser.py +374 -0
  227. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/writer.py +127 -0
  228. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/__init__.py +123 -77
  229. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/__version__.py +14 -0
  230. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/_internal_utils.py +42 -0
  231. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/adapters.py +525 -388
  232. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/api.py +152 -120
  233. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/auth.py +293 -193
  234. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/certs.py +18 -24
  235. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/compat.py +73 -115
  236. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/cookies.py +542 -454
  237. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/exceptions.py +122 -75
  238. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/help.py +120 -0
  239. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/hooks.py +34 -45
  240. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/models.py +948 -803
  241. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages.py +16 -0
  242. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py +737 -637
  243. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/status_codes.py +91 -88
  244. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/structures.py +105 -127
  245. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/utils.py +904 -673
  246. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/retrying.py +267 -0
  247. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/six.py +891 -646
  248. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/__init__.py +97 -0
  249. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/_collections.py +319 -0
  250. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/connection.py +373 -0
  251. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/connectionpool.py +905 -710
  252. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  253. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  254. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +593 -0
  255. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +343 -0
  256. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/appengine.py +296 -0
  257. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/contrib/ntlmpool.py +112 -120
  258. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +455 -0
  259. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +810 -0
  260. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/socks.py +188 -0
  261. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/exceptions.py +246 -0
  262. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/fields.py +178 -177
  263. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/filepost.py +94 -100
  264. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/__init__.py +5 -4
  265. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  266. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +53 -0
  267. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ordered_dict.py +259 -260
  268. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/six.py +868 -0
  269. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ssl_match_hostname/__init__.py +19 -13
  270. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ssl_match_hostname/_implementation.py +157 -105
  271. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/poolmanager.py +440 -0
  272. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/request.py +148 -141
  273. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/response.py +626 -0
  274. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/__init__.py +54 -0
  275. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/connection.py +130 -0
  276. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/request.py +118 -0
  277. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/response.py +81 -0
  278. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/retry.py +401 -0
  279. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/selectors.py +581 -0
  280. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/ssl_.py +341 -0
  281. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/util/timeout.py +242 -234
  282. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/util/url.py +230 -162
  283. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/wait.py +40 -0
  284. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/__init__.py +342 -0
  285. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/labels.py +231 -0
  286. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/mklabels.py +59 -0
  287. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/tests.py +153 -0
  288. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/x_user_defined.py +325 -0
  289. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/_markerlib/__init__.py +0 -16
  290. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/_markerlib/markers.py +0 -119
  291. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/sanitizer.py +0 -271
  292. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer/__init__.py +0 -16
  293. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.py +0 -320
  294. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py +0 -63
  295. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/re-vendor.py +0 -34
  296. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/__init__.py +0 -3
  297. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py +0 -925
  298. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py +0 -46
  299. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py +0 -106
  300. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py +0 -62
  301. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py +0 -61
  302. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/constants.py +0 -39
  303. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/escprober.py +0 -86
  304. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/escsm.py +0 -242
  305. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py +0 -90
  306. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py +0 -596
  307. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py +0 -86
  308. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py +0 -575
  309. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py +0 -120
  310. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py +0 -91
  311. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py +0 -170
  312. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py +0 -58
  313. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py +0 -205
  314. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/connection.py +0 -204
  315. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py +0 -422
  316. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py +0 -126
  317. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py +0 -385
  318. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py +0 -258
  319. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/response.py +0 -308
  320. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py +0 -27
  321. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py +0 -45
  322. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py +0 -68
  323. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py +0 -13
  324. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py +0 -133
  325. package/python3.4.2/lib/python3.4/site-packages/pip/backwardcompat/__init__.py +0 -138
  326. package/python3.4.2/lib/python3.4/site-packages/pip/basecommand.py +0 -201
  327. package/python3.4.2/lib/python3.4/site-packages/pip/cmdoptions.py +0 -371
  328. package/python3.4.2/lib/python3.4/site-packages/pip/commands/__init__.py +0 -88
  329. package/python3.4.2/lib/python3.4/site-packages/pip/commands/bundle.py +0 -42
  330. package/python3.4.2/lib/python3.4/site-packages/pip/commands/completion.py +0 -59
  331. package/python3.4.2/lib/python3.4/site-packages/pip/commands/freeze.py +0 -114
  332. package/python3.4.2/lib/python3.4/site-packages/pip/commands/install.py +0 -314
  333. package/python3.4.2/lib/python3.4/site-packages/pip/commands/list.py +0 -162
  334. package/python3.4.2/lib/python3.4/site-packages/pip/commands/search.py +0 -132
  335. package/python3.4.2/lib/python3.4/site-packages/pip/commands/show.py +0 -80
  336. package/python3.4.2/lib/python3.4/site-packages/pip/commands/uninstall.py +0 -59
  337. package/python3.4.2/lib/python3.4/site-packages/pip/commands/unzip.py +0 -7
  338. package/python3.4.2/lib/python3.4/site-packages/pip/commands/wheel.py +0 -195
  339. package/python3.4.2/lib/python3.4/site-packages/pip/commands/zip.py +0 -351
  340. package/python3.4.2/lib/python3.4/site-packages/pip/download.py +0 -644
  341. package/python3.4.2/lib/python3.4/site-packages/pip/exceptions.py +0 -46
  342. package/python3.4.2/lib/python3.4/site-packages/pip/index.py +0 -990
  343. package/python3.4.2/lib/python3.4/site-packages/pip/locations.py +0 -171
  344. package/python3.4.2/lib/python3.4/site-packages/pip/log.py +0 -276
  345. package/python3.4.2/lib/python3.4/site-packages/pip/pep425tags.py +0 -102
  346. package/python3.4.2/lib/python3.4/site-packages/pip/req.py +0 -1931
  347. package/python3.4.2/lib/python3.4/site-packages/pip/runner.py +0 -18
  348. package/python3.4.2/lib/python3.4/site-packages/pip/util.py +0 -720
  349. package/python3.4.2/lib/python3.4/site-packages/pip/vcs/__init__.py +0 -251
  350. package/python3.4.2/lib/python3.4/site-packages/pip/vcs/bazaar.py +0 -131
  351. package/python3.4.2/lib/python3.4/site-packages/pip/vcs/git.py +0 -194
  352. package/python3.4.2/lib/python3.4/site-packages/pip/vcs/mercurial.py +0 -151
  353. package/python3.4.2/lib/python3.4/site-packages/pip/vcs/subversion.py +0 -273
  354. package/python3.4.2/lib/python3.4/site-packages/pip/wheel.py +0 -560
@@ -0,0 +1,626 @@
1
+ from __future__ import absolute_import
2
+ from contextlib import contextmanager
3
+ import zlib
4
+ import io
5
+ import logging
6
+ from socket import timeout as SocketTimeout
7
+ from socket import error as SocketError
8
+
9
+ from ._collections import HTTPHeaderDict
10
+ from .exceptions import (
11
+ BodyNotHttplibCompatible, ProtocolError, DecodeError, ReadTimeoutError,
12
+ ResponseNotChunked, IncompleteRead, InvalidHeader
13
+ )
14
+ from .packages.six import string_types as basestring, binary_type, PY3
15
+ from .packages.six.moves import http_client as httplib
16
+ from .connection import HTTPException, BaseSSLError
17
+ from .util.response import is_fp_closed, is_response_to_head
18
+
19
+ log = logging.getLogger(__name__)
20
+
21
+
22
+ class DeflateDecoder(object):
23
+
24
+ def __init__(self):
25
+ self._first_try = True
26
+ self._data = binary_type()
27
+ self._obj = zlib.decompressobj()
28
+
29
+ def __getattr__(self, name):
30
+ return getattr(self._obj, name)
31
+
32
+ def decompress(self, data):
33
+ if not data:
34
+ return data
35
+
36
+ if not self._first_try:
37
+ return self._obj.decompress(data)
38
+
39
+ self._data += data
40
+ try:
41
+ decompressed = self._obj.decompress(data)
42
+ if decompressed:
43
+ self._first_try = False
44
+ self._data = None
45
+ return decompressed
46
+ except zlib.error:
47
+ self._first_try = False
48
+ self._obj = zlib.decompressobj(-zlib.MAX_WBITS)
49
+ try:
50
+ return self.decompress(self._data)
51
+ finally:
52
+ self._data = None
53
+
54
+
55
+ class GzipDecoder(object):
56
+
57
+ def __init__(self):
58
+ self._obj = zlib.decompressobj(16 + zlib.MAX_WBITS)
59
+
60
+ def __getattr__(self, name):
61
+ return getattr(self._obj, name)
62
+
63
+ def decompress(self, data):
64
+ if not data:
65
+ return data
66
+ return self._obj.decompress(data)
67
+
68
+
69
+ def _get_decoder(mode):
70
+ if mode == 'gzip':
71
+ return GzipDecoder()
72
+
73
+ return DeflateDecoder()
74
+
75
+
76
+ class HTTPResponse(io.IOBase):
77
+ """
78
+ HTTP Response container.
79
+
80
+ Backwards-compatible to httplib's HTTPResponse but the response ``body`` is
81
+ loaded and decoded on-demand when the ``data`` property is accessed. This
82
+ class is also compatible with the Python standard library's :mod:`io`
83
+ module, and can hence be treated as a readable object in the context of that
84
+ framework.
85
+
86
+ Extra parameters for behaviour not present in httplib.HTTPResponse:
87
+
88
+ :param preload_content:
89
+ If True, the response's body will be preloaded during construction.
90
+
91
+ :param decode_content:
92
+ If True, attempts to decode specific content-encoding's based on headers
93
+ (like 'gzip' and 'deflate') will be skipped and raw data will be used
94
+ instead.
95
+
96
+ :param original_response:
97
+ When this HTTPResponse wrapper is generated from an httplib.HTTPResponse
98
+ object, it's convenient to include the original for debug purposes. It's
99
+ otherwise unused.
100
+
101
+ :param retries:
102
+ The retries contains the last :class:`~urllib3.util.retry.Retry` that
103
+ was used during the request.
104
+
105
+ :param enforce_content_length:
106
+ Enforce content length checking. Body returned by server must match
107
+ value of Content-Length header, if present. Otherwise, raise error.
108
+ """
109
+
110
+ CONTENT_DECODERS = ['gzip', 'deflate']
111
+ REDIRECT_STATUSES = [301, 302, 303, 307, 308]
112
+
113
+ def __init__(self, body='', headers=None, status=0, version=0, reason=None,
114
+ strict=0, preload_content=True, decode_content=True,
115
+ original_response=None, pool=None, connection=None,
116
+ retries=None, enforce_content_length=False, request_method=None):
117
+
118
+ if isinstance(headers, HTTPHeaderDict):
119
+ self.headers = headers
120
+ else:
121
+ self.headers = HTTPHeaderDict(headers)
122
+ self.status = status
123
+ self.version = version
124
+ self.reason = reason
125
+ self.strict = strict
126
+ self.decode_content = decode_content
127
+ self.retries = retries
128
+ self.enforce_content_length = enforce_content_length
129
+
130
+ self._decoder = None
131
+ self._body = None
132
+ self._fp = None
133
+ self._original_response = original_response
134
+ self._fp_bytes_read = 0
135
+
136
+ if body and isinstance(body, (basestring, binary_type)):
137
+ self._body = body
138
+
139
+ self._pool = pool
140
+ self._connection = connection
141
+
142
+ if hasattr(body, 'read'):
143
+ self._fp = body
144
+
145
+ # Are we using the chunked-style of transfer encoding?
146
+ self.chunked = False
147
+ self.chunk_left = None
148
+ tr_enc = self.headers.get('transfer-encoding', '').lower()
149
+ # Don't incur the penalty of creating a list and then discarding it
150
+ encodings = (enc.strip() for enc in tr_enc.split(","))
151
+ if "chunked" in encodings:
152
+ self.chunked = True
153
+
154
+ # Determine length of response
155
+ self.length_remaining = self._init_length(request_method)
156
+
157
+ # If requested, preload the body.
158
+ if preload_content and not self._body:
159
+ self._body = self.read(decode_content=decode_content)
160
+
161
+ def get_redirect_location(self):
162
+ """
163
+ Should we redirect and where to?
164
+
165
+ :returns: Truthy redirect location string if we got a redirect status
166
+ code and valid location. ``None`` if redirect status and no
167
+ location. ``False`` if not a redirect status code.
168
+ """
169
+ if self.status in self.REDIRECT_STATUSES:
170
+ return self.headers.get('location')
171
+
172
+ return False
173
+
174
+ def release_conn(self):
175
+ if not self._pool or not self._connection:
176
+ return
177
+
178
+ self._pool._put_conn(self._connection)
179
+ self._connection = None
180
+
181
+ @property
182
+ def data(self):
183
+ # For backwords-compat with earlier urllib3 0.4 and earlier.
184
+ if self._body:
185
+ return self._body
186
+
187
+ if self._fp:
188
+ return self.read(cache_content=True)
189
+
190
+ @property
191
+ def connection(self):
192
+ return self._connection
193
+
194
+ def tell(self):
195
+ """
196
+ Obtain the number of bytes pulled over the wire so far. May differ from
197
+ the amount of content returned by :meth:``HTTPResponse.read`` if bytes
198
+ are encoded on the wire (e.g, compressed).
199
+ """
200
+ return self._fp_bytes_read
201
+
202
+ def _init_length(self, request_method):
203
+ """
204
+ Set initial length value for Response content if available.
205
+ """
206
+ length = self.headers.get('content-length')
207
+
208
+ if length is not None and self.chunked:
209
+ # This Response will fail with an IncompleteRead if it can't be
210
+ # received as chunked. This method falls back to attempt reading
211
+ # the response before raising an exception.
212
+ log.warning("Received response with both Content-Length and "
213
+ "Transfer-Encoding set. This is expressly forbidden "
214
+ "by RFC 7230 sec 3.3.2. Ignoring Content-Length and "
215
+ "attempting to process response as Transfer-Encoding: "
216
+ "chunked.")
217
+ return None
218
+
219
+ elif length is not None:
220
+ try:
221
+ # RFC 7230 section 3.3.2 specifies multiple content lengths can
222
+ # be sent in a single Content-Length header
223
+ # (e.g. Content-Length: 42, 42). This line ensures the values
224
+ # are all valid ints and that as long as the `set` length is 1,
225
+ # all values are the same. Otherwise, the header is invalid.
226
+ lengths = set([int(val) for val in length.split(',')])
227
+ if len(lengths) > 1:
228
+ raise InvalidHeader("Content-Length contained multiple "
229
+ "unmatching values (%s)" % length)
230
+ length = lengths.pop()
231
+ except ValueError:
232
+ length = None
233
+ else:
234
+ if length < 0:
235
+ length = None
236
+
237
+ # Convert status to int for comparison
238
+ # In some cases, httplib returns a status of "_UNKNOWN"
239
+ try:
240
+ status = int(self.status)
241
+ except ValueError:
242
+ status = 0
243
+
244
+ # Check for responses that shouldn't include a body
245
+ if status in (204, 304) or 100 <= status < 200 or request_method == 'HEAD':
246
+ length = 0
247
+
248
+ return length
249
+
250
+ def _init_decoder(self):
251
+ """
252
+ Set-up the _decoder attribute if necessary.
253
+ """
254
+ # Note: content-encoding value should be case-insensitive, per RFC 7230
255
+ # Section 3.2
256
+ content_encoding = self.headers.get('content-encoding', '').lower()
257
+ if self._decoder is None and content_encoding in self.CONTENT_DECODERS:
258
+ self._decoder = _get_decoder(content_encoding)
259
+
260
+ def _decode(self, data, decode_content, flush_decoder):
261
+ """
262
+ Decode the data passed in and potentially flush the decoder.
263
+ """
264
+ try:
265
+ if decode_content and self._decoder:
266
+ data = self._decoder.decompress(data)
267
+ except (IOError, zlib.error) as e:
268
+ content_encoding = self.headers.get('content-encoding', '').lower()
269
+ raise DecodeError(
270
+ "Received response with content-encoding: %s, but "
271
+ "failed to decode it." % content_encoding, e)
272
+
273
+ if flush_decoder and decode_content:
274
+ data += self._flush_decoder()
275
+
276
+ return data
277
+
278
+ def _flush_decoder(self):
279
+ """
280
+ Flushes the decoder. Should only be called if the decoder is actually
281
+ being used.
282
+ """
283
+ if self._decoder:
284
+ buf = self._decoder.decompress(b'')
285
+ return buf + self._decoder.flush()
286
+
287
+ return b''
288
+
289
+ @contextmanager
290
+ def _error_catcher(self):
291
+ """
292
+ Catch low-level python exceptions, instead re-raising urllib3
293
+ variants, so that low-level exceptions are not leaked in the
294
+ high-level api.
295
+
296
+ On exit, release the connection back to the pool.
297
+ """
298
+ clean_exit = False
299
+
300
+ try:
301
+ try:
302
+ yield
303
+
304
+ except SocketTimeout:
305
+ # FIXME: Ideally we'd like to include the url in the ReadTimeoutError but
306
+ # there is yet no clean way to get at it from this context.
307
+ raise ReadTimeoutError(self._pool, None, 'Read timed out.')
308
+
309
+ except BaseSSLError as e:
310
+ # FIXME: Is there a better way to differentiate between SSLErrors?
311
+ if 'read operation timed out' not in str(e): # Defensive:
312
+ # This shouldn't happen but just in case we're missing an edge
313
+ # case, let's avoid swallowing SSL errors.
314
+ raise
315
+
316
+ raise ReadTimeoutError(self._pool, None, 'Read timed out.')
317
+
318
+ except (HTTPException, SocketError) as e:
319
+ # This includes IncompleteRead.
320
+ raise ProtocolError('Connection broken: %r' % e, e)
321
+
322
+ # If no exception is thrown, we should avoid cleaning up
323
+ # unnecessarily.
324
+ clean_exit = True
325
+ finally:
326
+ # If we didn't terminate cleanly, we need to throw away our
327
+ # connection.
328
+ if not clean_exit:
329
+ # The response may not be closed but we're not going to use it
330
+ # anymore so close it now to ensure that the connection is
331
+ # released back to the pool.
332
+ if self._original_response:
333
+ self._original_response.close()
334
+
335
+ # Closing the response may not actually be sufficient to close
336
+ # everything, so if we have a hold of the connection close that
337
+ # too.
338
+ if self._connection:
339
+ self._connection.close()
340
+
341
+ # If we hold the original response but it's closed now, we should
342
+ # return the connection back to the pool.
343
+ if self._original_response and self._original_response.isclosed():
344
+ self.release_conn()
345
+
346
+ def read(self, amt=None, decode_content=None, cache_content=False):
347
+ """
348
+ Similar to :meth:`httplib.HTTPResponse.read`, but with two additional
349
+ parameters: ``decode_content`` and ``cache_content``.
350
+
351
+ :param amt:
352
+ How much of the content to read. If specified, caching is skipped
353
+ because it doesn't make sense to cache partial content as the full
354
+ response.
355
+
356
+ :param decode_content:
357
+ If True, will attempt to decode the body based on the
358
+ 'content-encoding' header.
359
+
360
+ :param cache_content:
361
+ If True, will save the returned data such that the same result is
362
+ returned despite of the state of the underlying file object. This
363
+ is useful if you want the ``.data`` property to continue working
364
+ after having ``.read()`` the file object. (Overridden if ``amt`` is
365
+ set.)
366
+ """
367
+ self._init_decoder()
368
+ if decode_content is None:
369
+ decode_content = self.decode_content
370
+
371
+ if self._fp is None:
372
+ return
373
+
374
+ flush_decoder = False
375
+ data = None
376
+
377
+ with self._error_catcher():
378
+ if amt is None:
379
+ # cStringIO doesn't like amt=None
380
+ data = self._fp.read()
381
+ flush_decoder = True
382
+ else:
383
+ cache_content = False
384
+ data = self._fp.read(amt)
385
+ if amt != 0 and not data: # Platform-specific: Buggy versions of Python.
386
+ # Close the connection when no data is returned
387
+ #
388
+ # This is redundant to what httplib/http.client _should_
389
+ # already do. However, versions of python released before
390
+ # December 15, 2012 (http://bugs.python.org/issue16298) do
391
+ # not properly close the connection in all cases. There is
392
+ # no harm in redundantly calling close.
393
+ self._fp.close()
394
+ flush_decoder = True
395
+ if self.enforce_content_length and self.length_remaining not in (0, None):
396
+ # This is an edge case that httplib failed to cover due
397
+ # to concerns of backward compatibility. We're
398
+ # addressing it here to make sure IncompleteRead is
399
+ # raised during streaming, so all calls with incorrect
400
+ # Content-Length are caught.
401
+ raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
402
+
403
+ if data:
404
+ self._fp_bytes_read += len(data)
405
+ if self.length_remaining is not None:
406
+ self.length_remaining -= len(data)
407
+
408
+ data = self._decode(data, decode_content, flush_decoder)
409
+
410
+ if cache_content:
411
+ self._body = data
412
+
413
+ return data
414
+
415
+ def stream(self, amt=2**16, decode_content=None):
416
+ """
417
+ A generator wrapper for the read() method. A call will block until
418
+ ``amt`` bytes have been read from the connection or until the
419
+ connection is closed.
420
+
421
+ :param amt:
422
+ How much of the content to read. The generator will return up to
423
+ much data per iteration, but may return less. This is particularly
424
+ likely when using compressed data. However, the empty string will
425
+ never be returned.
426
+
427
+ :param decode_content:
428
+ If True, will attempt to decode the body based on the
429
+ 'content-encoding' header.
430
+ """
431
+ if self.chunked and self.supports_chunked_reads():
432
+ for line in self.read_chunked(amt, decode_content=decode_content):
433
+ yield line
434
+ else:
435
+ while not is_fp_closed(self._fp):
436
+ data = self.read(amt=amt, decode_content=decode_content)
437
+
438
+ if data:
439
+ yield data
440
+
441
+ @classmethod
442
+ def from_httplib(ResponseCls, r, **response_kw):
443
+ """
444
+ Given an :class:`httplib.HTTPResponse` instance ``r``, return a
445
+ corresponding :class:`urllib3.response.HTTPResponse` object.
446
+
447
+ Remaining parameters are passed to the HTTPResponse constructor, along
448
+ with ``original_response=r``.
449
+ """
450
+ headers = r.msg
451
+
452
+ if not isinstance(headers, HTTPHeaderDict):
453
+ if PY3: # Python 3
454
+ headers = HTTPHeaderDict(headers.items())
455
+ else: # Python 2
456
+ headers = HTTPHeaderDict.from_httplib(headers)
457
+
458
+ # HTTPResponse objects in Python 3 don't have a .strict attribute
459
+ strict = getattr(r, 'strict', 0)
460
+ resp = ResponseCls(body=r,
461
+ headers=headers,
462
+ status=r.status,
463
+ version=r.version,
464
+ reason=r.reason,
465
+ strict=strict,
466
+ original_response=r,
467
+ **response_kw)
468
+ return resp
469
+
470
+ # Backwards-compatibility methods for httplib.HTTPResponse
471
+ def getheaders(self):
472
+ return self.headers
473
+
474
+ def getheader(self, name, default=None):
475
+ return self.headers.get(name, default)
476
+
477
+ # Backwards compatibility for http.cookiejar
478
+ def info(self):
479
+ return self.headers
480
+
481
+ # Overrides from io.IOBase
482
+ def close(self):
483
+ if not self.closed:
484
+ self._fp.close()
485
+
486
+ if self._connection:
487
+ self._connection.close()
488
+
489
+ @property
490
+ def closed(self):
491
+ if self._fp is None:
492
+ return True
493
+ elif hasattr(self._fp, 'isclosed'):
494
+ return self._fp.isclosed()
495
+ elif hasattr(self._fp, 'closed'):
496
+ return self._fp.closed
497
+ else:
498
+ return True
499
+
500
+ def fileno(self):
501
+ if self._fp is None:
502
+ raise IOError("HTTPResponse has no file to get a fileno from")
503
+ elif hasattr(self._fp, "fileno"):
504
+ return self._fp.fileno()
505
+ else:
506
+ raise IOError("The file-like object this HTTPResponse is wrapped "
507
+ "around has no file descriptor")
508
+
509
+ def flush(self):
510
+ if self._fp is not None and hasattr(self._fp, 'flush'):
511
+ return self._fp.flush()
512
+
513
+ def readable(self):
514
+ # This method is required for `io` module compatibility.
515
+ return True
516
+
517
+ def readinto(self, b):
518
+ # This method is required for `io` module compatibility.
519
+ temp = self.read(len(b))
520
+ if len(temp) == 0:
521
+ return 0
522
+ else:
523
+ b[:len(temp)] = temp
524
+ return len(temp)
525
+
526
+ def supports_chunked_reads(self):
527
+ """
528
+ Checks if the underlying file-like object looks like a
529
+ httplib.HTTPResponse object. We do this by testing for the fp
530
+ attribute. If it is present we assume it returns raw chunks as
531
+ processed by read_chunked().
532
+ """
533
+ return hasattr(self._fp, 'fp')
534
+
535
+ def _update_chunk_length(self):
536
+ # First, we'll figure out length of a chunk and then
537
+ # we'll try to read it from socket.
538
+ if self.chunk_left is not None:
539
+ return
540
+ line = self._fp.fp.readline()
541
+ line = line.split(b';', 1)[0]
542
+ try:
543
+ self.chunk_left = int(line, 16)
544
+ except ValueError:
545
+ # Invalid chunked protocol response, abort.
546
+ self.close()
547
+ raise httplib.IncompleteRead(line)
548
+
549
+ def _handle_chunk(self, amt):
550
+ returned_chunk = None
551
+ if amt is None:
552
+ chunk = self._fp._safe_read(self.chunk_left)
553
+ returned_chunk = chunk
554
+ self._fp._safe_read(2) # Toss the CRLF at the end of the chunk.
555
+ self.chunk_left = None
556
+ elif amt < self.chunk_left:
557
+ value = self._fp._safe_read(amt)
558
+ self.chunk_left = self.chunk_left - amt
559
+ returned_chunk = value
560
+ elif amt == self.chunk_left:
561
+ value = self._fp._safe_read(amt)
562
+ self._fp._safe_read(2) # Toss the CRLF at the end of the chunk.
563
+ self.chunk_left = None
564
+ returned_chunk = value
565
+ else: # amt > self.chunk_left
566
+ returned_chunk = self._fp._safe_read(self.chunk_left)
567
+ self._fp._safe_read(2) # Toss the CRLF at the end of the chunk.
568
+ self.chunk_left = None
569
+ return returned_chunk
570
+
571
+ def read_chunked(self, amt=None, decode_content=None):
572
+ """
573
+ Similar to :meth:`HTTPResponse.read`, but with an additional
574
+ parameter: ``decode_content``.
575
+
576
+ :param decode_content:
577
+ If True, will attempt to decode the body based on the
578
+ 'content-encoding' header.
579
+ """
580
+ self._init_decoder()
581
+ # FIXME: Rewrite this method and make it a class with a better structured logic.
582
+ if not self.chunked:
583
+ raise ResponseNotChunked(
584
+ "Response is not chunked. "
585
+ "Header 'transfer-encoding: chunked' is missing.")
586
+ if not self.supports_chunked_reads():
587
+ raise BodyNotHttplibCompatible(
588
+ "Body should be httplib.HTTPResponse like. "
589
+ "It should have have an fp attribute which returns raw chunks.")
590
+
591
+ # Don't bother reading the body of a HEAD request.
592
+ if self._original_response and is_response_to_head(self._original_response):
593
+ self._original_response.close()
594
+ return
595
+
596
+ with self._error_catcher():
597
+ while True:
598
+ self._update_chunk_length()
599
+ if self.chunk_left == 0:
600
+ break
601
+ chunk = self._handle_chunk(amt)
602
+ decoded = self._decode(chunk, decode_content=decode_content,
603
+ flush_decoder=False)
604
+ if decoded:
605
+ yield decoded
606
+
607
+ if decode_content:
608
+ # On CPython and PyPy, we should never need to flush the
609
+ # decoder. However, on Jython we *might* need to, so
610
+ # lets defensively do it anyway.
611
+ decoded = self._flush_decoder()
612
+ if decoded: # Platform-specific: Jython.
613
+ yield decoded
614
+
615
+ # Chunk content ends with \r\n: discard it.
616
+ while True:
617
+ line = self._fp.fp.readline()
618
+ if not line:
619
+ # Some sites may not end with '\r\n'.
620
+ break
621
+ if line == b'\r\n':
622
+ break
623
+
624
+ # We read everything; close the "file".
625
+ if self._original_response:
626
+ self._original_response.close()
@@ -0,0 +1,54 @@
1
+ from __future__ import absolute_import
2
+ # For backwards compatibility, provide imports that used to be here.
3
+ from .connection import is_connection_dropped
4
+ from .request import make_headers
5
+ from .response import is_fp_closed
6
+ from .ssl_ import (
7
+ SSLContext,
8
+ HAS_SNI,
9
+ IS_PYOPENSSL,
10
+ IS_SECURETRANSPORT,
11
+ assert_fingerprint,
12
+ resolve_cert_reqs,
13
+ resolve_ssl_version,
14
+ ssl_wrap_socket,
15
+ )
16
+ from .timeout import (
17
+ current_time,
18
+ Timeout,
19
+ )
20
+
21
+ from .retry import Retry
22
+ from .url import (
23
+ get_host,
24
+ parse_url,
25
+ split_first,
26
+ Url,
27
+ )
28
+ from .wait import (
29
+ wait_for_read,
30
+ wait_for_write
31
+ )
32
+
33
+ __all__ = (
34
+ 'HAS_SNI',
35
+ 'IS_PYOPENSSL',
36
+ 'IS_SECURETRANSPORT',
37
+ 'SSLContext',
38
+ 'Retry',
39
+ 'Timeout',
40
+ 'Url',
41
+ 'assert_fingerprint',
42
+ 'current_time',
43
+ 'is_connection_dropped',
44
+ 'is_fp_closed',
45
+ 'get_host',
46
+ 'parse_url',
47
+ 'make_headers',
48
+ 'resolve_cert_reqs',
49
+ 'resolve_ssl_version',
50
+ 'split_first',
51
+ 'ssl_wrap_socket',
52
+ 'wait_for_read',
53
+ 'wait_for_write'
54
+ )