Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8606643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:08:48+00:00 2026-06-12T03:08:48+00:00

I need to open an manifest.v3 file and read the version field (xml file),

  • 0

I need to open an manifest.v3 file and read the version field (xml file), and to do that I’m using the following code:

from zipfile import ZipFile
zf = ZipFile("somezip.zip")
for name in zf.namelist():
    if name.find("manifest.v3")  >= 0:
        for line in zf.read(name).split("\n"):
            for match in  re.findall(r'<value name="version">([0-9].*?)</value>',line):
                parts=match.split(".")
                localVersion=parts[1]
                print localVersion
zf.close()

The code above works good, but sometimes on the zipfile i have the manifest.v3 file and manifest.v3.old, manifest.v3.old.old and so on.

How can I guarantee that I only get the result of the manifest.v3 file? instead all others?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:08:50+00:00Added an answer on June 12, 2026 at 3:08 am

    try by changing the condition name.find("manifest.v3") >= 0 to name == "manifest.v3"

    Added a few examples below

    In [181]: name = "manifest.v3"
    
    In [182]: name.find("manifest.v3") >= 0
    Out[182]: True
    
    In [183]: name = "manifest.v3.old.old"
    
    In [184]: name.find("manifest.v3") >= 0
    Out[184]: True
    
    In [185]: name == "manifest.v3"
    Out[185]: False
    
    In [186]: name = "manifest.v3"
    
    In [187]: name == "manifest.v3"
    Out[187]: True
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to open a new window from code-behind on post-back if a specific
i need open the project exe file from inside the visual studio 2008
I need to open a browser tab from a link that is given to
I need to open and read a Dbase file in my ASP.NET application. When
I need to open a log file for writing. Trouble is, many things may
I need to Open a process (easy) and then somehow paste data from my
I need to open a link from within jQuery but i need to avoid
I need to open a FrmEscalacao that sends information of FrmAdmin to FrmEscalacao with
In my RAD, when I open up the MANIFEST.MF file for an ejb project,
I need open source database that I can ship with my commercial application. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.