prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  create_experiment() fails on windows 10
  Hi there, 
  
  I enjoy neptune very much and on my macbook everything works fine. But when I run the same code on my Windows 10 machine, I get an error when calling create_experiment().
  
  `Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "C:\ProgramData\Anaconda3\envs\rl_insurance\lib\site-packages\neptune\__init__.py", line 177, in create_experiment
      notebook_id=notebook_id
    File "C:\ProgramData\Anaconda3\envs\rl_insurance\lib\site-packages\neptune\projects.py", line 400, in create_experiment
      click.echo(str(experiment.id))
    File "C:\ProgramData\Anaconda3\envs\rl_insurance\lib\site-packages\click\utils.py", line 218, in echo
      file = _default_text_stdout()
    File "C:\ProgramData\Anaconda3\envs\rl_insurance\lib\site-packages\click\_compat.py", line 675, in func
      rv = wrapper_func()
    File "C:\ProgramData\Anaconda3\envs\rl_insurance\lib\site-packages\click\_compat.py", line 436, in get_text_stdout
      rv = _get_windows_console_stream(sys.stdout, encoding, errors)
    File "C:\ProgramData\Anaconda3\envs\rl_insurance\lib\site-packages\click\_winconsole.py", line 295, in _get_windows_console_stream
      func = _stream_factories.get(f.fileno())
  AttributeError: 'StdOutWithUpload' object has no attribute 'fileno'`
  
  It happens when I run:
  
  `import neptune `
  `import cfg`
  `neptune.init(api_token=cfg.neptune_token, project_qualified_name=cfg.neptune_project_name) `
  `neptune.create_experiment()`
  
  I run it in conda environments both times.
  
  
  </issue>
  <code>
  [start of neptune/internal/streams/stdstream_uploader.py]
  1 #
  2 # Copyright (c) 2019, Neptune Labs Sp. z o.o.
  3 #
  4 # Licensed under the Apache License, Version 2.0 (the "License");
  5 # you may not use this file except in compliance with the License.
  6 # You may obtain a copy of the License at
  7 #
  8 #     http://www.apache.org/licenses/LICENSE-2.0
  9 #
  10 # Unless required by applicable law or agreed to in writing, software
  11 # distributed under the License is distributed on an "AS IS" BASIS,
  12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 # See the License for the specific language governing permissions and
  14 # limitations under the License.
  15 #
  16 import sys
  17 
  18 from neptune.internal.channels.channels import ChannelNamespace
  19 from neptune.internal.streams.channel_writer import ChannelWriter
  20 
  21 
  22 class StdStreamWithUpload(object):
  23 
  24     def __init__(self, experiment, channel_name, stream):
  25         # pylint:disable=protected-access
  26         self._channel = experiment._get_channel(channel_name, 'text', ChannelNamespace.SYSTEM)
  27         self._channel_writer = ChannelWriter(experiment, channel_name, ChannelNamespace.SYSTEM)
  28         self._stream = stream
  29 
  30     def write(self, data):
  31         self._stream.write(data)
  32         try:
  33             self._channel_writer.write(data)
  34         # pylint:disable=bare-except
  35         except:
  36             pass
  37 
  38     def isatty(self):
  39         return hasattr(self._stream, 'isatty') and self._stream.isatty()
  40 
  41     def flush(self):
  42         self._stream.flush()
  43 
  44 
  45 class StdOutWithUpload(StdStreamWithUpload):
  46 
  47     def __init__(self, experiment):
  48         super(StdOutWithUpload, self).__init__(experiment, 'stdout', sys.__stdout__)
  49         sys.stdout = self
  50 
  51     def close(self):
  52         sys.stdout = sys.__stdout__
  53 
  54 
  55 class StdErrWithUpload(StdStreamWithUpload):
  56 
  57     def __init__(self, experiment):
  58         super(StdErrWithUpload, self).__init__(experiment, 'stderr', sys.__stderr__)
  59         sys.stderr = self
  60 
  61     def close(self):
  62         sys.stderr = sys.__stderr__
  63
  [end of neptune/internal/streams/stdstream_uploader.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/neptune/internal/streams/stdstream_uploader.py b/neptune/internal/streams/stdstream_uploader.py
  --- a/neptune/internal/streams/stdstream_uploader.py
  +++ b/neptune/internal/streams/stdstream_uploader.py
  @@ -41,6 +41,9 @@
       def flush(self):
           self._stream.flush()
   
  +    def fileno(self):
  +        return self._stream.fileno()
  +
   
   class StdOutWithUpload(StdStreamWithUpload):
  
verification_info: {"golden_diff": "diff --git a/neptune/internal/streams/stdstream_uploader.py b/neptune/internal/streams/stdstream_uploader.py\n--- a/neptune/internal/streams/stdstream_uploader.py\n+++ b/neptune/internal/streams/stdstream_uploader.py\n@@ -41,6 +41,9 @@\n     def flush(self):\n         self._stream.flush()\n \n+    def fileno(self):\n+        return self._stream.fileno()\n+\n \n class StdOutWithUpload(StdStreamWithUpload):\n", "issue": "create_experiment() fails on windows 10\nHi there, \r\n\r\nI enjoy neptune very much and on my macbook everything works fine. But when I run the same code on my Windows 10 machine, I get an error when calling create_experiment().\r\n\r\n`Traceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"C:\\ProgramData\\Anaconda3\\envs\\rl_insurance\\lib\\site-packages\\neptune\\__init__.py\", line 177, in create_experiment\r\n    notebook_id=notebook_id\r\n  File \"C:\\ProgramData\\Anaconda3\\envs\\rl_insurance\\lib\\site-packages\\neptune\\projects.py\", line 400, in create_experiment\r\n    click.echo(str(experiment.id))\r\n  File \"C:\\ProgramData\\Anaconda3\\envs\\rl_insurance\\lib\\site-packages\\click\\utils.py\", line 218, in echo\r\n    file = _default_text_stdout()\r\n  File \"C:\\ProgramData\\Anaconda3\\envs\\rl_insurance\\lib\\site-packages\\click\\_compat.py\", line 675, in func\r\n    rv = wrapper_func()\r\n  File \"C:\\ProgramData\\Anaconda3\\envs\\rl_insurance\\lib\\site-packages\\click\\_compat.py\", line 436, in get_text_stdout\r\n    rv = _get_windows_console_stream(sys.stdout, encoding, errors)\r\n  File \"C:\\ProgramData\\Anaconda3\\envs\\rl_insurance\\lib\\site-packages\\click\\_winconsole.py\", line 295, in _get_windows_console_stream\r\n    func = _stream_factories.get(f.fileno())\r\nAttributeError: 'StdOutWithUpload' object has no attribute 'fileno'`\r\n\r\nIt happens when I run:\r\n\r\n`import neptune `\r\n`import cfg`\r\n`neptune.init(api_token=cfg.neptune_token, project_qualified_name=cfg.neptune_project_name) `\r\n`neptune.create_experiment()`\r\n\r\nI run it in conda environments both times.\r\n\n", "before_files": [{"content": "#\n# Copyright (c) 2019, Neptune Labs Sp. z o.o.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\nimport sys\n\nfrom neptune.internal.channels.channels import ChannelNamespace\nfrom neptune.internal.streams.channel_writer import ChannelWriter\n\n\nclass StdStreamWithUpload(object):\n\n    def __init__(self, experiment, channel_name, stream):\n        # pylint:disable=protected-access\n        self._channel = experiment._get_channel(channel_name, 'text', ChannelNamespace.SYSTEM)\n        self._channel_writer = ChannelWriter(experiment, channel_name, ChannelNamespace.SYSTEM)\n        self._stream = stream\n\n    def write(self, data):\n        self._stream.write(data)\n        try:\n            self._channel_writer.write(data)\n        # pylint:disable=bare-except\n        except:\n            pass\n\n    def isatty(self):\n        return hasattr(self._stream, 'isatty') and self._stream.isatty()\n\n    def flush(self):\n        self._stream.flush()\n\n\nclass StdOutWithUpload(StdStreamWithUpload):\n\n    def __init__(self, experiment):\n        super(StdOutWithUpload, self).__init__(experiment, 'stdout', sys.__stdout__)\n        sys.stdout = self\n\n    def close(self):\n        sys.stdout = sys.__stdout__\n\n\nclass StdErrWithUpload(StdStreamWithUpload):\n\n    def __init__(self, experiment):\n        super(StdErrWithUpload, self).__init__(experiment, 'stderr', sys.__stderr__)\n        sys.stderr = self\n\n    def close(self):\n        sys.stderr = sys.__stderr__\n", "path": "neptune/internal/streams/stdstream_uploader.py"}]}