what's the _junk in codes?

asked 2013-03-10 17:04:55 -0600

try: _junk, dest_container, dest_object = dest.split('/', 2) except ValueError: return HTTPPreconditionFailed( request=req, body='Destination header must be of the form ' '<container name="">/')

what's that _junk? correct dest should be "container/object" but how does that string split into 3 parts?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2013-03-10 18:27:00 -0600

redbo gravatar image

If you try '/container/object'.split('/', 2), you'll get a useless empty string for the first item in the list. We just call it _junk since we don't intend to use it anywhere.

(We used to have a convention of using "_" when we needed a symbol we weren't going to use. Then we pretended for a while like we were going to use gettext, so we just bulk changed all of the "_" symbols to "_junk".)

edit flag offensive delete link more

answered 2013-03-10 18:38:37 -0600

Thank you I miss this line: 1096: dest = '/' + dest

edit flag offensive delete link more

answered 2013-03-10 18:38:49 -0600

Thanks Mike Barton, that solved my question.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-03-10 17:04:55 -0600

Seen: 27 times

Last updated: Mar 10 '13