[trunk] Docstrings Byte Literal contains non-ascii characters

Bug #856192 reported by Guewen Baconnier @ Camptocamp
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP's Framework R&D

Bug Description

Hello,

In the docstring methods, the following line is often present :
  @param uid: the current user’s ID for security checks

The char ’ is not an ascii char and the docstrings are not declared as unicode (u"""docstring content""") [1]

With the command below, 254 lines match.
grep -hcr "the current user’s ID for security checks" * | awk '{ count += $0} END {print count}'

I think we should do some sed on all addons to correct that (and server as there is the same issue) like :
grep -hlr "the current user’s ID for security checks" * | xargs sed -i "s/the current user’s ID for security checks/the current user's ID for security checks/g"

Some others with the same problem:
grep -hcr "’" * | awk '{ count += $0} END {print count}' (result : 688)
@param ids: List of open wiki page’s IDs
@param ids: List of calendar event import’s IDs
@param data_id: Get Data’s ID or False
@param ids: List of auction lots enable’s IDs.

Thanks
Guewen

[1] http://www.python.org/dev/peps/pep-0257/

Revision history for this message
xrg (xrg) wrote : Re: [Bug 856192] [NEW] [trunk] Docstrings Byte Literal contains non-ascii characters

On Thursday 22 September 2011, you wrote:
> Public bug reported:
>
> Hello,
>
> In the docstring methods, the following line is often present :
> @param uid: the current user’s ID for security checks
>
++

indeed, have noted this and complained a few weeks ago.

Even more, the (self, cr, uid, ids , context) parameters should not be
documented at each model.method. They are standard API convention and thus
need no more explanation.

(yes, there is several methods documenting "self", but not all those cryptic
parameters after 'ids' ..)

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

I do agree with you.

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello,

This issue is generalize issue so I am assigning to framework.

Thanks.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Note that all our Python source files are UTF-8 encoded, as shown in the coding hint at the top of each file:
  # -*- coding: utf-8 -*-
So all unicode characters are just fine in any string, including docstrings: they're gonna be utf8-encoded.
And that's fine because no-one should ever assume that strings are ascii, even docstrings.

Now I do agree that there's no need for the funky apostrophe here, or for documenting self,cr, uid or ids at all (I think it's in our guidelines, and if not I will add it). So we should simply get rid of that useless stuff :-)

PS: definitely a wishlist

Changed in openobject-addons:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Wishlist
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.