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

LCSC Part Saving Fails #157

Closed
ScaredyCat opened this issue May 19, 2023 · 4 comments · Fixed by #169
Closed

LCSC Part Saving Fails #157

ScaredyCat opened this issue May 19, 2023 · 4 comments · Fixed by #169
Labels
bug Something isn't working

Comments

@ScaredyCat
Copy link

ScaredyCat commented May 19, 2023

I'm working through some of my parts and some of them keep failing, some are perfectly fine.

All my parts are currently coming from LCSC. It seems that the adding to InvenTree fails with

[TREE] Successfully connected to InvenTree server (ENV=DEVELOPMENT) Exception in thread Thread-471: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/andy/kin/env-kintree/lib/python3.8/site-packages/kintree/gui/views/main.py", line 1196, in create_part new_part, part_pk, part_info = inventree_interface.inventree_create( File "/home/andy/kin/env-kintree/lib/python3.8/site-packages/kintree/database/inventree_interface.py", line 494, in inventree_create inventree_part = translate_form_to_inventree( File "/home/andy/kin/env-kintree/lib/python3.8/site-packages/kintree/database/inventree_interface.py", line 285, in translate_form_to_inventree parameter_value = part_tools.clean_parameter_value( File "/home/andy/kin/env-kintree/lib/python3.8/site-packages/kintree/common/part_tools.py", line 138, in clean_parameter_value second_value = split_space[2] IndexError: list index out of range

Example of content returned from the part lookup, eg https://wmsc.lcsc.com/wmsc/product/detail?productCode=C86781 that causes problems. I there some extra try/catch method that could help fix this?

@ScaredyCat
Copy link
Author

I'm wondering is it's to do with non-ascii characters in the output, but don't let this mislead anyone, it's a guess.

@eeintech
Copy link
Contributor

eeintech commented Jun 4, 2023

Hello @ScaredyCat Is it happening for all LCSC parts or only this one example?

@eeintech eeintech added the bug Something isn't working label Jun 4, 2023
@ScaredyCat
Copy link
Author

ScaredyCat commented Jun 4, 2023

There are other examples of it. A lot work fine some just fail with that error.

Here are some examples of failing part numbers:

C2843785
C134077
C51118

The initial data is fetched (pic1) but the import fails (pic2)

pic1

pic2

@clj
Copy link

clj commented Jun 12, 2023

I think I ran into this as well, I seem to recall it being because the temperature range in the parameters from LCSC for some components are specified as n-n but the code that parses it expected there to be spaces around the hyphen, e.g.: n - n.

eeintech added a commit that referenced this issue Aug 4, 2023
@eeintech eeintech mentioned this issue Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants