You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/03/02 07:47:34 UTC
[GitHub] [pulsar] zymap commented on a change in pull request #9773: [functions] Use std lib zipfile to check if python function is a .py or a .zip
zymap commented on a change in pull request #9773:
URL: https://github.com/apache/pulsar/pull/9773#discussion_r585329201
##########
File path: pulsar-functions/instance/src/main/python/python_instance_main.py
##########
@@ -113,7 +113,7 @@ def main():
zpfile = zipfile.ZipFile(str(args.py), 'r')
zpfile.extractall(os.path.dirname(str(args.py)))
sys.path.insert(0, os.path.dirname(str(args.py)))
- elif os.path.splitext(str(args.py))[1] == '.zip':
+ elif zipfile.is_zipfile(str(args.py)):
Review comment:
can we add a test for this?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org