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

Traceback when running the script #119

Closed
BaktashGorgani opened this issue Dec 8, 2023 · 2 comments
Closed

Traceback when running the script #119

BaktashGorgani opened this issue Dec 8, 2023 · 2 comments

Comments

@BaktashGorgani
Copy link

It doesn't seem to do anything for me but fail right away. I am fairly new to Netbox though so I would appreciate any assistance.

$./nb-dt-import.py
Package devicetype-library is already installed, updating C:\Users\baky\Git\tests\nornir\Device-Type-Library-Import/repo
114 Vendors Found
Traceback (most recent call last):
  File "C:\Users\baky\Git\tests\nornir\Device-Type-Library-Import\nb-dt-import.py", line 54, in <module>
    main()
  File "C:\Users\baky\Git\tests\nornir\Device-Type-Library-Import\nb-dt-import.py", line 22, in main
    device_types = settings.dtl_repo.parse_files(files, slugs=args.slugs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\baky\Git\tests\nornir\Device-Type-Library-Import\repo.py", line 90, in parse_files
    data = yaml.safe_load(stream)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\baky\Git\tests\nornir\Device-Type-Library-Import\venv\Lib\site-packages\yaml\__init__.py", line 125, in safe_load
    return load(stream, SafeLoader)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\baky\Git\tests\nornir\Device-Type-Library-Import\venv\Lib\site-packages\yaml\__init__.py", line 79, in load
    loader = Loader(stream)
             ^^^^^^^^^^^^^^
  File "C:\Users\baky\Git\tests\nornir\Device-Type-Library-Import\venv\Lib\site-packages\yaml\loader.py", line 34, in __init__
    Reader.__init__(self, stream)
  File "C:\Users\baky\Git\tests\nornir\Device-Type-Library-Import\venv\Lib\site-packages\yaml\reader.py", line 85, in __init__
    self.determine_encoding()
  File "C:\Users\baky\Git\tests\nornir\Device-Type-Library-Import\venv\Lib\site-packages\yaml\reader.py", line 124, in determine_encoding
    self.update_raw()
  File "C:\Users\baky\Git\tests\nornir\Device-Type-Library-Import\venv\Lib\site-packages\yaml\reader.py", line 178, in update_raw
    data = self.stream.read(size)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 344: character maps to <undefined>
@ndom91
Copy link
Contributor

ndom91 commented Jan 2, 2024

This seems like a windows specific issue. Check out the python script someone has added for windows users specifically. Unfortunately the PR is still open, but you can pull it out of there already if you want - #86

@BaktashGorgani
Copy link
Author

Hey thanks @ndom91 ! I'll take a look at it when I have a chance.

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

2 participants