Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2241 (closed defect: wontfix)

Opened 10 years ago

Last modified 10 years ago

webob request.copy() != request

Reported by: jorge.vargas Owned by:
Priority: normal Milestone: 2.0rc1
Component: TurboGears Version: 2.0b5
Severity: normal Keywords:

Description (last modified by jorge.vargas) (diff)

After several hours after trying to figure out why each and every method in codemill's hg was working except push I notice that CONTENT_LENGTH was getting set to -1 a couple of minutes later I ran the following in weberror request==new_req to my surprise it returned false, even better request.copy()==request returns FalsE!

While still in shock by all this I sat down and wrote 3 unit tests one for TG, one for pylons and one for plain webob, to my surpise all of them are failing! so what's wrong? how come copy doesn't copy? even if the webob docs say so  http://pythonpaste.org/webob/reference.html#modifying-the-request why am I getting a content-lenght of -1??

Still skeptic about this I went to the WSGIAppController and added + new_req.environCONTENT_LENGTH?=request.environCONTENT_LENGTH?

and now i can push! anyone knows what the heck is going on??

patch with the tests  http://paste.chrisarndt.de/paste/dbd7e1ff954542caa647ef65d6df97cc

Change History

comment:1 Changed 10 years ago by jorge.vargas

  • Description modified (diff)

comment:2 Changed 10 years ago by jorge.vargas

A temporal fix was commited to in r6442 to get it in to tg2.0b6 A proper fix should follow in webob.

comment:3 Changed 10 years ago by Gustavo

Have you reported this? I couldn't find a ticket for this in the Paste issue tracker, but I didn't know if you let know about it via email or IRC.

I don't find it surprising that "request.copy() != request", given that they define the ".copy()" method. Moreover, from their source code I'd say this is the intended behavior.

comment:4 Changed 10 years ago by jorge.vargas

I though I did last night, but I send it to the old paste ML. It's not on the new list  http://groups.google.com/group/paste-users/browse_thread/thread/f52cb3027326062e

I haven't read the source of webob on this but it seems realllly weird to me that copy doesn't returns a exact duplicate.

comment:5 Changed 10 years ago by mramm

  • Status changed from new to closed
  • Resolution set to wontfix

This issue needs to be addressed in webob, or perhaps somewhere else (the called app should re-read on a content-length of -1) as the mailing list thread suggests.

comment:6 Changed 10 years ago by jorge.vargas

Reverted temporal patch in r6545

comment:8 Changed 10 years ago by jorge.vargas

Note: See TracTickets for help on using tickets.