[issue44510] file.read() UnicodeDecodeError with large files on Windows

2021-06-25 Thread Rohan Amin
New submission from Rohan Amin : When using file.read() with a large text file, there is a UnicodeDecodeError. I expected file.read(1) to read one character from the file. It works with a smaller text file. I experienced this bug on Windows 10 version 20H2. My teacher couldn't reproduce

[issue43078] Equality Errors when Unpickling and Pickling a Dictionary with a nan

2021-01-30 Thread Rohan Prasad
Rohan Prasad added the comment: I see this makes a ton of sense, thanks! I'll close this issue. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43078] Equality Errors when Unpickling and Pickling a Dictionary with a nan

2021-01-30 Thread Rohan Prasad
New submission from Rohan Prasad : Hi, I'm having a weird issue with floats in dictionaries and equality comparison (see attached screenshot for an example). When I create two dictionaries with a nan value they pass an equivalence test. However, if I pickle and unpickle one

[issue34939] Possibly spurious SyntaxError: annotated name can't be global

2018-10-09 Thread Rohan Padhye
Rohan Padhye added the comment: Another point I'd like to make is that there is no error in either file or interactive if the annotated assignment appears before the `global` declaration like so: ``` x:int = 0 def set_x(): global x x = 1 # Works fine! ``` The syntax error

[issue34939] Possibly spurious SyntaxError: annotated name can't be global

2018-10-08 Thread Rohan Padhye
New submission from Rohan Padhye : The following code when run as a script file gives syntax error: ``` def set_x(): global x x = 1 x:int = 0 # SyntaxError: annotated name 'x' can't be global ``` PEP 526 does not seem to forbid this. The error message "annotated name [...]

[issue32045] Does json.dumps have a memory leak?

2018-01-30 Thread Rohan D'Sa
Rohan D'Sa <roh4n@gmail.com> added the comment: Yes. Thanks. On 30 Jan 2018 8:31 PM, "Cheryl Sabella" <rep...@bugs.python.org> wrote: > > Cheryl Sabella <chek...@gmail.com> added the comment: > > Can this be closed as 'Not

[issue32045] Does json.dumps have a memory leak?

2017-11-16 Thread Rohan D'Sa
Rohan D'Sa <roh4n@gmail.com> added the comment: you are right. i realized later i actually had a leak in a com instantiated object, assumed it was a leak in the python and tried to find it using the gc module. The gc documentation led me down the garden path. QUOTE gc.garbage

[issue32045] Does json.dumps have a memory leak?

2017-11-16 Thread Rohan D'Sa
New submission from Rohan D'Sa <roh4n@gmail.com>: import gc, json class leak(object): def __init__(self): pass gc.set_debug(gc.DEBUG_LEAK) while True: leak_ = leak() json.dumps(leak_.__dict__, indent=True) gc.collect() print(f"garbage count: {len

[issue16778] Logger.findCaller needs to be smarter

2014-07-20 Thread Michael Rohan
Michael Rohan added the comment: I recently implemented a custom logger derived from Logger and to get the reporting of modules, etc, correct, I implemented the findCaller using the same code as library code with the minor change of if filename == _srcfile: to if filename in [logging._srcfile

CommandLine Option in Python for filtering values from Column

2014-04-09 Thread rohan bareja
I want to write a function in Python for a tab delimited file I am dealing with,to filter out values from a column, and put that parameter as a command line option while running the script. So,if the limit is 10,the filter out all the rows with values less than 10. Also,I want to check if the

Executing js/ajax in a sandboxed environment

2011-02-26 Thread Rohan Malhotra
before I start parsing it. BeautifulSoup library only fetches source of page. I need the access to DOM after js execution with url as input parameter. Any pointers? -- Regards Rohan -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I find the remainder when dividing 2 integers

2011-01-12 Thread Rohan Pai
Try using dividend % divisor, this will return the remainder Rohan Pai -- http://mail.python.org/mailman/listinfo/python-list

How to create Standalone PYC File

2009-03-04 Thread Rohan Hole
is , if i run .pyc file on another computer containing only python installed , will it run ? or do i need to install 3rd party lib again on that computer ? Anyone know how to make program lib independent , something called embedded into one file only ? thank you in anticipation . Rohan. -- http

run Package Query

2009-03-03 Thread Rohan Hole
When I write program (.py) with IDLE , I am able to use run package . - - - - start - - - - if __name__ == '__main__': import sys,os import run run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) - - - - end - - - - - above code works simply with the IDLE. But

