dave-howard / vsdx

vsdx - A python library for processing .vsdx files
BSD 3-Clause "New" or "Revised" License
67 stars 25 forks source link

after copy_page and save_vsdx new file do not open in Visio #23

Closed Vladimir-Ilyin closed 3 years ago

Vladimir-Ilyin commented 3 years ago

Hello!

after copy_page and save_vsdx new file do not open in Visio: internal Visio error #3400 i use pytest test.py::test_copy_page and error occurs even with test files

dave-howard commented 3 years ago

Hi there - that test is passing in automated tests (see Actions tab in this repo), for python 3.7, 3.8 and 3.9 - I know if fails for 3.6 and not tested for 3.10. I've not come across that error previously, Can you help me recreate the problem?

Vladimir-Ilyin commented 3 years ago

Hello!

Yes, test is passed for me too, but result file is not readable in Visio 2016 my platform win32 -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 try to open the result in Visio 2016, did You can open it? What version of Visio Your installed?

dave-howard commented 3 years ago

Good point, passing test != file working in Visio :) - that's a pretty important limitation of the test suite

I also have Visio 2016, Windows 10, Python 3.8 - however, the five output files from that test do open fine for me.

I wouldn't have thought Python 3.8 vs 3.9 would have impacted output files, but maybe I should test that assumption

dave-howard commented 3 years ago

Follwing test, same result in v3.9 also

Vladimir-Ilyin commented 3 years ago

Hello!

I tried to open test files in two different machines with the same error result in attaching my test file from pytest run, is it ok for You?

сб, 7 авг. 2021 г. в 11:11, Dave Howard @.***>:

Follwing test, same result in v3.9 also

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dave-howard/vsdx/issues/23#issuecomment-894622997, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE465KBKT3PNGQXGASJ4USDT3TTE7ANCNFSM5BVZN6QQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

Vladimir-Ilyin commented 3 years ago

here is my Visio file from pytest.py test.py::test_copy_page https://github.com/Vladimir-Ilyin/vsdx/blob/05c04e55729e7e7334d9b90f6b3781f65e8e5c4f/test1_test_copy_page_Page-1.vsdx

Vladimir-Ilyin commented 3 years ago

for me the error is in docProps/app.xml

i remove all lines with new pages names in ns1:lpstr and then file opened in Visio 2016

dave-howard commented 3 years ago

I am able to open that file - is that link the original file output or your fixed version?

Vladimir-Ilyin commented 3 years ago

In link original output file, not fixed

Сб, 7 авг. 2021 г. в 14:40, Dave Howard @.***>:

I am able to open that file - is that link the original file output or your fixed version?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dave-howard/vsdx/issues/23#issuecomment-894643327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE465KHPCOOPIHYBBQHG5UDT3ULRFANCNFSM5BVZN6QQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

--

-- С уважением Владимир Ильин +7(967)172-40-30

dave-howard commented 3 years ago

Strange that I do not get the same error in that case. I did a very brief bit of googling on Visio error #3400 and one of the common threads is OneDrive Sync'ing. So perhaps worth trying to ue the file from a non-sync'ed location (i.e. downloads) to ensure that is not a factor. Other question I had was whether this problem occurs for all five output files for that pytest test.py::test_copy_page test?

stevensultana commented 3 years ago

When manually copying a page, the app.xml file has a change in the HeadingPairs element, apart from the TitlesOfParts elements.

I wonder, if in the output file you manually change this part of app.xml:

    <ns0:HeadingPairs>
        <ns1:vector size="2" baseType="variant">
            <ns1:variant>
                <ns1:lpstr>Pages</ns1:lpstr>
            </ns1:variant>
            <ns1:variant>
                <ns1:i4>3</ns1:i4>
            </ns1:variant>
        </ns1:vector>
    </ns0:HeadingPairs>

To this, does it improve the situation:

    <ns0:HeadingPairs>
        <ns1:vector size="2" baseType="variant">
            <ns1:variant>
                <ns1:lpstr>Pages</ns1:lpstr>
            </ns1:variant>
            <ns1:variant>
                <ns1:i4>4</ns1:i4>   <--- note change here
            </ns1:variant>
        </ns1:vector>
    </ns0:HeadingPairs>
Vladimir-Ilyin commented 3 years ago

Hi Steven!

Yes, when change to relevant value of pages it also work fine! Thank You very much!

Vladimir-Ilyin commented 3 years ago

Strange that I do not get the same error in that case. I did a very brief bit of googling on Visio error #3400 and one of the common threads is OneDrive Sync'ing. So perhaps worth trying to ue the file from a non-sync'ed location (i.e. downloads) to ensure that is not a factor. Other question I had was whether this problem occurs for all five output files for that pytest test.py::test_copy_page test?

Yes, i have same problem with all five files

Solution by Steven is work too

stevensultana commented 3 years ago

Awesome, let me submit a PR :)

dave-howard commented 3 years ago

Thanks Steven :)