TypeError: Unable to modify PDF file, make sure that output file target is available and that it is not protected - amazon-web-services

I'm trying to fill pdf form using HummusJS but it throws me an error TypeError: Unable to modify PDF file, make sure that output file target is available and that it is not protected while running pdf generation in AWS lambda function but its working fine on my local machine and log aren't generated. Is there any debugging option available??. I wasted 3 days for solving this issue.
Any help will highly be appreciated.
Thanks

I experienced this issue when the PDF file I was reading had a size of 0. Somewhere during my tests I suspect that the PDF I was working with got overwritten with empty data and it turns out that this is what was creating the permission error.
I was working from this sample.

Related

ldap_modify_ext_s fails with error 11 while writing data to active directory

I am using the Winldap API ldap_modify_ext_s to write data to the Active Directory. It writes successfully when the data is not too large. But when the data is really huge it fails with error 11. Error 11 maps to LDAP_ADMIN_LIMIT_EXCEEDED. What can be done to be able to successfully write data to the directory? Can some configuration be changed on the Active Directory? Like increase the maximum data limit for the attribute? Or Can some alternate API be used?
Thanks in advance.
Refer the following msdn link on the Non linked multi value attribute size limits
https://social.technet.microsoft.com/wiki/contents/articles/31919.active-directory-non-linked-multi-valued-attribute-size-limits.aspx

Cannot export Pandas dataframe to specified file path in Python for csv and excel both

I have written a program which exports my Pandas DataFrame to a csv as well as an excel file. However, the problem I am facing is that, randomly, the export function to both the file formats does not work, resulting in me seeing an error stating "No such File Path or Directory".
My code is as follows:
frame3.to_csv('C:/Users/Downloads/ABC_test.csv',index=False)
writer = pd.ExcelWriter('C:/Users/Downloads/ABCD.xlsx', engine='openpyxl')
frame3.to_excel(writer, sheet_name='Sheet1')
writer.save()
The major issue is that this code works sometimes and sometimes it does not! Going by what others have posted here, I tried to add the output directory by the use of
pth1 = os.path.join(r'C:/Users/Downloads/FinalProgram/', output_filename)
frame3.to_csv(pth1)
Sadly, this has no effect on this stubborn error. Would appreciate any help / insights possible on the matter.
Forgot to update - I figured a way around this particular problem:
Simply set the working directory for the program to be the output directory (as depicted by the command below), before the calling the 'to_csv' function.
os.chdir('F:/Codelah/')
On a side note, this was an issue I primarily faced on Windows OS - Ubuntu worked like a charm and did not require this workaround!
Hope this helps

cPickle.load() doesnt accept non-.gz files, what can I use for .pkl files?

I am trying to run an example of a LSTM recurrent neural network that is presented in this git: https://github.com/mesnilgr/is13.
I've installed theano and everything and when I got to the point of running the code, I've noticed the data was not being downloaded, so I've opened an issue on the github (https://github.com/mesnilgr/is13/issues/12) and this guy came up with a solution that consisted in:
1-get the data from the dropbox link he provides.
2- change the code of the 'load.py' file to download, and read the data properly.
The only issue is that the data in the dropbox folder(https://www.dropbox.com/s/3lxl9jsbw0j7h8a/atis.pkl?dl=0) is not a compacted .gz file as, I suppose, was the data from the original repository. So I dont have enough skill to change the code in order to do with the uncompressed data exaclty what it would do with the compressed one. Can someone help me?
The modification suggested and the changes I've done are described on the issue I've opened on the git(https://github.com/mesnilgr/is13/issues/12).
It looks like your code is using
gzip.open(...)
But if the file is not gzipped then you probably just need to remove the gzip. prefix and use
open(...)

ERROR: User does not have appropriate authorization level for file WORK.SASMACR.CATALOG

Anyone seen this error before?
"ERROR: User does not have appropriate authorization level for file WORK.SASMACR.CATALOG"
Occasionally, our batch jobs stops with this error. I don't understand how a file in work should not be writeable?
Thanks,
Stig
After I disabled antivirus (Sophos) online scanning for the work folder and *.sas7bcat files the error seem to have gone away.
According to this http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001328775.htm , macro catalogs are usually read-only, except while macros are being compiled or updated. Perhaps this answers the "why this file in work folder is not writable" part of your question.

Difference in file size of an Excel file when downloading directly as opposed to open and saving it

May be the title of my question is really awful but I couldn't figure a better way to frame it. So the problem is I have a Silverlight web app that does some processing and generates an Excel file as output. THe Excel generation code uses OpenXML format to create various XML parts and packages and using System.Packaging.CompressionOptions I compress the file generated. Now, when the browser (IE 9) shows a download options box, if I click Open to open the file in Excel and then do a SaveAs, it saves the file with a further reduced size as opposed to if I hit Save directly on the download box in which case it saves it with whatever size the file was created with.
Any ideas why these 2 ways of saving the same file result in different sizes?
Cheers
Depending on how you used the OpenXML library, there might be some inefficiencies or errors. Resaving the file in Excel will fix any duplicate formatting, update the metadata (possibly reducing it) and fix any validation errors. I encourage getting the Open XML SDK 2.0 Productivity Tool provided with the OpenXML SDK to check for any validation errors and to better understand where more inefficiencies might lie. It is possible to automatically resave the file using Excel by using Interop (using C# anyways).