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

Clone Repository Failed #7761

Closed
JaydaB99 opened this issue Nov 20, 2023 · 4 comments
Closed

Clone Repository Failed #7761

JaydaB99 opened this issue Nov 20, 2023 · 4 comments
Assignees

Comments

@JaydaB99
Copy link

Describe the bug
[A clear and concise description of the bug]
When I try to clone a previous project in python, no code shows up and instead shows "An unexpected error occurred".
Steps to Reproduce
1.
2.
3.

Expected behavior
[A clear and concise description of your expectation]
I expected the code to reappear again with no errors.

Additional context and screenshots
[Add any other information such as screenshots, error message, or stack trace]

Sample Code
[Window Title]
devenv.exe

[Main Instruction]
An unexpected error occurred

[Content]
Please press Ctrl+C to copy the contents of this dialog and report this error to our issue tracker.

[^] Hide details [Close]

[Expanded Information]

Build: 17.0.23189.3

System.ObjectDisposedException: Cannot access a disposed object.
   at Microsoft.VisualStudioTools.Project.ProjectNode.GetMsBuildProperty(String propertyName, Boolean resetCache)
   at Microsoft.VisualStudioTools.Project.ProjectNode.GetProjectProperty(String propertyName, Boolean resetCache)
   at Microsoft.PythonTools.Project.CondaEnvCreateProjectInfoBar.<CheckAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PythonTools.Infrastructure.VSTaskExtensions.<HandleAllExceptions>d__5.MoveNext()
@StellaHuang95
Copy link
Contributor

Hi there, thanks for reporting the issue. Would it be possible for you to provide code samples for us to repro? Right now I am not able to repro the crash with your repro steps. Could you also provide your conda environments? Reading from the stack traces seems like an issue with conda.

@JaydaB99
Copy link
Author

with open("movies.txt", "w") as file:
file.write("Cat on a Hot Tin Roof\nOn the Waterfront\nMonty Python and the Holy Grail\n")

def populate_list(file_name):
movie_list = []
with open(file_name, "r") as file:
for line in file:
movie_list.append(line.strip())
return movie_list

def display_menu():
print("\nMovie list menu")
print()
print("COMMAND MENU")
print("list --> List all movies")
print("add --> Add a movie")
print("del --> Delete a movie")
print("exit --> Exit program")
print()

def display_titles(movie_list):
print("\nMovie Titles:")
for idx, title in enumerate(movie_list, start=1):
print(f"{idx}. {title}")

def add_title(movie_list, title, file_name):
movie_list.append(title)
with open(file_name, "a") as file:
file.write(title + "\n")
print(f"\n[title] has been added to the list")

def delete_title(movie_list, index, file_name):
if 1 <= index <= len(movie_list):
deleted_title = movie_list.pop(index - 1)
with open(file_name, "w") as file:
file.write("\n".join(movie_list))
print(f"\n {deleted_title} has been deleted from the list")
else:
print("Invalid index number. No movie was deleted")

def main():
movie_file = "movies.txt"
movie_list = populate_list(movie_file)

while True:
    display_menu()
    choice = input("Enter your choice: ")
    
    if choice == "list":
        display_titles(movie_list)
    elif choice == "add":
        new_title = input("Enter the new movie title:")
        add_title(movie_list, new_title, movie_file)
        display_titles(movie_list)
    elif choice == "delete":
        display_titles(movie_list)
        index = int(input("Enter the number of the movie title you would like to delete:"))
        delete_title(movie_list, index, movie_file)
        display_titles(movie_list)
    elif choice == "exit":
        print("Existing program")
        break
    else:
        print("Invalid chhoice, please try again")

if name == "main":
main()

@StellaHuang95
Copy link
Contributor

Thanks for your response, just to make sure I am not misinterpreting here, when you say "clone the project", did you mean copy and paste the project folder? or were you doing a git clone? Also, did you also clone your conda environment?

@StellaHuang95
Copy link
Contributor

Going to close this out. If the issue still persists, please reopen with the information requested. Thanks.

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

No branches or pull requests

2 participants