[issue25980] not able to find module request in lib urllib - Python35-32

2015-12-30 Thread Kiran Kotari

New submission from Kiran Kotari:

Python 3.5.1 documentation code giving following error:

Error: 
Traceback (most recent call last):
  File ".\urllib1.py", line 5, in 
with urllib.request.urlopen('http://www.py4inf.com/code/romeo.txt') as f:
AttributeError: module 'urllib' has no attribute 'request'

Python Code:

import urllib
with urllib.request.urlopen('http://www.py4inf.com/code/romeo.txt') as f:
print(f.read())

--
components: Library (Lib)
messages: 257230
nosy: Kiran Kotari
priority: normal
severity: normal
status: open
title: not able to find module request in lib urllib - Python35-32
type: behavior
versions: Python 3.5

___
Python tracker 
<http://bugs.python.org/issue25980>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25979] String functions lstrip are not working properly when you have escape sequence

2015-12-29 Thread Kiran Kotari

Kiran Kotari added the comment:

In this python code I am collecting list of folders present in the given 
location path with parent folder and print the folder names (output went wrong 
due to escape sequence values with lstrip.)
Note :
"\a \b \f \r \v \0 \1" are working fine. 
"\c \e \n \ne \t \te" went wrong.

Python Code :
import glob as g

class Folders:
def __init__(self, path, parent_folder_name):
self.path = path + parent_folder_name + '\\'
self.parent_folder_name = parent_folder_name

def showFolders(self):
folders = [lst.lstrip(self.path) for lst in  g.glob(self.path + '*')]
print('Path: '+self.path+ ', List: ',folders)
pass

if __name__ == "__main__":
obj = Folders(path='.\\', parent_folder_name='parent')
obj.showFolders()

Folder Structure : 
parent ->
  cat
  eat
  east
  next
  nest
  test

Wrong Output :
Path: .\parent\, List:  ['cat', 'st', '', 'st', 'xt', 'st']

--

___
Python tracker 
<http://bugs.python.org/issue25979>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25979] String functions lstrip are not working properly when you have escape sequence

2015-12-29 Thread Kiran Kotari

Changes by Kiran Kotari :


Removed file: http://bugs.python.org/file41450/string_fun_error.py

___
Python tracker 
<http://bugs.python.org/issue25979>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25979] String functions lstrip are not working properly when you have escape sequence

2015-12-29 Thread Kiran Kotari

New submission from Kiran Kotari:

In this python code I am collecting list of folders present in the given 
location path with parent folder and print the folder names (output went wrong 
due to escape sequence values with lstrip.)
Note :
"\a \b \f \r \v \0 \1" are working fine. 
"\c \e \n \ne \t \te" went wrong.

Folder Structure : 
parent ->
  cat
  eat
  east
  next
  nest
  test

Wrong Output :
Path: .\parent\, List:  ['cat', 'st', '', 'st', 'xt', 'st']

--
components: 2to3 (2.x to 3.x conversion tool)
files: string_fun_error.py
messages: 257223
nosy: Kiran Kotari
priority: normal
severity: normal
status: open
title: String functions lstrip are not working properly when you have escape 
sequence
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file41450/string_fun_error.py

___
Python tracker 
<http://bugs.python.org/issue25979>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25978] escape sequence r'\' giving compilation error

2015-12-29 Thread Kiran Kotari

New submission from Kiran Kotari:

>>> '\test'.lstrip(r'\')
   
SyntaxError: EOL while scanning string literal

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 257221
nosy: Kiran Kotari
priority: normal
severity: normal
status: open
title: escape sequence r'\' giving compilation error
type: compile error
versions: Python 3.5

___
Python tracker 
<http://bugs.python.org/issue25978>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com