internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: rucio/rucio

Issue:
Configure slack notifications for travis
Motivation
----------

https://docs.travis-ci.com/user/notifications/#Configuring-slack-notifications




Discussion:
Do we want this? I already had to turn off the slack github notifications, just too spammy :-)
I like our #github channel ;-)
I'm finding the github notifications quiet useful for me and having the report from travis will be also useful
Ok, maybe @tbeerman can have a look and add it to travis 😄 
Sure
it doesn't look to hard https://docs.travis-ci.com/user/notifications/#Configuring-Slack-notifications

it looks quiet easy actually. just click click on slack.. I'm submitting a PR
Done!

Resolving patch:
diff --git a/lib/rucio/client/baseclient.py b/lib/rucio/client/baseclient.py
--- a/lib/rucio/client/baseclient.py
+++ b/lib/rucio/client/baseclient.py
@@ -46,8 +46,14 @@
 from os import environ, fdopen, path, makedirs, geteuid
 from shutil import move
 from tempfile import mkstemp
-from urlparse import urlparse
-from ConfigParser import NoOptionError, NoSectionError
+try:
+    # Python 2
+    from urlparse import urlparse
+    from ConfigParser import NoOptionError, NoSectionError
+except ImportError:
+    # Python 3
+    from urllib.parse import urlparse
+    from configparser import NoOptionError, NoSectionError
 from dogpile.cache import make_region
 from requests import session
 from requests.status_codes import codes, _codes
diff --git a/lib/rucio/common/utils.py b/lib/rucio/common/utils.py
--- a/lib/rucio/common/utils.py
+++ b/lib/rucio/common/utils.py
@@ -42,12 +42,27 @@
 import zlib
 
 from getpass import getuser
-from itertools import izip_longest
+try:
+    # Python 2
+    from itertools import izip_longest
+except ImportError:
+    # Python 3
+    from itertools import zip_longest as izip_longest
 from logging import getLogger, Formatter
 from logging.handlers import RotatingFileHandler
-from urllib import urlencode, quote
+try:
+    # Python 2
+    from urllib import urlencode, quote
+except ImportError:
+    # Python 3
+    from urllib.parse import urlencode, quote
 from uuid import uuid4 as uuid
-from StringIO import StringIO
+try:
+    # Python 2
+    from StringIO import StringIO
+except ImportError:
+    # Python 3
+    from io import StringIO
 
 from rucio.common.config import config_get
 from rucio.common.exception import MissingModuleException


Test patch:
Repository: rucio/rucio

Issue:
Configure slack notifications for travis
Motivation
----------

https://docs.travis-ci.com/user/notifications/#Configuring-slack-notifications




Discussion:
Do we want this? I already had to turn off the slack github notifications, just too spammy :-)
I like our #github channel ;-)
I'm finding the github notifications quiet useful for me and having the report from travis will be also useful
Ok, maybe @tbeerman can have a look and add it to travis 😄 
Sure
it doesn't look to hard https://docs.travis-ci.com/user/notifications/#Configuring-Slack-notifications

it looks quiet easy actually. just click click on slack.. I'm submitting a PR
Done!

