title: discord.py os.environ doesn't work for bot token
body: <p>so I have this code:</p>
  
  <pre><code># bot.py
  import os
  
  import discord
  from dotenv import load_dotenv
  
  load_dotenv()
  token = os.getenv('DISCORD_TOKEN')
  client = discord.Client()
  
  
  @client.event
  async def on_ready():
      print(f'{client.user} has connected to Discord!')
  
  
  client.run(token)
  </code></pre>
  
  <p>The 'DISCORD_TOKEN' is stored in another file '.env' in the same directory which is:</p>
  
  <pre><code>#. env file
  DISCORD_TOKEN={SSS}
  </code></pre>
  
  <p>Now whenever I try to run this code, I end up getting these erros:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\HP\Python\lib\site-packages\discord\http.py", line 258, in static_login
      data = await self.request(Route('GET', '/users/@me'))
    File "C:\Users\HP\Python\lib\site-packages\discord\http.py", line 222, in request
      raise HTTPException(r, data)
  discord.errors.HTTPException: 401 UNAUTHORIZED (error code: 0): 401: Unauthorized
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "bot.py", line 18, in &lt;module&gt;
      client.run(token)
    File "C:\Users\HP\Python\lib\site-packages\discord\client.py", line 598, in run
      return future.result()
    File "C:\Users\HP\Python\lib\site-packages\discord\client.py", line 579, in runner
      await self.start(*args, **kwargs)
    File "C:\Users\HP\Python\lib\site-packages\discord\client.py", line 542, in start
      await self.login(*args, bot=bot)
    File "C:\Users\HP\Python\lib\site-packages\discord\client.py", line 400, in login
      await self.http.static_login(token, bot=bot)
    File "C:\Users\HP\Python\lib\site-packages\discord\http.py", line 262, in static_login
      raise LoginFailure('Improper token has been passed.') from exc
  discord.errors.LoginFailure: Improper token has been passed.
  </code></pre>
  
  <p>But when I simply use 
  <code>token = 'DSDS'</code> instead of the .getenv, the code works and my bot is online.</p>
  
  <p>Any fix to this?</p>