That darn well better end in a 406 at some point :\
x58
Well, if a user has a view without accept=
then we can't implicitly esend a 406
so the user has to handle it themselves.
gavinc is still weirded out by views being able to return more than one content type
views can return whatever content-type they damn well please
gavinc
Never do it, so never think about it
x58
even if the browser didn't ask for it.
raydeo
views return content... renderers render that content
gavinc
Yes, sorry
raydeo
render is usually coupled to the accept registration
renderer*
x58
Even if the browser only asks for text/html, I can still send application/json in a response
gavinc
well, a view/renderer pair
raydeo
yeah perhaps... a footgun
look how many frameworks actually care about accept at all
at least in my experience
x58
That's because content negotiation is fucked... I really want to write an RFC to make the ordering more explicitly well defined, and update the various RFC's related to it.
Then built a new content-negotiation RFC that actually describes an algorithm that everyone can implement.
raydeo
I look forward to using it in 20 years
x58
Explicitly codify left -> right, it's practically a standard anyway since Apache has been doing it since mod_negotiation was introduced.
Explicitly state that the server should try to cater to the client rather than the other way around, and remove all of the edge cases.
raydeo
it's not like there's any fallback if the client receives a 406, which is why no one returns it
Well, you are supposed to give the client a list of alternate resources when you reply with a single resource if multiple resources match for the Accept header
gavinc: Ugh, another one I am unhappy with.
gavinc
x58: I'm off dying on the URL parsing hill still. Accept isn't that broken ;)
x58
raydeo: So the RFC actually does specify that if you can't find a good enough resource, you are supposed to tell the client what resources you do have and their content-types and let it retry the request with one from the list :P
raydeo: Or you pick one, send back 200 OK, but provide a list of alternates just in case the client wants to retry the request and pick an alternate from the list of offered suggestions.
Then add language negotiation to the list...
and encoding
and all that other shit
and it's a cluster fuck.
raydeo
no thank you
gavinc
bcp47 is where it all goes to hell :D
x58
There's an open bug against WebOb and I really don't want to tackle it...
it's actually in the predicate change and you can sort predicates above it in weight
s/change/chain
x58
You are right, because ovals contains accept=
raydeo
I'm pretty sure it even evaluates the predicate
after the view was selected
x58
I could never get it to fire when I was testing a while back, maybe I missed something else.
the accept stuff is dealt wtih in the multiview code
raydeo
yes, but it's also a real predicate registered on the view
the multiview just checks it *also*
x58
Really the predicate should go away
It's unnecessary
raydeo
I don't see any reason that wouldn't be happening
x58
It may have been missed when accept become a non-predicate.
raydeo
sure, it's just done atm because it was easier to implement a lot of the book-keeping as a predicate
at least that's my guess
it gets introspectables, etc automatically
x58
Also introspection
Yeah.
Ugh, it's a mess.
raydeo
well fortunately monokrome will fix it this weekend (I hope)
monokrome hopes so
ok I'm out for a while... I'll chew on the pyramid api a bit in the meantime
monokrome
I'll try -.-
stevepiercy
raydeo i'm not experienced with interpreting why tests fail, and i think i'm going about it all wrong
i'm obviously missing some required knowledge or experience, some unknown unknown...
c0le joined the channel
taking that one test as an example, for which i restored the slice, (and which happened to fix several other tests), how would i isolate the problem?
first clue is looking at the stack trace
davisagli joined the channel
goodwill joined the channel
so i looked in there, and found that argparse was displeased
that gave me a hint, that i messed up the args
now onto the next failing test, TestPCreateCommand.test_no_project_name, i see a similar pattern, but i'm spinning my wheels trying to figure out what next?
i gotta take Boogy for a walk, bbiab, but any tips or strategy to follow would be greatly appreciated