Resolving patch:
diff --git a/lib/rucio/vcsversion.py b/lib/rucio/vcsversion.py
--- a/lib/rucio/vcsversion.py
+++ b/lib/rucio/vcsversion.py
@@ -4,8 +4,8 @@
 '''
 VERSION_INFO = {
     'final': True,
-    'version': '1.15.0',
-    'branch_nick': 'feature-0000-Preparation_for_1_15_0',
-    'revision_id': '3f8ebf61ccdcb6d0b7422acc919a898a9daf53f1',
-    'revno': 6223
+    'version': '1.15.2',
+    'branch_nick': 'patch-0-1_15_2_preparation',
+    'revision_id': '13db4e6b7409b1a2ad8fc00f0dcdd64a0765cf95',
+    'revno': 6289
 }


Test patch:
Repository: rucio/rucio

Issue:
generate release notes script limited to github api page limit
Motivation
----------
Script needs to scroll pages.


Discussion:

Resolving patch:
diff --git a/lib/rucio/client/baseclient.py b/lib/rucio/client/baseclient.py
--- a/lib/rucio/client/baseclient.py
+++ b/lib/rucio/client/baseclient.py
@@ -570,8 +570,8 @@ def __read_token(self):
             token_file_handler = open(self.token_file, 'r')
             self.auth_token = token_file_handler.readline()
             self.headers['X-Rucio-Auth-Token'] = self.auth_token
-        except IOError as (errno, strerror):  # NOQA
-            print("I/O error({0}): {1}".format(errno, strerror))
+        except IOError as error:
+            print("I/O error({0}): {1}".format(error.errno, error.strerror))
         except Exception:
             raise
 
@@ -600,8 +600,8 @@ def __write_token(self):
             with fdopen(file_d, "w") as f_token:
                 f_token.write(self.auth_token)
             move(file_n, self.token_file)
-        except IOError as (errno, strerror):  # NOQA
-            print("I/O error({0}): {1}".format(errno, strerror))
+        except IOError as error:
+            print("I/O error({0}): {1}".format(error.errno, error.strerror))
         except Exception:
             raise
 


Test patch:
Repository: rucio/rucio

Issue:
generate release notes script limited to github api page limit
Motivation
----------
Script needs to scroll pages.


Discussion:

Resolving patch:
diff --git a/lib/rucio/client/baseclient.py b/lib/rucio/client/baseclient.py
--- a/lib/rucio/client/baseclient.py
+++ b/lib/rucio/client/baseclient.py
@@ -590,7 +590,7 @@ def __write_token(self):
         if not path.isdir(token_path):
             try:
                 LOG.debug('rucio token folder \'%s\' not found. Create it.' % token_path)
-                makedirs(token_path, 0700)
+                makedirs(token_path, 0o700)
             except Exception:
                 raise
 


Test patch:
Repository: rucio/rucio

Issue:
importlib not python 2.6 compatible
Motivation
----------
For the dynamic lfn2pfn function the module `importlib` is used. However, importlib is not part of python 2.6, thus it breaks the clients used on the ATLAS local root base. One option would be to use the backport of importlib for python 2.6 (on pypi) - needs to be investigated.

https://pypi.python.org/pypi/importlib

* Adding importlib to the dependencies works for python 2.6 and 2.7, but a install on python 3.x fails like this. 

For now we move the import to a conditional part of the code, as no module gets dynamically loaded at the moment anyway; This needs to be addressed later on with the dynamic loading of permissions and policies, as this should be handled in a similar way.


Discussion:

Resolving patch:
diff --git a/lib/rucio/rse/protocols/protocol.py b/lib/rucio/rse/protocols/protocol.py
--- a/lib/rucio/rse/protocols/protocol.py
+++ b/lib/rucio/rse/protocols/protocol.py
@@ -13,13 +13,13 @@
 - Cheng-Hsi Chao, <cheng-hsi.chao@cern.ch>, 2014
 - Mario Lassnig, <mario.lassnig@cern.ch>, 2017
 - Brian Bockelman, <bbockelm@cse.unl.edu>, 2018
+- Martin Barisits, <martin.barisits@cern.ch>, 2018
 
 This module defines the base class for implementing a transfer protocol,
 along with some of the default methods for LFN2PFN translations.
 """
 
 import hashlib
-import importlib
 
 from urlparse import urlparse
 from ConfigParser import NoOptionError, NoSectionError
@@ -143,7 +143,11 @@ def _module_init_(cls):
         except (NoOptionError, NoSectionError):
             pass
         if policy_module:
+            # TODO: The import of importlib is done like this due to a dependency issue with python 2.6 and incompatibility of the module with py3.x
+            # More information https://github.com/rucio/rucio/issues/875
+            import importlib
             importlib.import_module(policy_module)
+
         cls._DEFAULT_LFN2PFN = config.get_lfn2pfn_algorithm_default()
 
     def path(self, scope, name):


Test patch:
Repository: rucio/rucio

Issue:
DuplicateRule error creates index out of bound stacktrace
Motivation
----------
```
File "/usr/lib/python2.7/site-packages/rucio/web/rest/rule.py", line 271, in POST
raise generate_http_error(409, 'DuplicateRule', error.args[0])
IndexError: tuple index out of range
```
[0] needs to be removed.



Discussion:

Resolving patch:
diff --git a/lib/rucio/web/rest/webpy/v1/rule.py b/lib/rucio/web/rest/webpy/v1/rule.py
--- a/lib/rucio/web/rest/webpy/v1/rule.py
+++ b/lib/rucio/web/rest/webpy/v1/rule.py
@@ -1,15 +1,25 @@
-'''
-  Copyright European Organization for Nuclear Research (CERN)
+# Copyright 2012-2018 CERN for the benefit of the ATLAS collaboration.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Authors:
+# - Vincent Garonne <vgaronne@gmail.com>, 2012-2017
+# - Mario Lassnig <mario.lassnig@cern.ch>, 2013-2018
+# - Thomas Beermann <thomas.beermann@cern.ch>, 2013-2018
+# - Martin Barisits <martin.barisits@cern.ch>, 2013-2017
+# - Cedric Serfon <cedric.serfon@cern.ch>, 2014-2017
+# - Joaquin Bogado <jbogado@linti.unlp.edu.ar>, 2018
 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  You may not use this file except in compliance with the License.
