Allow for case-sensitive systems to parse from a folder
OlavStornes opened this issue · comments
Hi! Stumbled upon this package when i was scouting for some inspiration on parsers for fomod.
When attempting to parse a package with the first option, pyfomod assumes that the filename is moduleconfig.xml
, which works fine in a case-insensitive file-system. However, when doing the same in a case-sensitive file-system (such as a file-system often used in linux), this fails.
Example
>>> x = pyfomod.parse(".")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/{REDACTED}/.local/lib/python3.10/site-packages/pyfomod/parser.py", line 272, in parse
raise FileNotFoundError(
FileNotFoundError: [Errno 2] No such file or directory: 'moduleconfig.xml'
>>> x = pyfomod.parse(("./fomod/info.xml", "./fomod/ModuleConfig.xml"))
>>> x
<pyfomod.fomod.Root object at 0x7f12de46f880>
>>>
This library is mainly aimed at Windows (even if I am a Linux user myself)
since that's what most mod manager support is at (unless the landscape has
significantly changed), which makes this a low priority bug, especially if
there is a simple workaround as you specify.
I *will *get around to fixing that however, so thanks for the report! Hope
you find the package useful
…On Mon, 21 Feb 2022 at 15:19, OlavStornes ***@***.***> wrote:
Hi! Stumbled upon this package when i was scouting for some inspiration on
parsers for fomod.
When attempting to parse a package with the first option, pyfomod assumes
that the filename is moduleconfig.xml, which works fine in a
case-insensitive file-system. However, when doing the same in a
case-sensitive file-system (such as a file-system often used in linux),
this fails.
Example
>>> x = pyfomod.parse(".")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/{REDACTED}/.local/lib/python3.10/site-packages/pyfomod/parser.py", line 272, in parse
raise FileNotFoundError(
FileNotFoundError: [Errno 2] No such file or directory: 'moduleconfig.xml'
>>> x = pyfomod.parse(("./fomod/info.xml", "./fomod/ModuleConfig.xml"))
>>> x<pyfomod.fomod.Root object at 0x7f12de46f880>
>>>
—
Reply to this email directly, view it on GitHub
<#12>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACOZBTYXUFDIUOGGLCLIXCDU4JJZJANCNFSM5O64OQTQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Appreciate your response. I agree that this shouldn't be a big priority, especially if it's main usage is on windows.
Cheers!