Skip to content

Commit

Permalink
Fix crash when session.cookies was not a RequestsCookieJar
Browse files Browse the repository at this point in the history
  • Loading branch information
gazpachoking committed Apr 26, 2013
1 parent 1866f75 commit 9763a67
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions requests/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"""
import os
from copy import copy
from datetime import datetime

from .compat import cookielib
Expand Down Expand Up @@ -285,8 +286,9 @@ def request(self, method, url,
cookies = cookiejar_from_dict(cookies)

# Merge with session cookies
merged_cookies = self.cookies.copy()
merged_cookies.update(cookies)
merged_cookies = copy(self.cookies)
for cookie in cookies:
merged_cookies.set_cookie(cookie)
cookies = merged_cookies

# Gather clues from the surrounding environment.
Expand Down

0 comments on commit 9763a67

Please sign in to comment.