-  You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-  Authors:
-  - Vincent Garonne, <vincent.garonne@cern.ch>, 2012-2017
-  - Martin Barisits, <martin.barisits@cern.ch>, 2013-2017
-  - Cedric Serfon, <cedric.serfon@cern.ch>, 2015, 2017
-'''
 
 from logging import getLogger, StreamHandler, DEBUG
 from json import dumps, loads
@@ -268,7 +278,7 @@ def POST(self):
         except InvalidReplicationRule as error:
             raise generate_http_error(409, 'InvalidReplicationRule', error.args[0][0])
         except DuplicateRule as error:
-            raise generate_http_error(409, 'DuplicateRule', error.args[0])
+            raise generate_http_error(409, 'DuplicateRule', error.args)
         except InsufficientTargetRSEs as error:
             raise generate_http_error(409, 'InsufficientTargetRSEs', error.args[0][0])
         except InsufficientAccountLimit as error:


Test patch:
Repository: rucio/rucio

Issue:
rucio-judge-cleaner traceback against postgres
Motivation
----------

```# /bin/rucio-judge-cleaner 
Traceback (most recent call last):
  File "/bin/rucio-judge-cleaner", line 30, in <module>
    run(once=args.run_once, threads=args.threads)
  File "/usr/lib/python2.7/site-packages/rucio/daemons/judge/cleaner.py", line 143, in run
    if db_time - client_time > max_offset or client_time - db_time > max_offset:
TypeError: unsupported operand type(s) for -: 'datetime.date' and 'datetime.datetime' ```




Discussion:
Ok it seems in certain versions of postgres only a date, instead of a datatime is returned when querying the db. With a date object this check becomes quite useless. I will disable it in case a date is returned.

Resolving patch:
diff --git a/lib/rucio/daemons/judge/cleaner.py b/lib/rucio/daemons/judge/cleaner.py
--- a/lib/rucio/daemons/judge/cleaner.py
+++ b/lib/rucio/daemons/judge/cleaner.py
@@ -151,9 +151,10 @@ def run(once=False, threads=1):
     """
     client_time, db_time = datetime.utcnow(), get_db_time()
     max_offset = timedelta(hours=1, seconds=10)
-    if db_time - client_time > max_offset or client_time - db_time > max_offset:
-        logging.critical('Offset between client and db time too big. Stopping Cleaner')
-        return
+    if type(db_time) is datetime:
+        if db_time - client_time > max_offset or client_time - db_time > max_offset:
+            logging.critical('Offset between client and db time too big. Stopping Cleaner')
+            return
 
     hostname = socket.gethostname()
     sanity_check(executable='rucio-judge-cleaner', hostname=hostname)


Test patch:
Repository: rucio/rucio

Issue:
rucio-judge-cleaner traceback against postgres
Motivation
----------

```# /bin/rucio-judge-cleaner 
Traceback (most recent call last):
  File "/bin/rucio-judge-cleaner", line 30, in <module>
    run(once=args.run_once, threads=args.threads)
  File "/usr/lib/python2.7/site-packages/rucio/daemons/judge/cleaner.py", line 143, in run
    if db_time - client_time > max_offset or client_time - db_time > max_offset:
TypeError: unsupported operand type(s) for -: 'datetime.date' and 'datetime.datetime' ```




Discussion:

Resolving patch:
diff --git a/lib/rucio/daemons/judge/cleaner.py b/lib/rucio/daemons/judge/cleaner.py
--- a/lib/rucio/daemons/judge/cleaner.py
+++ b/lib/rucio/daemons/judge/cleaner.py
@@ -151,9 +151,10 @@ def run(once=False, threads=1):
     """
     client_time, db_time = datetime.utcnow(), get_db_time()
     max_offset = timedelta(hours=1, seconds=10)
-    if db_time - client_time > max_offset or client_time - db_time > max_offset:
-        logging.critical('Offset between client and db time too big. Stopping Cleaner')
-        return
+    if type(db_time) is datetime:
+        if db_time - client_time > max_offset or client_time - db_time > max_offset:
+            logging.critical('Offset between client and db time too big. Stopping Cleaner')
+            return
 
     hostname = socket.gethostname()
     sanity_check(executable='rucio-judge-cleaner', hostname=hostname)


Test patch:
Repository: rucio/rucio

Issue:
setup_clients.py classifiers needs to be a list, not tuples
Motivation
----------
Classifiers were changed to tuple, which does not work, needs to be a list.


Discussion:

Resolving patch:
diff --git a/setup_rucio_client.py b/setup_rucio_client.py
--- a/setup_rucio_client.py
+++ b/setup_rucio_client.py
@@ -190,7 +190,7 @@ def get_file_list(self):
     license="Apache License, Version 2.0",
     url="http://rucio.cern.ch/",
     python_requires=">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
-    classifiers=(
+    classifiers=[
         'Development Status :: 5 - Production/Stable',
         'License :: OSI Approved :: Apache Software License',
         'Intended Audience :: Information Technology',
@@ -207,7 +207,7 @@ def get_file_list(self):
         'Programming Language :: Python :: Implementation :: CPython',
         'Programming Language :: Python :: Implementation :: PyPy',
         'Environment :: No Input/Output (Daemon)'
-    ),
+    ],
     install_requires=REQUIRES,
     extras_require=EXTRAS_REQUIRES,
     dependency_links=DEPEND_LINKS,


Test patch:
Repository: rucio/rucio

Issue:
Error with python3: the JSON object must be str, not 'bytes'
Motivation
----------
```
(rucio-cients) [root@rucio-server-int-01 virtualenv-15.1.0]# rucio-admin account list 
the JSON object must be str, not 'bytes'
This means the parameter you passed has a wrong type.
(rucio-cients) [root@rucio-server-int-01 virtualenv-15.1.0]# rucio-admin rse list 
the JSON object must be str, not 'bytes'
This means the parameter you passed has a wrong type.
(rucio-cients) [root@rucio-server-int-01 virtualenv-15.1.0]# rucio list-rses
2018-03-21 09:42:09,970    ERROR    the JSON object must be str, not 'bytes'
```



Discussion:

Resolving patch:
diff --git a/lib/rucio/common/utils.py b/lib/rucio/common/utils.py
--- a/lib/rucio/common/utils.py
+++ b/lib/rucio/common/utils.py
@@ -249,8 +249,12 @@ def render_json_list(l):
 def datetime_parser(dct):
     """ datetime parser
     """
+    try:
+        varType = basestring
+    except NameError:
+        varType = str
     for k, v in list(dct.items()):
-        if isinstance(v, basestring) and re.search(" UTC", v):
+        if isinstance(v, varType) and re.search(" UTC", v):
             try:
                 dct[k] = datetime.datetime.strptime(v, DATE_FORMAT)
             except:
@@ -261,7 +265,7 @@ def datetime_parser(dct):
 def parse_response(data):
     """ JSON render function
     """
-    return json.loads(data, object_hook=datetime_parser)
+    return json.loads(data.decode('utf-8'), object_hook=datetime_parser)
 
 
 def generate_http_error(status_code, exc_cls, exc_msg):


Test patch:
Repository: rucio/rucio

Issue:
Error with python3: the JSON object must be str, not 'bytes'
Motivation
----------
```
(rucio-cients) [root@rucio-server-int-01 virtualenv-15.1.0]# rucio-admin account list 
the JSON object must be str, not 'bytes'
This means the parameter you passed has a wrong type.
(rucio-cients) [root@rucio-server-int-01 virtualenv-15.1.0]# rucio-admin rse list 
the JSON object must be str, not 'bytes'
This means the parameter you passed has a wrong type.
(rucio-cients) [root@rucio-server-int-01 virtualenv-15.1.0]# rucio list-rses
2018-03-21 09:42:09,970    ERROR    the JSON object must be str, not 'bytes'
```

setup_clients.py classifiers needs to be a list, not tuples
Motivation
----------
Classifiers were changed to tuple, which does not work, needs to be a list.


Discussion:

Resolving patch:
diff --git a/lib/rucio/common/utils.py b/lib/rucio/common/utils.py
--- a/lib/rucio/common/utils.py
+++ b/lib/rucio/common/utils.py
@@ -249,8 +249,12 @@ def render_json_list(l):
 def datetime_parser(dct):
     """ datetime parser
     """
+    try:
+        varType = basestring
+    except NameError:
+        varType = str
     for k, v in list(dct.items()):
-        if isinstance(v, basestring) and re.search(" UTC", v):
+        if isinstance(v, varType) and re.search(" UTC", v):
             try:
                 dct[k] = datetime.datetime.strptime(v, DATE_FORMAT)
             except:
@@ -261,7 +265,7 @@ def datetime_parser(dct):
 def parse_response(data):
     """ JSON render function
     """
-    return json.loads(data, object_hook=datetime_parser)
+    return json.loads(data.decode('utf-8'), object_hook=datetime_parser)
 
 
 def generate_http_error(status_code, exc_cls, exc_msg):
diff --git a/setup_rucio_client.py b/setup_rucio_client.py
--- a/setup_rucio_client.py
+++ b/setup_rucio_client.py
@@ -190,7 +190,7 @@ def get_file_list(self):
     license="Apache License, Version 2.0",
     url="http://rucio.cern.ch/",
     python_requires=">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
-    classifiers=(
+    classifiers=[
         'Development Status :: 5 - Production/Stable',
         'License :: OSI Approved :: Apache Software License',
         'Intended Audience :: Information Technology',
@@ -207,7 +207,7 @@ def get_file_list(self):
         'Programming Language :: Python :: Implementation :: CPython',
         'Programming Language :: Python :: Implementation :: PyPy',
         'Environment :: No Input/Output (Daemon)'
-    ),
+    ],
     install_requires=REQUIRES,
     extras_require=EXTRAS_REQUIRES,
     dependency_links=DEPEND_LINKS,


Test patch:
Repository: rucio/rucio

Issue:
setup_clients.py classifiers needs to be a list, not tuples
Motivation
----------
Classifiers were changed to tuple, which does not work, needs to be a list.


Discussion:

Resolving patch:
diff --git a/lib/rucio/common/dumper/consistency.py b/lib/rucio/common/dumper/consistency.py
--- a/lib/rucio/common/dumper/consistency.py
+++ b/lib/rucio/common/dumper/consistency.py
@@ -155,7 +155,7 @@ def strip_storage_dump(line):
 
 def _try_to_advance(it, default=None):
     try:
-        el = it.next()
+        el = next(it)
     except StopIteration:
         return default
     return el.strip()
diff --git a/setup_rucio_client.py b/setup_rucio_client.py
--- a/setup_rucio_client.py
+++ b/setup_rucio_client.py
@@ -190,7 +190,7 @@ def get_file_list(self):
     license="Apache License, Version 2.0",
     url="http://rucio.cern.ch/",
     python_requires=">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
-    classifiers=(
+    classifiers=[
         'Development Status :: 5 - Production/Stable',
         'License :: OSI Approved :: Apache Software License',
         'Intended Audience :: Information Technology',
@@ -207,7 +207,7 @@ def get_file_list(self):
         'Programming Language :: Python :: Implementation :: CPython',
         'Programming Language :: Python :: Implementation :: PyPy',
         'Environment :: No Input/Output (Daemon)'
-    ),
+    ],
     install_requires=REQUIRES,
     extras_require=EXTRAS_REQUIRES,
     dependency_links=DEPEND_LINKS,


Test patch:
Repository: rucio/rucio

Issue:
Move conveyor transfers to third_party_copy_operation
Motivation
----------
At the moment read is used for source and write is used for destination, for both third_party_copy should be used.


Discussion:

Resolving patch:
diff --git a/lib/rucio/vcsversion.py b/lib/rucio/vcsversion.py
--- a/lib/rucio/vcsversion.py
+++ b/lib/rucio/vcsversion.py
@@ -4,8 +4,8 @@
 '''
 VERSION_INFO = {
     'final': True,
-    'version': '1.15.3',
-    'branch_nick': 'patch-0-Rucio_1_15_3_preparation',
-    'revision_id': 'cd14416223d0b81a940312cb180a07778f85f1f8',
-    'revno': 6357
+    'version': '1.15.4',
+    'branch_nick': 'patch-0-Rucio_1_15_4_preparation',
+    'revision_id': 'c2972be03297dc73a65d35bc9ffab1516efffebb',
+    'revno': 6402
 }


