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

Error: (AttributeError) "'array.array' object has no attribute 'tostring'" (compile step) #213

Closed
m-alice opened this issue May 3, 2021 · 8 comments

Comments

@m-alice
Copy link

m-alice commented May 3, 2021

nmlc ERROR: nmlc: An internal error has occurred: nmlc-version: 0.5.3 Error: (AttributeError) "'array.array' object has no attribute 'tostring'". Command: ['C:\\Users\\user\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\Scripts\\nmlc', '-c', '--grf', 'ogfx_ufo.grf', 'ogfx_ufo.nml', '-n'] Location: File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nml\lz77.py", line 28, in _encode

Python 3.9.4 (from ms store)
Windows 10 pro 19041.928
Wheel 0.36.2 (i don't know, it is needed?)

I just want to practice and set prices for UFO grf.

@LordAro
Copy link
Member

LordAro commented May 3, 2021

stream = data.tostring()

fallback module doing the wrong thing with types?

@glx22
Copy link
Contributor

glx22 commented May 3, 2021

Adding -s parameter to your nmlc command will give more details

@m-alice
Copy link
Author

m-alice commented May 3, 2021

nmlc -c --grf ..\..\ogfx_ufo.grf ogfx_ufo.nml -n -s  1>log.txt
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts\nmlc.exe\__main__.py", line 7, in <module>
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nml\main.py", line 421, in run
    main(sys.argv[1:])
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nml\main.py", line 170, in main
    ret = nml(input, input_filename, opts.debug, outputs, opts.start_sprite_num, opts.compress, opts.crop, opts.forced_palette, opts.md5_filename, opts.rebuild_parser, opts.debug_parser)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nml\main.py", line 365, in nml
    encoder.open(sprite_files)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nml\spriteencoder.py", line 124, in open
    size_x, size_y, xoffset, yoffset, compressed_data, info_byte, crop_rect, pixel_stats = self.encode_sprite(sprite_info)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nml\spriteencoder.py", line 332, in encode_sprite
    compressed_data = self.sprite_compress(sprite_data)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nml\spriteencoder.py", line 363, in sprite_compress
    stream = lz77.encode(data)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nml\lz77.py", line 28, in _encode
    stream = data.tostring()
AttributeError: 'array.array' object has no attribute 'tostring'

@glx22
Copy link
Contributor

glx22 commented May 3, 2021

Ok, it seems some parts of nmlc are broken with python 3.9.

@glx22
Copy link
Contributor

glx22 commented May 3, 2021

As a workaround, the standalone executable available here should run fine.

@m-alice
Copy link
Author

m-alice commented May 3, 2021

Standalone works fine, thx!

@m-alice
Copy link
Author

m-alice commented May 4, 2021

Maybe this will be informative:
https://bugs.python.org/issue38916
python-intelhex/intelhex#45

@LordAro
Copy link
Member

LordAro commented May 4, 2021

Fixed in #215

@LordAro LordAro closed this as completed May 4, 2021
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

No branches or pull requests

3 participants