Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 741531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:38:34+00:00 2026-05-14T08:38:34+00:00

I ran across an odd problem while trying to transfer a project to a

  • 0

I ran across an odd problem while trying to transfer a project to a windows machine.

In my project I use a session handler (http://gaeutilities.appspot.com/session) it works fine on my mac but on windows I get:

Traceback (most recent call last):
File “C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp__init__.py”, line 510, in call
handler.get(*groups)
File “C:\Development\Byggmax.Affiliate\bmaffiliate\admin.py”, line 29, in get
session = Session()
File “C:\Development\Byggmax.Affiliate\bmaffiliate\appengine_utilities\sessions.py”, line 547, in init
self.cookie.load(string_cookie)
File “C:\Python26\lib\Cookie.py”, line 628, in load
for k, v in rawdata.items():
AttributeError: ‘unicode’ object has no attribute ‘items’

Anyone familiar with the Session Handler that knows anything of this? All help are welcome!

..fredrik

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:38:35+00:00Added an answer on May 14, 2026 at 8:38 am

    The bug is pretty clear by glancing at the sources, although perfectly OS-independent. In sessions.py lines 544-547:

        string_cookie = os.environ.get(u"HTTP_COOKIE", u"")
        self.cookie = Cookie.SimpleCookie()
        self.output_cookie = Cookie.SimpleCookie()
        self.cookie.load(string_cookie)
    

    lines 544 makes it very likely that string_cookie is unicode (though it might be a byte string from the environment, those u"" mean that the sessions.py author is trying hard to get it as unicode!-). Meanwhile in Cookie.py lines 624-628:

    if type(rawdata) == type(""):
        self.__ParseString(rawdata)
    else:
        # self.update() wouldn't call our custom __setitem__
        for k, v in rawdata.items():
    

    line 624 only parses a byte string: anything else (including a unicode string!) is treated like a dict (whence the crash).

    Obviously this Cookie.py is emphatically not the one this sessions.py was developed for. So what can possibly have happened…? Well, we do know of course that App Engine is strictly Python 2.5 and the Cookie.py we showed is that of Python 2.6. So let’s look at Cookie.py in 2.5 (lines 618-621 in this version):

        if type(rawdata) == type(""):
            self.__ParseString(rawdata)
        else:
            self.update(rawdata)
    

    so in 2.5, given an empty unicode string, the cookie (which subclasses dict) does self.update(u'')… which is an innocuous no-op. The comment in 2.6 shows why the maintainer of Cookie.py switched to the current loop… which breaks when rawdata’s u''.

    Long story short: install Python 2.5 on your Windows machine, and use that version with the GAE SDK, not the 2.6 you’re currently using — unless you truly love debugging of extremely subtle version differences where an incorrect use was innocuous in 2.5 but breaks in 2.6, like this one;-). Also enter a bug about this in the gaeutilities tracker, since that call to load with an empty unicode string is simply wrong, even though in 2.5 it happens to be innocuous.

    Specifically, get the appropriate Windows msi of 2.5.4 from here, depending on whether you have a 32-bit or 64-bit version of Windows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just ran across a problem that took a little while to figure out
In doing some database work I ran across a strange problem. I'm trying to
I ran across a comment that made me wonder: If you use a sharding
I ran across the caret operator in python today and trying it out, I
I'm doing some work in Perl and I ran across an odd result using
I ran across an unexpected problem with the following code. List<string> items = new
Just ran across the problem described below. If Console.TreatControlCAsInput = true;, you have to
I ran across an issue whenever I was trying to sort a vector of
I just ran across this error message while working in C# A property or
I ran across a new problem in the last week. Due to the nature

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.