omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    .numbers file seen as a folder by dialogs.pick_document

    Pythonista
    2
    5
    2315
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cvp
      cvp last edited by

      Since 3 weeks, dialogs.pick_document sees a .numbers file as a folder, no more as a file, and shutil.copy does not work anymore. I don't' have installed the last update of ios12, thus nothing new this month.
      I know that .numbers files are zipped folders in reality but why this change?
      If I import the .numbers file via appex, it is still seen as a file.

      1 Reply Last reply Reply Quote 0
      • cvp
        cvp last edited by

        Additional info:

        fil = dialogs.pick_document(types=['public.item'])		
        

        Returns a folder

        	fil = dialogs.pick_document(types=['com.apple.iwork.numbers.sffnumbers'])
        

        Returns a file

        1 Reply Last reply Reply Quote 0
        • ccc
          ccc last edited by

          numbers is a Standard Library module: https://docs.python.org/3/library/numbers.html To avoid name collision, can you try a different name for your file?

          cvp 1 Reply Last reply Reply Quote 0
          • cvp
            cvp @ccc last edited by cvp

            @ccc .numbers only appears between quotes in my script, thus no collision, I think.
            And the same script, unchanged, has worked until 2 weeks ago.
            I think that Apple changes some UTI sometimes.

            Edit: .numbers only appears in the fil = dialogs.... line

            Edit: and my file is named xxx.numbers because it is a Numbers spread sheet file

            1 Reply Last reply Reply Quote 0
            • cvp
              cvp last edited by cvp

              Today, after upgrade to iOS 12.1.1,

              	fil = dialogs.pick_document(types=['com.apple.iwork.numbers.sffnumbers'])
              

              shows .numbers files as grayed, thus not pickable...
              Apple does some changes without warning users. 😢

              and

              	fil = dialogs.pick_document(types=['public.item'])		
              

              returns a file, no more a folder.
              Thus, they had a bug but they never did speak about it.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors