471,873 Members | 1,009 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

add encoding to standard encodings works different in python 2.5?

Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: py*********@python.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: General discussion list for the Python programming language
List-Unsubscribe: <http://mail.python.org/mailman/listinfo/python-list>,
<mailto:py*****************@python.org?subject=uns ubscribe>
List-Archive: <http://mail.python.org/pipermail/python-list>
List-Post: <mailto:py*********@python.org>
List-Help: <mailto:py*****************@python.org?subject=hel p>
List-Subscribe: <http://mail.python.org/mailman/listinfo/python-list>,
<mailto:py*****************@python.org?subject=sub scribe>
Newsgroups: comp.lang.python
Message-ID: <mailman.1947.1166794941.32031.py*********@python. org>
Lines: 30
X-Trace: 1166794941 news.xs4all.nl 339 [::ffff:]:53104
X-Complaints-To: ab***@xs4all.nl
Xref: number1.nntp.dca.giganews.com comp.lang.python:512429


I use an encoding that is not available in the std python-encodings, say
encoding 'flup';
under different circumstances a user might wish different version of
'flup': a strict one or a more relaxed encoding.
(yes I know, this is terrible, but this is how it is)

in python2.4, I managed this by:
made flup_strict.py and flup_relaxed.py (coping an encoding from
python std encodings; using a encoding/decoding map as in CP1252.py,
with changes in the mapping).
placed flup_strict.py and flup_relaxed.py in my 'main'-directory
(the dir from which the my-python-source starts)
at start of my python-source: add an alias for the encoding:
encodings.aliases.aliases['flup']='flup_relaxed' (if user wishes
relaxed encoding)
this works; the encoding 'flup' is recognized and used.

when testing with python 2.5, this does not work.
my questions are:
- should this work in 2.5?
- how can i get this to work in 2.5 (nice if it would work in both 2.4
and 2.5)

btw, I use ubuntu linux edgy, with both python 2.4 and 2.5 installed

thanks, Henk-Jan
Dec 22 '06 #1
0 1230

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Golawala, Moiz M (GE Infrastructure) | last post: by
3 posts views Thread by Pekka Niiranen | last post: by
9 posts views Thread by Ksenia Marasanova | last post: by
5 posts views Thread by jalil | last post: by
13 posts views Thread by Michal | last post: by
6 posts views Thread by Andreas Jung | last post: by
15 posts views Thread by Steven Bethard | last post: by
2 posts views Thread by joakim.hove | last post: by
3 posts views Thread by Philip Semanchuk | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.