Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening a simfile fails with latest msdparser (2.0.0b3) #12

Closed
wermipls opened this issue Apr 6, 2022 · 3 comments · Fixed by #15
Closed

Opening a simfile fails with latest msdparser (2.0.0b3) #12

wermipls opened this issue Apr 6, 2022 · 3 comments · Fixed by #15
Assignees

Comments

@wermipls
Copy link

wermipls commented Apr 6, 2022

Downgrading to msdparser==2.0.0b1 seems to resolve the issue for me.

Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec  7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import simfile
>>> simfile.open("Xuxa.sm")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\w\AppData\Local\Programs\Python\Python39\lib\site-packages\simfile\__init__.py", line 89, in open
    return open_with_detected_encoding(
  File "C:\Users\w\AppData\Local\Programs\Python\Python39\lib\site-packages\simfile\__init__.py", line 137, in open_with_detected_encoding
    return (load(file, strict=strict), encoding)
  File "C:\Users\w\AppData\Local\Programs\Python\Python39\lib\site-packages\simfile\__init__.py", line 63, in load
    is_ssc = _detect_ssc(peek_file)
  File "C:\Users\w\AppData\Local\Programs\Python\Python39\lib\site-packages\simfile\__init__.py", line 46, in _detect_ssc
    for first_key, _ in parser:
  File "C:\Users\w\AppData\Local\Programs\Python\Python39\lib\site-packages\msdparser\__init__.py", line 202, in parse_msd
    for token, value in lex_msd(
  File "C:\Users\w\AppData\Local\Programs\Python\Python39\lib\site-packages\msdparser\__init__.py", line 366, in lex_msd
    chunk = textio.read(4096)
  File "C:\Users\w\AppData\Local\Programs\Python\Python39\lib\site-packages\simfile\_private\tee_file.py", line 13, in __getattr__
    return getattr(self._file, name)
AttributeError: 'itertools._tee' object has no attribute 'read'
@garcia
Copy link
Owner

garcia commented Apr 6, 2022

Thanks for flagging, and sorry about the breakage! I should have a simfile 2.1 beta out soon that plays nice with the msdparser beta.


In case anyone else encounters this: simfile 2.0 still uses msdparser 1.0 under the hood, and switching to the 2.0 beta isn't officially supported. Read here for more information on why you would want to switch to msdparser 2.0.0b1.

@garcia
Copy link
Owner

garcia commented Apr 6, 2022

Not quite ready to commit to a new beta release yet, but I put up a PR at #13 that fixes compatibility with the latest msdparser beta.

@garcia
Copy link
Owner

garcia commented Apr 20, 2022

I found out more recently that this was affecting people who did not explicitly install the msdparser beta. This is actually a bug in how the dependency was specified in simfile 2.0.0, so a new patch will be out shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants