UserWarning: Duplicate name
See original GitHub issueI am experiencing a similar issue as #572
I am including PyPDF2 as a dependency in my Chalice project. Since there is no wheel available for it, I had to build it myself and add it to the vendor/ directory, as described in the docs.
Every time I deploy chalice I get the following warnings:
Regen deployment package.
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/DESCRIPTION.rst'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/top_level.txt'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/METADATA'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/WHEEL'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/metadata.json'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2-1.26.0.dist-info/RECORD'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/pagerange.py'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/xmp.py'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/utils.py'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/merger.py'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/pdf.py'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/filters.py'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/_version.py'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/__init__.py'
return self._open_to_write(zinfo, force_zip64=force_zip64)
/usr/lib/python3.6/zipfile.py:1355: UserWarning: Duplicate name: 'PyPDF2/generic.py'
return self._open_to_write(zinfo, force_zip64=force_zip64)
However when testing my deployed Lambda functions, PyPDF2 works without any problems. ๐
This is how my vendor/ directory looks like:
vendor/
โโโ PyPDF2
โย ย โโโ __init__.py
โย ย โโโ _version.py
โย ย โโโ filters.py
โย ย โโโ generic.py
โย ย โโโ merger.py
โย ย โโโ pagerange.py
โย ย โโโ pdf.py
โย ย โโโ utils.py
โย ย โโโ xmp.py
โโโ PyPDF2-1.26.0.dist-info
โโโ DESCRIPTION.rst
โโโ METADATA
โโโ RECORD
โโโ WHEEL
โโโ metadata.json
โโโ top_level.txt
2 directories, 15 files
Would really appreciate some help on how to get rid of these warnings, as they are very annoying.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
python zip file hit userwarning: Duplicate name - Stack Overflow
The duplicate name warning comes from the input directory files, of the same name, all being written to the same place of the...
Read more >Suppressing ZipFile duplication warning ยท Issue #129 - GitHub
Python's ZipFile allows writing duplicate files and does this by default. When it writes a duplicate file, it raises a UserWarning .
Read more >Issue 2824: zipfile to handle duplicate files in archive
We just stumbled across this bug in our code at work where we accidentally put multiple files of the same name into the...
Read more >mutablezip - PyPI
C:\Python310\lib\zipfile.py:1506: UserWarning: Duplicate name: 'foo.txt' return self._open_to_write(zinfo, force_zip64=force_zip64). With mutablezip:
Read more >13.5. zipfile โ Work with ZIP archives โ Python 3.6.3 ...
Return a ZipInfo object with information about the archive member name. ... this when trying to read a ZIP file that contains members...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@3dw1np PyPDF2 works fine as long as you can package it yourself in the
/vendordirectory in your project. I was using it for PDF to image conversions, and do not know if PyPDF2 supports html --> pdf.Is this dependency in both your
requirements.txtand thevendordirectory? If so removing it from the requirements.txt might be the way to go (as it will be included from thevendordir already).