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

SC2READER_CACHE_MAX_SIZE should be a string, not an integer #114

Open
GBathie opened this issue Mar 9, 2020 · 3 comments
Open

SC2READER_CACHE_MAX_SIZE should be a string, not an integer #114

GBathie opened this issue Mar 9, 2020 · 3 comments
Labels

Comments

@GBathie
Copy link

GBathie commented Mar 9, 2020

The example (in the readme) suggests to write os.environ['SC2READER_CACHE_MAX_SIZE'] = 100. This does not work (at least for me, Python 3.6.9) : environment variables are supposed to be strings (throws a TypeError).

When set to string, this causes an error in sc2reader because of a comparison between a string and an integer (sc2factory.py line 315).

@cclauss
Copy link
Collaborator

cclauss commented Mar 9, 2020

Does os.environ['SC2READER_CACHE_MAX_SIZE'] = '100' work?

@GBathie
Copy link
Author

GBathie commented Mar 9, 2020

It does not, I get a TypeError from sc2reader:

File ".../.local/lib/python3.6/site-packages/sc2reader/factories/sc2factory.py", line 315, in cache_set
    if self.cache_max_size and len(self.cache_dict) >= self.cache_max_size:
TypeError: '>=' not supported between instances of 'int' and 'str'

@cclauss
Copy link
Collaborator

cclauss commented Mar 9, 2020

Please search for SC2READER_CACHE_MAX_SIZE and wrap it in int() whenever we get it.

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

No branches or pull requests

3 participants