Help me!!

2007-08-16 Thread Rohan
I have the following piece of code a = len(ab_file) b= 0 while(ba): c= 0 d = len(cd_files) while(cd): if cd_files[c] == ab_file[b]: files.append(ab_file[b].upper()) else: files.append(ab_file[b]) c = c + 1 b = b

Re: Colored text

2007-08-13 Thread Rohan
On Aug 12, 10:01 pm, ianaré [EMAIL PROTECTED] wrote: On Aug 12, 10:05 pm, Rohan [EMAIL PROTECTED] wrote: Hello, Can some one tell me how do I get colored text. Say when I want to write something in a text file , how do I get it colored. Plain text files don't have color. You could output

Colored text

2007-08-12 Thread Rohan
Hello, Can some one tell me how do I get colored text. Say when I want to write something in a text file , how do I get it colored. -- http://mail.python.org/mailman/listinfo/python-list

Dealing with multiple excel sheets

2007-08-07 Thread Rohan
Hello, I would like to write a script which does the following job. Take column1 and 7 from 10 different excel sheets and pasthe them into a new excel worksheet. Any ideas on how to do it Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Email

2007-08-07 Thread Rohan
On Aug 3, 7:22 pm, SMERSH009 [EMAIL PROTECTED] wrote: On Aug 3, 9:47 am,Rohan[EMAIL PROTECTED] wrote: On Aug 2, 1:06 pm, Laurent Pointal [EMAIL PROTECTED] wrote: Rohanwrote: I was wondering if there could be an arrangement where a file could be attached and send as an email

Auto run/Timer

2007-08-04 Thread Rohan
Hello, I would like my script to run once a week with out any external interference. More like a timer. Can it be done in python or should some other shell scripting be used. If anyone knows anything please let me know. -- http://mail.python.org/mailman/listinfo/python-list

Re: Email

2007-08-03 Thread Rohan
On Aug 2, 1:06 pm, Laurent Pointal [EMAIL PROTECTED] wrote: Rohan wrote: I was wondering if there could be an arrangement where a file could be attached and send as an email. For ex f = open(add.txt,w) f.write('python') f.close() Now I would like to send an email with add.txt

Email

2007-08-02 Thread Rohan
I was wondering if there could be an arrangement where a file could be attached and send as an email. For ex f = open(add.txt,w) f.write('python') f.close() Now I would like to send an email with add.txt as an attachment, is it possible ? some one give me a pointer towards this. --

Directory

2007-07-30 Thread Rohan
I would like to get a list of sub directories in a directory. If I use os.listdir i get a list of directories and files in that . i only want the list of directories in a directory and not the files in it. anyone has an idea regarding this. -- http://mail.python.org/mailman/listinfo/python-list

CSV Issue

2007-07-26 Thread Rohan
I'm having a trouble consider this import csv f = open(/home/t/tp/va/some7.csv, rb) reader =csv.reader(f) rows =[] for row in reader: rows.append(row) rows[1].append('1') print rows f = open(/home/t/tp/va/e7.csv, ab) writer =csv.writer(f) writer.writerows(rows) f.close() In the file

Re: CSV Issue

2007-07-26 Thread Rohan
On Jul 26, 2:32 pm, John Machin [EMAIL PROTECTED] wrote: On Jul 27, 7:19 am, Rohan [EMAIL PROTECTED] wrote: f = open(/home/t/tp/va/e7.csv, ab) a means Append -- you are appending the data that you expect to the EXISTING contents of the file. Hello John, Yea silly mistake, write mode

Issue with CSV

2007-07-18 Thread Rohan
Hello, I'm working on a script which collects some data and puts into a csv file which could be exported to excel. so far so good, I'm able to do what I described. When I run the script for the second time after a certain period of time the results should appear next to the results of the last

CSV Issues

2007-07-18 Thread Rohan
Hello, I'm working on a script which collects some data and puts into a csv file which could be exported to excel. so far so good, I'm able to do what I described. When I run the script for the second time after a certain period of time the results should appear next to the results of the last