Ticket #2522 (closed defect: fixed)

Opened 6 months ago

Last modified 6 months ago

Support Unicode person names in address book initial-state URIs

Reported by: michalpasternak Assigned to: pjd
Priority: high Milestone:
Component: Addressbook Severity: major
Keywords: IRI Cc:
Author: pjd Branch: branches/initial-state-IRI-2522

Description (Last modified by pjd)

Parent: #2409, #2396

/home/blendix/.local/lib/python2.4/site-packages/xmantissa/people.py, line 1325 in beforeRender
1323             return
1324        initialPersonName = request.args['initial-person'][0]
1325        initialPerson = self.store.findFirst(
1326            Person, Person.name == initialPersonName.decode('ascii'))

Locals
request	<GET /private/608d484e860d01be?initial-person=Micha%C5%82%20Pasternak&initial-state=edit HTTP/1.1>
self	<xmantissa.people.OrganizerFragment object at 0x4b04f90>
initialPersonName	'Micha\xc5\x82 Pasternak'
Globals
Person	<class 'xmantissa.people.Person'>

Change History

02/24/08 12:27:32 changed by michalpasternak

WikiFormatting sucks :-(

Try to add person called "Michał Pasternak" to your addressbook.

02/24/08 14:10:14 changed by pjd

  • owner changed from amir to pjd.
  • priority changed from normal to high.
  • status changed from new to assigned.
  • description changed.
  • summary changed from No unicode support to Support Unicode person names in address book initial-state URIs.

(Supersede #2518)

02/24/08 14:11:59 changed by pjd

  • component changed from Mantissa to Addressbook.

02/24/08 14:14:46 changed by pjd

  • branch set to branches/initial-state-IRI-2522.
  • author set to pjd.

(In [15004]) Branching to 'initial-state-IRI-2522'

02/24/08 14:28:24 changed by pjd

  • keywords set to IRI.

02/24/08 16:08:11 changed by pjd

  • keywords changed from IRI to IRI, review.
  • owner changed from pjd to exarkun.
  • status changed from assigned to new.

Quick fix.

(follow-up: ↓ 8 ) 02/25/08 13:35:29 changed by exarkun

  • keywords changed from IRI, review to IRI.
  • owner changed from exarkun to pjd.

Is strengthening the test for the contents of request.args really related to this fix? Is there a test somewhere which depends on it?

set.issubset reads more nicely to me than <=, although the use of sets here doesn't seem to buy anything anyway.

(in reply to: ↑ 7 ) 02/26/08 09:09:14 changed by pjd

  • keywords changed from IRI to IRI, review.
  • owner changed from pjd to exarkun.

Is strengthening the test for the contents of request.args really related to this fix?

Well, not besides being a small and similar input handling traceback fix in the same code. :)

Is there a test somewhere which depends on it?

I'm not sure what you mean; test_validPersonAndInvalidState?

set.issubset reads more nicely to me than <=,

I avoid the named methods, because they don't express the distinction between ⊂/⊃ and ⊆/⊇ (in fact, there are no named methods for the former).

(follow-up: ↓ 10 ) 02/26/08 10:35:56 changed by exarkun

  • keywords changed from IRI, review to IRI.
  • owner changed from exarkun to pjd.

Ah, I see the new case in test_validPersonAndInvalidState now.

issubset is exactly the operation that the code wants to express and does already express with <=. If the code needed to check for proper subsets, then I suppose you would have to use <. However, since this is apparently such a complex subject, I think the maintainability of the code would greatly benefit from using two simple in tests without involving sets.

The rest is fine for merge.

(in reply to: ↑ 9 ) 02/26/08 11:29:09 changed by pjd

  • keywords changed from IRI to IRI, review.
  • owner changed from pjd to exarkun.

Okay, using issubset, but i kept a comment to indicate which subset is meant.

02/26/08 12:18:52 changed by exarkun

  • keywords changed from IRI, review to IRI.
  • owner changed from exarkun to pjd.

merge

02/26/08 12:45:12 changed by pjd

  • status changed from new to closed.
  • resolution set to fixed.

(In [15020]) Merge initial-state-IRI-2522

Author: pjd Reviewer: exarkun Fixes #2522

Handle IRIs in OrganizerFragment?.beforeRender, avoiding rendering tracebacks.

jethro@divmod.org