14
0

Accepting request 1068653 from home:PSuarezHernandez:branches:devel:languages:python

- Raise proper exception from urlgrab() when local file is not found (bsc#1208288)
- Added:
  * fix-urlgrab-file-schema-comparison.patch

OBS-URL: https://build.opensuse.org/request/show/1068653
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urlgrabber?expand=0&rev=50
This commit is contained in:
2023-03-03 08:00:26 +00:00
committed by Git OBS Bridge
parent 39157648c8
commit 14bb193dce
3 changed files with 37 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
From 779f65c1845968b59e5bfa21cf0468ba3664271b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez@suse.com>
Date: Wed, 1 Mar 2023 14:00:08 +0000
Subject: [PATCH] Fix comparison to work with expected bytes string
The urlgrab function initially coverts given url to bytes string
via the _to_utf8() helper. This make "url" parameter to be bytes,
and therefore we need to fix the this comparison
---
urlgrabber/grabber.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: urlgrabber-4.1.0/urlgrabber/grabber.py
===================================================================
--- urlgrabber-4.1.0.orig/urlgrabber/grabber.py
+++ urlgrabber-4.1.0/urlgrabber/grabber.py
@@ -1210,7 +1210,7 @@ class URLGrabber(object):
if not filename:
# This is better than nothing.
filename = 'index.html'
- if scheme == 'file' and not opts.copy_local:
+ if scheme == b'file' and not opts.copy_local:
# just return the name of the local file - don't make a
# copy currently
path = url2pathname(path)

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Mar 1 16:29:38 UTC 2023 - Pablo Suárez Hernández <pablo.suarezhernandez@suse.com>
- Raise proper exception from urlgrab() when local file is not found (bsc#1208288)
- Added:
* fix-urlgrab-file-schema-comparison.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Aug 3 14:30:01 UTC 2022 - Pablo Suárez Hernández <pablo.suarezhernandez@suse.com> Wed Aug 3 14:30:01 UTC 2022 - Pablo Suárez Hernández <pablo.suarezhernandez@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-urlgrabber # spec file for package python-urlgrabber
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2023 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -32,6 +32,8 @@ Patch0: use-binary-mode-when-reopening-files.patch
Patch1: fix_find_proxy_logic_and_drop_six.patch Patch1: fix_find_proxy_logic_and_drop_six.patch
# PATCH-FIX_UPSTREAM https://github.com/rpm-software-management/urlgrabber/pull/34 # PATCH-FIX_UPSTREAM https://github.com/rpm-software-management/urlgrabber/pull/34
Patch2: avoid_crashing_when_urlgrabber_debug_enabled.patch Patch2: avoid_crashing_when_urlgrabber_debug_enabled.patch
# PATCH-FIX_UPSTREAM https://github.com/rpm-software-management/urlgrabber/pull/37
Patch3: fix-urlgrab-file-schema-comparison.patch
BuildRequires: %{python_module pycurl} BuildRequires: %{python_module pycurl}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}