Do not replace the os.sep #188
-
Why is there a change to / as separator? This will be strange on Windows. Line 141 in af07f16 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
This is done because python treats forward slashes as an alternative separator. Thus if you're using python's file APIs, they have the same results. Plus, since python's strings are always backslash-escaped (unless they're |
Beta Was this translation helpful? Give feedback.
-
Btw, only marked this as a "wontfix" due to it not appearing to be a bug and rather just a question that's likely better placed under "Discussions" (despite nobody using that shit). To be clear, I don't mind answering questions here though. So don't let that deter you. |
Beta Was this translation helpful? Give feedback.
-
I understand that using a literal \ in strings in Python has to be escaped (or the string can be r prefixed) but in this context it doesn't matter as the string containing the \ character wont cause any problems. |
Beta Was this translation helpful? Give feedback.
-
Still, its purpose is to normalize the database path. This is useful when you're emitting a path cross-platform and is purely so that you concatenate or split the path without having to depend on a module. This is useful when you attach a python script to a database that serializes all your changes to a directory that is relative to the location of your database. This enables that same script to work regardless of the platform it is running on and allows you to avoid depending on anything within the Since it doesn't cause any issues with the Python interpreter on the windows platform, I'm still unsure about its strangeness and how it directly affects your scripts. |
Beta Was this translation helpful? Give feedback.
Still, its purpose is to normalize the database path. This is useful when you're emitting a path cross-platform and is purely so that you concatenate or split the path without having to depend on a module. This is useful when you attach a python script to a database that serializes all your changes to a directory that is relative to the location of your database. This enables that same script to work regardless of the platform it is running on and allows you to avoid depending on anything within the
os
module.Since it doesn't cause any issues with the Python interpreter on the windows platform, I'm still unsure about its strangeness and how it directly affects your scripts.