Openshot-qt: Cannot open properly just saved project

Created on 14 Feb 2020  路  11Comments  路  Source: OpenShot/openshot-qt

小薪懈屑芯泻 褝泻褉邪薪邪 芯褌 2020-02-14 18-00-18
test.osp.zip

Describe the bug
Cannot open just saved project. Got a message: "file_name.MTS not found".

Steps to reproduce the behavior:

  1. Start the OpenShot
  2. Go to "Project files"
  3. Right-click "Import files"
  4. Select a file
  5. Click "Open" button
  6. Go to "File -> Save project"
  7. Enter the project name ( "test.osp for example)
  8. Click "Save"
  9. Close OpensShot
  10. Start OpenShot
  11. Go to "Open Project"
  12. Choose the project ( "test.osp for example)
  13. Click "Open" button
  14. See error: "file_name.MTS not found".

Expected behavior
The project should open without errors.

System Details

Log Files

Exception / Stacktrace
No stacktrace found in log files

Screenshots (Optional)
If applicable, add screenshots to help explain your problem. You can include screenshots by
copy/pasting them on GitHub or dragging-and-dropping into the GitHub page. All images are public,
so please don't post screenshots containing personal information.

All 11 comments

This issue is connected to localized file names. If a file structure consists only English characters - the project opens without errors.

Can confirm - it happens on Windows too. Only English letters supported. Regression since v2.4.4.

Edit:
File name for tests (can be used as folder's name as well):
褎邪泄谢 褋 锌褉芯斜械谢芯屑.mp4

The json.dumps() converts data by some reason:

https://github.com/OpenShot/openshot-qt/blob/e247a9be079a3628fa046a0f45f2d2825d9aec55/src/classes/json_data.py#L148

every symbol in the file after this line of code is converted instead of simply being formatted.

Edit:
Next issue is in the conversion code:

https://github.com/OpenShot/openshot-qt/blob/e247a9be079a3628fa046a0f45f2d2825d9aec55/src/classes/json_data.py#L258

There were number of attempts from the developer to broke the Python routines in favor of its own.
Right now I don't see other solution but to force everything to utf-8 encoding during writing and reading and eliminate excessive regular expression operations form the code. This will lead to profile reset and users should set their OpenShot preferences again. It is clear that project files not interchangeable between platforms. No sense to keep this compatibility.

The regex was added to find and replace file paths, so all paths are saved and loaded relative, even in history data. The fact this breaks UTF-8 support is bad though. Let me investigate.

@SuslikV In my testing, your PR does not resolve the issue for me. I created a new PR though, with changes that fix the problem in my testing. I'm going to more extensively test it tomorrow on Mac and Windows, and ensure everything still works there too. I also feel like your statement There were number of attempts from the developer to broke the Python routines in favor of its own. is a bit aggressive and unfair. I introduced 1 regular expression, using the official Python regex module, to solve a very large issue with absolute paths in history crashing OpenShot. Let's be nice please.

It is hard to be nice.

Nobody's code is perfect, including mine. Sometimes, the fixes introduces even more errors.

@jonoomph

In my testing, your PR does not resolve the issue for me

Does your fix backward compatible with the v2.4.4? I mean, is it possible to load the project file saved in v2.5.0, from the v2.4.4? (I had troubles while performed some tests of the new fix ( https://github.com/OpenShot/openshot-qt/pull/3247 ), so I don't know if it works)

How we treat each other is very important to me. Using harsh accusatory language is against our Code of Conduct on OpenShot, and in general, I would never want for people to feel attacked when trying to contribute to this project.

I do appreciate your PR though (https://github.com/OpenShot/openshot-qt/pull/3229), and it does seem to solve the issue for me now. It is a safer approach than the PR I submitted, and I think we should merge it, and let some people verify the fix using our daily build. How does that sound?

In the next hour (or so), the new build should show up on our daily builds: https://www.openshot.org/download/#daily. Please help to verify that this solves this issue, and share your results here. Thx!

@jonoomph OK. I will try to be polite. Sometimes it is just difficult. It's not about you - it's about the life. My apologies if something went wrong.

@jonoomph Thank you, Jonathan! Thank you, @SuslikV ! This build (OpenShot-v2.5.0-dev1-1582756416-689f1e18-836e49fa-x86_64.AppImage) works fine with Russian characters. I created a simple project, saved it and opened it without any mistakes. Good done! Thanks so much! OpenShot is my primary video tool! :-)

@hitrome Glad to hear it! I'm going to start preparing a new release branch.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Emma3993 picture Emma3993  路  3Comments

LadyReader picture LadyReader  路  3Comments

ppkakkar picture ppkakkar  路  3Comments

BofingerRick picture BofingerRick  路  3Comments

Geoff0627 picture Geoff0627  路  3Comments