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

[BUG] .pyc files needs to be deleted before running this project. #150

Open
Kashish121 opened this issue Mar 13, 2021 · 10 comments
Open

[BUG] .pyc files needs to be deleted before running this project. #150

Kashish121 opened this issue Mar 13, 2021 · 10 comments
Assignees
Labels

Comments

@Kashish121
Copy link
Collaborator

An issue occurs when you first try to run the CLI through Python2. This results in creation of Python2 *.pyc files on the local machine. After this if the those files are not deleted and on running Flask UI through Python3 (which uses old Python2 *.pyc file), we get the above error.

*.pyc files interfere with normal working of the project.

This issue can be solved by deleting the *.pyc files from the repository folder from the local machine.
Refer to this issue thread for details.

Expected behavior - Delete all the *.pyc files automatically before running the project.

@palrohitg
Copy link

@Kashish121 Currently on working on that too.

@Kashish121
Copy link
Collaborator Author

@palrohitg assigning it to you. Submit the corresponding PR by tomorrow EOD.

@palrohitg
Copy link

@Kashish121 I generated the PR #148 and their is no issue while running the flask server for branch features/python3.8 I am using the python3.8 to run the server.
For this issue I need to do checkout what the issue is actually while using python2 and then discussion on further.
But I think this is not the potential bug for branch features/python3.8 because it clearly mention this branch is for developer who is working with python3. Need to know what do u think?

@palrohitg
Copy link

@Kashish121 I checkout in my local environment once you had python virutalenv activated then there is no issue.
It pretty sure, if you are working with python3 env but trying to run the server will be some package which is deprected by python2

image

@Kashish121
Copy link
Collaborator Author

So, this happens for users who use python2.x and python3.x without a virtual environment setup.

It would still be preferable to remove all the *.pyc files generated during/after execution.
@palrohitg you can move forward with writing a piece of code for the same.

Avoiding any possible scope of bug would be a better decision for now.

@Kashish121
Copy link
Collaborator Author

@palrohitg , checking for status of work here?

@jaiongit
Copy link

@Kashish121 What I'm thinking for this issue is that instead of deleting those generated *.pyc files we should prevent their generation in the first place.

@Kashish121
Copy link
Collaborator Author

@Kashish121 What I'm thinking for this issue is that instead of deleting those generated *.pyc files we should prevent their generation in the first place.

Please expand on this.

@jaiongit
Copy link

jaiongit commented Mar 15, 2021

We can set dont_write_bytecode of sys moduletoTrue`. I can create a PR for the same.

@Kashish121
Copy link
Collaborator Author

We can set dont_write_bytecode of sys moduletoTrue`. I can create a PR for the same.

Sure! go ahead. 👍🏽

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

4 participants