Test patch:
Repository: rucio/rucio

Issue:
Transfers : Modify the verify_checksum parameter passed to FTS
Motivation
----------
```
Hi Cedric,

the checksum validation was improved to have all checksum possibilities. Before, when you where indicating verify checksum True was applying the checksum to both (source and destination) and if you were using False the verification was not applied.
I just keep the True and False for compatibility with the API. But, we encouraged when this new feature was presented in the steering, to use both if you want a checksum verification in source and destination, source when you only wants the verification on the source, destination just to verify in destination and none for no verification.

So, you can provide the verification that adapts better to your needs as it is documented.

Cheers,
Maria
```






Discussion:

Resolving patch:
diff --git a/lib/rucio/core/rse.py b/lib/rucio/core/rse.py
--- a/lib/rucio/core/rse.py
+++ b/lib/rucio/core/rse.py
@@ -15,7 +15,7 @@
 # Authors:
 # - Vincent Garonne <vgaronne@gmail.com>, 2012-2018
 # - Ralph Vigne <ralph.vigne@cern.ch>, 2012-2015
-# - Mario Lassnig <mario.lassnig@cern.ch>, 2012-2017
+# - Mario Lassnig <mario.lassnig@cern.ch>, 2012-2018
 # - Martin Barisits <martin.barisits@cern.ch>, 2013-2018
 # - Cedric Serfon <cedric.serfon@cern.ch>, 2013-2018
 # - Thomas Beermann <thomas.beermann@cern.ch>, 2014-2017
@@ -687,7 +687,7 @@ def add_protocol(rse, parameter, session=None):
             for op in parameter['domains'][s]:
                 if op not in utils.rse_supported_protocol_operations():
                     raise exception.RSEOperationNotSupported('Operation \'%s\' not defined in schema.' % (op))
-                op_name = ''.join([op, '_', s]).lower()
+                op_name = op if op == 'third_party_copy' else ''.join([op, '_', s]).lower()
                 if parameter['domains'][s][op] < 0:
                     raise exception.RSEProtocolPriorityError('The provided priority (%s)for operation \'%s\' in domain \'%s\' is not supported.' % (parameter['domains'][s][op], op, s))
                 parameter[op_name] = parameter['domains'][s][op]


Test patch: