Re: comment file naming

Bill Mill <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
Hello again all,

One more question. How should I properly handle unicode characters
inside the comments? Right now I run "astring.encode('iso-8859-1')" on
every string that gets pulled from a comment file. It seems to work,
but I don't understand why, and it's gotta be inefficient. Somebody
want to explain it or point me to somewhere that'll teach me what's
going on?

I had been getting this error before I explicitly encoded the characters:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 0: ordinal not in range(128)

Peace
Bill Mill
bill.mill at gmail.com

On Tue, 28 Dec 2004 22:45:56 -0500, Bill Mill <[email protected]> wrote:
> Hello all,
> 
> I want to change the way that comments are named, but I also want to
> solicit feedback from others before I do. All this comes about because
> I'm writing a comment administrator plugin for pyblosxom. (it's not
> yet in a usable state.)
> 
> Currently, comments are named "<file comment attached to minus
> extension>-<time of comment file writing>.<comment extension>". This
> has several drawbacks. First, 2 comments on a single story cannot be
> made at the same time (imagine a dual-processor machine, or 2 machines
> writing to a shared storage medium) without undefined results. Yes, it
> is unlikely, but certainly not impossible.
> 
> Second, the date in the file name is used to sort the file entries.
> While this is convenient, it puts significant meta-data into the
> filename. Thus, changing the time of a post in such a way that
> comments are correctly sorted involves renaming the comment whose time
> has changed. Furthermore, the user is responsible for ensuring that no
> two comments are set to have the same time, which seems a silly
> requirement.
> 
> So, if you agree that the naming scheme should be changed, how should
> it be changed? I will be glad to code up a patch, but I wanted to ask
> for suggestions on how comments could be better named - preferably in
> such a way as to not break backwards compatibility. (This would
> require changing the comment sorting to use the pubDate inside the
> file, but I think this should be done anyway).
> 
> My initial thought is "<file comment attached to minus
> extension>-<randint(1, 100000)>.<comment extension>". The comments
> plugin would simply have to assure that the file doesn't already
> exist. Does anybody have a better naming scheme? Comments on this one?
> Should the number be significant?
> 
> Peace
> Bill Mill
> bill.mill at gmail.com
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.