pathlib support

15 views
Skip to first unread message

Robert Koch

unread,
Feb 19, 2020, 6:57:03 PM2/19/20
to fullrmc
Hello,

Is there any plan to support pathlib in the Python 3 version? It's the standard way of handling operating systems path now in Python, but the current fullRMC implementation requires paths be cast as string objects before being passed in. Path objects cause an exception.

I would be willing to help implement this, if there is a desire for it.

Cheers,
Rob

Bachir Aoun

unread,
Feb 20, 2020, 9:54:15 AM2/20/20
to fullrmc
Hello Rob,

pathlib is a wonderful package provided in python3.
fullrmc so far supports both python majors 2 and 3. If we need to support pathlib we must provide a wrapper to pathlib that handles python 2.

What kind of issues are you currently having that is easily solvable with mere pathlib calls ?

Regardless, this is totally feasible, we can strategize it and make it our new added feature.

regards

Robert Koch

unread,
Feb 20, 2020, 10:03:41 AM2/20/20
to fullrmc
Hi Bachir,

In Python 2, I believe one can import pathlib2 (in the standard library) for all one's pathlib needs.

I wouldn't say I'm having any major issues. My current workflow is to render all path-like things (directory structures and filenames) as Path objects. This allows me to check if a file or directory exists and remove or create it based on the workflow, or craft other strings based on file/directory names, etc, all with built in methods or attributes of the Path objects.

Currently, any time these Path objects are passed to fullRMC they need to be first cast as strings, which is not terribly inconvenient, just mildly non pythonic, as most other packages accept Path objects when referencing files/directories.

Cheers,
Rob

Robert Koch

unread,
Feb 20, 2020, 10:11:25 AM2/20/20
to fullrmc
I may be wrong about pathlib2 being in the standard library, but it is definitely viable for back-supporting Path objects in Python 2.
Rob

Bachir Aoun

unread,
Feb 20, 2020, 11:20:07 AM2/20/20
to fullrmc
I hear you. you are right i just checked, pathlib exist in python2 and i don't think it was installed by a library i use neither ...
what i can do to accommodate your workflow is to cast all paths as string internally in fullrmc so you don't have to cast it yourself. 
How does that sound? does it solve your issues ?


Robert Koch

unread,
Feb 20, 2020, 11:23:56 AM2/20/20
to fullrmc
That seems like a lot of work for you to accomodate me avoiding 3 extra characters and some parens...but if you're willing, it would be appreciated.

Like I said, I'm also willing to fork the project and work on it, do you usually look at pull requests?

Bachir Aoun

unread,
Feb 20, 2020, 11:31:42 AM2/20/20
to fullrmc
fullrmc is open sourced or at least most of it except a couple of libraries. 
I have a private repo for fullrmc and the one you see on github is kept clean for version pushes. For instance my own current version is 5 with a lot of changes in it that you can't see as a user not having access to my private repo. 

What we can do if you like, we can setup a 30 min call, you can explain to me what you need to make your life easier and i will be more than happy to make it happen for you.


Robert Koch

unread,
Feb 21, 2020, 9:00:42 AM2/21/20
to fullrmc
No worries, I can work with it as is, no need to create extra work for us.  Thanks for your willingness though!

cheers,
Rob
Reply all
Reply to author
Forward
0 new messages