[Twisted-Python] t.p.filepath and Unicode

Adi Roiban adi at roiban.ro
Sun Mar 8 04:03:03 MDT 2015


Hi,

I am trying to help porting Twisted on Py3 and for me the fact that
FilePath requires all paths to be bytes is a constant pain.

To reduce the Unicode pain when working with string my principle is to
do all internal operations in Unicode and then convert to bytes only
at input and output.

Right now I am trying to port t.p.moduled and when using the current
implementation of FilePath I have to constantly encode/decode path. I
would prefer not to consider the FilePath an input/output level.

Does anyone find this useful and plan to use FilePath with bytes in
another Python3 project?

What do you say if we will also have an UnicodeFilePath class  which
only accept Unicode as path input and only outputs Unicode?

It can start with simple path traversal/directory creation/file
creation just to have t.p.moduled (and trial) ported.

Thanks!
-- 
Adi Roiban



More information about the Twisted-Python mailing list